Skip to content
BENIBIX Learn

SubagentStop Hook

AI⌨️ Claude CodeConfiguration

Also known as SubagentStop

The event when a helper agent ends. A hook can make it go on.

Think of it like

It is like you check a helper's work. Then they can go home.

Example

Jack's review helper kept ending with no summary. His hook blocks it until a summary is there.

Why it matters

A subagent's answer is all the main chat gets. This checks it is complete.

Definition

SubagentStop is the hook event that fires when a subagent finishes its answer. It works like Stop, but for the helper. A hook can block the stop with a reason, and the subagent keeps working. It also fires for small agents Claude Code runs for itself, which have an empty agent name.

Example code

json
{
  "decision": "block",
  "reason": "List the files you changed before you finish."
}
Send the subagent back with a task.

Common mistake

Using an empty matcher and being surprised by extra runs. Internal agents fire it too.

Key takeaways

  1. 1
    When a helper finishes. Like Stop.
  2. 2
    Block with a reason. It goes on.
  3. 3
    Internal agents too. Empty name.