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

Function executeSubagentStartHooks

src/utils/hooks.ts:4091–4111  ·  view source on GitHub ↗
(
  agentId: string,
  agentType: string,
  signal?: AbortSignal,
  timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
)

Source from the content-addressed store, hash-verified

4089 * @returns Async generator that yields progress messages and hook results
4090 */
4091export async function* executeSubagentStartHooks(
4092 agentId: string,
4093 agentType: string,
4094 signal?: AbortSignal,
4095 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
4096): AsyncGenerator<AggregatedHookResult> {
4097 const hookInput: SubagentStartHookInput = {
4098 ...createBaseHookInput(undefined),
4099 hook_event_name: 'SubagentStart',
4100 agent_id: agentId,
4101 agent_type: agentType,
4102 }
4103
4104 yield* executeHooks({
4105 hookInput,
4106 toolUseID: randomUUID(),
4107 matchQuery: agentType,
4108 signal,
4109 timeoutMs,
4110 })
4111}
4112
4113/**
4114 * Execute pre-compact hooks if configured

Callers 1

runAgentFunction · 0.85

Calls 2

createBaseHookInputFunction · 0.85
executeHooksFunction · 0.85

Tested by

no test coverage detected