Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
TypeScript
import type { On, Settings } from 'claude-code'
/**
* Answers a read of the policy source with one settings object and every
* other read, a named source or the merge, with another.
*
* @param on the test's `on`
* @param policy what `{ source: "policy" }` reads
* @param others what any other read answers
* @returns the registration
*/
export const policyBySource = (on: On, policy: Settings, others: Settings) =>
on('settings.read', ($, e) => ({
value: e.source === 'policy' ? policy : others,
}))