* Dispatch all PostToolUse hooks for a tool.
(sandbox, toolName, toolInput, toolResult)
| 126 | /** |
| 127 | * Dispatch all PostToolUse hooks for a tool. |
| 128 | */ |
| 129 | function postToolUse(sandbox, toolName, toolInput, toolResult) { |
| 130 | const scripts = getHooksForEvent(sandbox, 'PostToolUse', toolName); |
| 131 | for (const scriptPath of scripts) { |
| 132 | spawnSync('node', [scriptPath], { |
| 133 | input: JSON.stringify({ tool_name: toolName, tool_input: toolInput, tool_result: toolResult }), |
| 134 | cwd: sandbox, |
| 135 | env: { ...process.env, CLAUDE_PROJECT_DIR: sandbox, CLAUDE_PLUGIN_DATA: path.join(sandbox, '.claude') }, |
| 136 | encoding: 'utf8', |
| 137 | timeout: 30000, |
| 138 | }); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // ── Tool execution ───────────────────────────────────────────────────────────── |
no test coverage detected