delegation-protocollisted
Install: claude install-skill rustcircle/c101
# Delegation protocol
## 1. Read your header first
The `pre-agent` hook prepends one line to every subagent prompt:
`<stack-context depth="3" max_depth="8" parent="orchestrator" remaining_depth="5" spawns_this_session="57" budget="ok" prompt_tokens="12.4M/120M" session_tokens="310M/3B" out_dir=".stack/out/rust-expert"/>`
| Attribute | Meaning | Use it for |
|---|---|---|
| `depth` | your level; the main thread is 0 | context only |
| `max_depth` | hard nesting limit (8, from settings env) | context only |
| `parent` | agent type that spawned you | who reads your reply; route scope doubts there |
| `remaining_depth` | levels still allowed below you | what you may spawn (section 2) |
| `spawns_this_session` | session-wide spawn count at your launch; a snapshot, siblings keep spawning | spawn headroom (section 2) |
| `budget` | `ok`, `soft` or `hard`: whole-tree token level (worse of session and prompt) | convergence rules (section 2) |
| `prompt_tokens` | tokens used by this user prompt / 120M max (soft 90M, guaranteed 30M) | headroom for new branches |
| `session_tokens` | tokens used this session / 3B max (soft 2.25B, guaranteed 750M) | headroom for new branches |
| `out_dir` | your file directory | output-contract offloading |
No header: as the main thread, depth 0, remaining_depth = max_depth, budget level from the
UserPromptSubmit context; inside a subagent (hook disabled), assume remaining_depth 1. No `budget`
attribute: treat it as `ok`. Only the hook writes this he