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 { EventResult, On } from 'claude-code'
import { ASKED } from './asked.js'
/**
* Answers every `tool.check` beneath the plugins with one verdict of a list,
* the first until the answer is called, then the next; past the last, ASKED.
*
* @param on the test's `on`
* @param verdicts what the engine's evaluation decides, call after call
* @returns `() => void`: from then on the next verdict answers
*/
export function checksAnsweredInTurn(
on: On,
verdicts: readonly EventResult<'tool.check'>[],
) {
let at = 0
on('tool.check', () => verdicts[at] ?? ASKED)
return () => {
at += 1
}
}