Three telemetry-driven fixes + three live-verified #2371 repairs. All examples below use the real shipped data.
Type a task description as if passing it to Agent(subagent_type="general-purpose"). The same regex map that ships in the hook runs here:
Telemetry that motivated this: 424 real spawns ā 17% general-purpose vs 10% specialists, and the old advisor whitelisted general-purpose so it could never suggest otherwise. The nudge is advisory: it never blocks, and generic stays correct for mixed tasks.
{"timestamp":"ā¦","subagent_type":"Explore",
"description":"", ā SubagentStart has no description/prompt
"session_id":"ā¦","agent_id":"a1b8cā¦",
"spawn_depth":1} ā fabricated: CC sends no parent_agent_id,
so NESTED spawns also logged 1 and the
depth ā„ 4 warning could never fire (#2371)
// PreToolUse[Task] ā the only event with the args: {"timestamp":"ā¦","source":"pretool", "subagent_type":"general-purpose", "description":"Investigate flaky CI failures", "session_id":"ā¦","tool_use_id":"toolu_ā¦"} // SubagentStart ā the only event with agent_id: {"timestamp":"ā¦","source":"start", "subagent_type":"general-purpose","description":"", "session_id":"ā¦","agent_id":"ad54cā¦" /* spawn_depth OMITTED ā no real lineage */}
Live-captured SubagentStart payload on CC 2.1.173 (the whole reason for the split):
{ session_id, transcript_path, cwd, agent_id, agent_type, hook_event_name }
ā no parent_agent_id Ā· no prompt Ā· no description Ā· no is_fork
ā depth telemetry stays dormant until anthropics/claude-code#16424 ships agent context
| Spawn attempt | Result (live-verified, CC 2.1.173) |
|---|---|
Agent(subagent_type="database-engineer") | FAILS ā "Agent type 'database-engineer' not found" |
Agent(subagent_type="ork:database-engineer") | resolves ā registry knows only the namespaced type |
Explore from an agent that never declared it | succeeds ā the parenthesized grant is ADVISORY; CC enforces nothing |
What shipped: all 16 grants across 11 agents rewritten to Agent(ork:ā¦), Delegation tables updated, and the CI guard now FAILS any bare-name grant:
case "$ref" in
*:*) ;;
*) echo "FAIL: ⦠bare Agent($ref) ā runtime registry only resolves
namespaced types (use Agent(ork:$ref), #2371)" ;;
esac
Workflow stages adopt specialists the same way ā audit-full-mapreduce.mjs now routes shard-audit + refute stages to ork:security-auditor when mode === "security" (and stays generic for mixed modes, on purpose).