MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / executeSetupHooks

Function executeSetupHooks

src/utils/hooks.ts:4061–4081  ·  view source on GitHub ↗
(
  trigger: 'init' | 'maintenance',
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
  forceSyncExecution?: boolean,
)

Source from the content-addressed store, hash-verified

4059 * @returns Async generator that yields progress messages and hook results
4060 */
4061export async function* executeSetupHooks(
4062 trigger: 'init' | 'maintenance',
4063 signal?: AbortSignal,
4064 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4065 forceSyncExecution?: boolean,
4066): AsyncGenerator<AggregatedHookResult> {
4067 const hookInput: SetupHookInput = {
4068 ...createBaseHookInput(undefined),
4069 hook_event_name: 'Setup',
4070 trigger,
4071 }
4072
4073 yield* executeHooks({
4074 hookInput,
4075 toolUseID: randomUUID(),
4076 matchQuery: trigger,
4077 signal,
4078 timeoutMs,
4079 forceSyncExecution,
4080 })
4081}
4082
4083/**
4084 * Execute subagent start hooks if configured

Callers 1

processSetupHooksFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected