MCPcopy Index your code
hub / github.com/claude-code-best/claude-code / executePostToolHooks

Function executePostToolHooks

src/utils/hooks.ts:3594–3621  ·  view source on GitHub ↗
(
  toolName: string,
  toolUseID: string,
  toolInput: ToolInput,
  toolResponse: ToolResponse,
  toolUseContext: ToolUseContext,
  permissionMode?: string,
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
)

Source from the content-addressed store, hash-verified

3592 * @returns Async generator that yields progress messages and blocking errors for automated feedback
3593 */
3594export async function* executePostToolHooks<ToolInput, ToolResponse>(
3595 toolName: string,
3596 toolUseID: string,
3597 toolInput: ToolInput,
3598 toolResponse: ToolResponse,
3599 toolUseContext: ToolUseContext,
3600 permissionMode?: string,
3601 signal?: AbortSignal,
3602 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
3603): AsyncGenerator<AggregatedHookResult> {
3604 const hookInput: PostToolUseHookInput = {
3605 ...createBaseHookInput(permissionMode, undefined, toolUseContext),
3606 hook_event_name: 'PostToolUse',
3607 tool_name: toolName,
3608 tool_input: toolInput,
3609 tool_response: toolResponse,
3610 tool_use_id: toolUseID,
3611 }
3612
3613 yield* executeHooks({
3614 hookInput,
3615 toolUseID,
3616 matchQuery: toolName,
3617 signal,
3618 timeoutMs,
3619 toolUseContext,
3620 })
3621}
3622
3623/**
3624 * Execute post-tool-use-failure hooks if configured

Callers 1

runPostToolUseHooksFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected