MCPcopy
hub / github.com/codeaashu/claude-code / executeSubagentStartHooks

Function executeSubagentStartHooks

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

3930 * @returns Async generator that yields progress messages and hook results
3931 */
3932export async function* executeSubagentStartHooks(
3933 agentId: string,
3934 agentType: string,
3935 signal?: AbortSignal,
3936 timeoutMs: number = TOOL_HOOK_EXECUTION_TIMEOUT_MS,
3937): AsyncGenerator<AggregatedHookResult> {
3938 const hookInput: SubagentStartHookInput = {
3939 ...createBaseHookInput(undefined),
3940 hook_event_name: 'SubagentStart',
3941 agent_id: agentId,
3942 agent_type: agentType,
3943 }
3944
3945 yield* executeHooks({
3946 hookInput,
3947 toolUseID: randomUUID(),
3948 matchQuery: agentType,
3949 signal,
3950 timeoutMs,
3951 })
3952}
3953
3954/**
3955 * 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