CONCEPT The two-sided rule
Because sub-agents are context-isolated (4.4), the coordinator must hand each one the state it needs explicitly. But there's a second edge: passing too much bloats the sub-agent's context, costs tokens, and can distract it. So the rule has two sides:
- Completeness: pass all the state the sub-task genuinely requires — don't assume it's "known."
- Minimality: pass the minimum needed — avoid dumping the whole history to prevent context explosion.
| Failure mode | Cause | Symptom |
|---|---|---|
| Lost state | Under-passing — assumed the sub-agent knew it | Sub-agent hallucinates, asks, or produces wrong output |
| Context explosion | Over-passing — dumped full history "to be safe" | Higher tokens/cost/latency; specialist loses focus |
CONCEPT How to decide what to pass
For each sub-task, ask: what facts must this specialist have to do its job well? Include those and nothing else. Typical payload: the specific inputs (a doc, a number, constraints), relevant prior results, and the acceptance criteria. Exclude: unrelated turns, other specialists' internal reasoning, and the coordinator's scratch work.
DIAGRAM The state payload
(minimal + complete)"] F2 --> P X1 -. excluded .-x P X2 -. excluded .-x P P -->|delegate| SUB["🔵 Sub-agent (isolated)"] classDef p fill:#e2d4f0,stroke:#764ba2,color:#3d1a5b; classDef b fill:#d1ecf1,stroke:#17a2b8,color:#0c5460; classDef pack fill:#fff9db,stroke:#b08900,color:#7a5c00; class CTX p; class SUB b; class P pack;
CODE Delegate with an explicit state payload
Build a small, structured payload of exactly what the specialist needs, then send it as the delegated task.
# Collect only the state THIS sub-task requires — complete but minimal. state = { "objective": "Recommend a database for the workload below.", "constraints": {"budget_usd_mo": 5000, "region": "eu-west"}, "workload": workload_summary, # the specific input it must reason over "prior_findings": research_result, # a relevant earlier result — passed in, not assumed # NOTE: no coordinator chit-chat, no other specialists' scratch work. } import json task = f"Task:\n{json.dumps(state, indent=2)}\n\nReturn a single recommendation with a one-line reason." specialist = client.messages.create( model="claude-sonnet-4-6", max_tokens=1024, system="You are a database-selection specialist. Use ONLY the state provided.", messages=[{"role": "user", "content": task}], # the explicit, self-contained payload )
TRADE-OFFS Completeness vs. minimality
✅ Lean, complete payload
- Sub-agent has exactly what it needs
- Lower tokens, cost, and latency
- Specialist stays focused on its task
⚠️ Getting it wrong
- Too little → lost-state bug, wrong output
- Too much → context explosion, distraction
- "Just pass everything" is not the safe default
EXAM TRAPS
PRACTICE
Q1 · A drafting sub-agent produces off-topic copy. The coordinator "told" it the brief earlier in its own turn. Diagnosis?
Lost-state bug. The brief lived in the coordinator's context, which the isolated sub-agent can't see. Fix: put the brief into the delegated message payload.
Q2 · A team fixes lost-state by piping the full 40-turn history into every sub-agent. New problem?
Context explosion. Tokens, cost, and latency spike, and specialists lose focus. Pass only the minimum required state per sub-task, not the whole transcript.
Q3 · Why prefer a structured (e.g. JSON) state payload over free-form prose?
It makes exactly what you passed auditable and keeps the payload tight — easy to see if a required field is missing (lost state) or if you're over-including (explosion).