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

Function executeSetupHooks

src/utils/hooks.ts:3997–4017  ·  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

3995 * @returns Async generator that yields progress messages and hook results
3996 */
3997export async function* executeSetupHooks(
3998 trigger: 'init' | 'maintenance',
3999 signal?: AbortSignal,
4000 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4001 forceSyncExecution?: boolean,
4002): AsyncGenerator<AggregatedHookResult> {
4003 const hookInput: SetupHookInput = {
4004 ...createBaseHookInput(undefined),
4005 hook_event_name: 'Setup',
4006 trigger,
4007 }
4008
4009 yield* executeHooks({
4010 hookInput,
4011 toolUseID: randomUUID(),
4012 matchQuery: trigger,
4013 signal,
4014 timeoutMs,
4015 forceSyncExecution,
4016 })
4017}
4018
4019/**
4020 * 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