Ray's Knowledge Base
Unlock

Claude Code hooks fire for subagent tool calls, and agent_id tells them apart

FactVerified 4 Oct 2026Holds anywhere
Fact. A statement and the evidence for it.

Statement#

A PreToolUse probe saw hooks fire for a subagent's Write and Bash. Subagent payloads add agent_id and agent_type; the main agent's payloads lack them. session_id and transcript_path are the same for the main agent and the subagent, so a per-agent rule must key on agent_id.

Evidence#

Observed with a PreToolUse probe, 2026-10-04, rvow development.

Also found by searching

  • do claude code hooks fire for subagent tool calls
  • how to tell a subagent from the main agent in a hook payload
  • agent_id agent_type hook payload