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

Function executeSessionStartHooks

src/utils/hooks.ts:4026–4051  ·  view source on GitHub ↗
(
  source: 'startup' | 'resume' | 'clear' | 'compact',
  sessionId?: string,
  agentType?: string,
  model?: string,
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
  forceSyncExecution?: boolean,
)

Source from the content-addressed store, hash-verified

4024 * @returns Async generator that yields progress messages and hook results
4025 */
4026export async function* executeSessionStartHooks(
4027 source: 'startup' | 'resume' | 'clear' | 'compact',
4028 sessionId?: string,
4029 agentType?: string,
4030 model?: string,
4031 signal?: AbortSignal,
4032 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4033 forceSyncExecution?: boolean,
4034): AsyncGenerator<AggregatedHookResult> {
4035 const hookInput: SessionStartHookInput = {
4036 ...createBaseHookInput(undefined, sessionId),
4037 hook_event_name: 'SessionStart',
4038 source,
4039 agent_type: agentType,
4040 model,
4041 }
4042
4043 yield* executeHooks({
4044 hookInput,
4045 toolUseID: randomUUID(),
4046 matchQuery: source,
4047 signal,
4048 timeoutMs,
4049 forceSyncExecution,
4050 })
4051}
4052
4053/**
4054 * Execute setup hooks if configured

Callers 1

processSessionStartHooksFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected