Skip to content
BENIBIX Learn

SubagentStart Hook

AI⌨️ Claude CodeConfiguration

Also known as SubagentStart

The event when Claude starts a helper agent.

Think of it like

It is like a sheet at the door. Each helper signs it when they come in.

Example

Lucy wants to know how often Claude hands work to her reviewer subagent. A SubagentStart hook counts each one.

Why it matters

Subagents work out of sight. This is a window onto when they begin.

Definition

SubagentStart is the hook event that fires when Claude starts a subagent, or resumes one. The matcher picks the agent by its name, such as Explore, Plan or one of your own. The hook gets an id for that subagent. It is used to log helpers or to set something up before one starts work.

Example code

json
{
  "hooks": {
    "SubagentStart": [
      { "matcher": "code-reviewer", "hooks": [{ "type": "command", "command": "./log-agent.sh start" }] }
    ]
  }
}
Log when the reviewer subagent starts.

Common mistake

Matching a plugin's subagent by its short name. Use its full plugin name, anchored with ^ and $.

Key takeaways

  1. 1
    When a helper starts. Or resumes.
  2. 2
    Match the name. Explore, Plan, yours.
  3. 3
    Gets an id. For logs.