SubagentStart API

July 14, 2026 ยท View on GitHub

Available when inheriting from ClaudeHooks::SubagentStart:

Runs when a subagent task starts. Use it to inject context specific to the subagent or log the start.

Input Helpers

๐Ÿ“š Shared input helpers

The agent_id and agent_type common fields are populated for this event.

MethodDescription
agent_idThe subagent's unique ID
agent_typeThe subagent's type

Hook State Helpers

๐Ÿ“š Shared hook state methods

MethodDescription
add_additional_context!(context)Add contextual information for the subagent
add_context!(context)Alias for add_additional_context!

Output Helpers

๐Ÿ“š Shared output helpers

MethodDescription
output.additional_contextGet the additional context that was added

Hook Exit Codes

Exit CodeBehavior
exit 0Continues normally; STDOUT added as context
exit 2N/A โ€” non-blocking event