8 pages for subagentstart.
Titles and paths first, then pages whose text carries it. Each row opens that page as this site last read it.
How the agent loop works
Claude Code CLI · in the page
agent-sdk/agent-loop
…hen the agent finishes | Validate the result, save session state | | `SubagentStart` / `SubagentStop` | When a subagent spawns or completes | Track and aggregate parallel task results | | `PreCompact`…
Intercept and control agent behavior with hooks
Claude Code CLI · in the page
agent-sdk/hooks
…API error instead of a normal stop | Log failures or send alerts | | `SubagentStart` | Yes | Yes | Subagent initialization | Track parallel task spawning | | `SubagentStop` | Yes | Yes | Subagent comp…
Agent SDK reference - Python
Claude Code CLI · in the page
agent-sdk/python
…compaction "Notification", # Called for notification events "SubagentStart", # Called when a subagent starts "PermissionRequest", # Called when a permission decision is needed ] ``` >…
Agent SDK reference - TypeScript
Claude Code CLI · in the page
agent-sdk/typescript
…| "SessionStart" | "SessionEnd" | "Stop" | "StopFailure" | "SubagentStart" | "SubagentStop" | "PreCompact" | "PostCompact" | "PreModelSwitch" | "PostModelSwitch" | "PermissionReq…
Hooks reference
Claude Code CLI · in the page
hooks
…e, PermissionRequest, PostToolUse, PostToolUseFailure, PostToolBatch, SubagentStart/Stop, TaskCreated, TaskCompleted), and Stop or StopFailure, followed by TeammateIdle, PreCompact, PostCompact, and S…
Automate actions with hooks
Claude Code CLI · in the page
hooks-guide
…| | `MessageDisplay` | While assistant message text is displayed | | `SubagentStart` | When a subagent is spawned | | `SubagentStop` | When a subagent finishes | | `TaskCreated` | When a task is being…
Customize your status line
Claude Code CLI · in the page
statusline
…ds the same value that hooks receive as [`agent_type`](/docs/en/hooks#subagentstart). Requires Claude Code v2.1.293 or later | | `status` | string | State of the task, such as `running`, `completed`,…
Create custom subagents
Claude Code CLI · in the page
sub-agents
…, such as `code-reviewer` or `reviewer-v2`. [Hooks](/docs/en/hooks.md#subagentstart) receive this value as `agent_type`. The filename doesn't have to match. Names can't contain `:`, which is reserved…