🪆 Depth Injection Simulator — click a hop in the example 5-level chain to see exactly what the context-stager injects (CC 2.1.172)

Example chain

Injected NESTING context:
Depth registry (.claude/logs/agent-depth.json) after this spawn:
Implementation: subagent-context-stager calls resolveAndRecordDepth() (lib/spawn-depth.ts) at SubagentStart — the first point where CC guarantees agent_id + parent_agent_id. Depth 1 injects nothing (zero tokens for the common case); depth ≥ 2 tells the agent where it sits; depth ≥ 3 (the budget) adds a hard "do not spawn deeper" instruction. CC hard-caps chains at 5. Pairs with the 11 agents' new ## Delegation sections and the test-agent-delegation-docs.sh CI guard.