spacehub

surshar / claude-code

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.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / fixtures / tool-check / asking.ts
19 lines · 478 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin the person installed that hears the verdict beneath it on
5 * `tool.check`, then puts the call to the person whatever it heard.
6 *
7 * @param name the plugin's name
8 * @returns the plugin
9 */
10export const asking = (name: string): Plugin => ({
11 name,
12 register(on) {
13 on('tool.check', async ($, e, next) => {
14 await next(e)
15
16 return { decision: 'ask', reason: 'Bash needs approval' }
17 })
18 },
19})