MCPcopy Create free account
hub / github.com/SethGammon/Citadel / postToolUse

Function postToolUse

scripts/integration-test.js:128–139  ·  view source on GitHub ↗

* Dispatch all PostToolUse hooks for a tool.

(sandbox, toolName, toolInput, toolResult)

Source from the content-addressed store, hash-verified

126/**
127 * Dispatch all PostToolUse hooks for a tool.
128 */
129function 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 ─────────────────────────────────────────────────────────────

Callers 1

Calls 1

getHooksForEventFunction · 0.85

Tested by

no test coverage detected