Lv.1 0 XP

Subagent Context Isolation — What Each Agent Knows and Doesn't Know

Core 8 min +35 XP
💡
THE ANALOGY

Briefing a contractor on their first day. You can't say 'you know what the previous contractor did last week, just continue from there.' You write everything they need in their brief. Your contractor brief is your subagent prompt — it must be self-contained.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Assuming subagents share memory or state through any mechanism other than explicit passing. They don't. Not via the coordinator's system prompt, not via global variables, not via databases unless YOU implement that pattern explicitly.

KEY POINTS
1 Every subagent starts with a completely blank context — no coordinator history, no other subagent results, no shared state of any kind.
2 Everything a subagent needs must be in its prompt — the user query, relevant prior findings, specific instructions, and any constraints.
3 Subagent prompts should specify goals and quality criteria, not step-by-step procedures — this preserves the subagent's ability to adapt.
4 Structured output from subagents makes coordinator aggregation reliable — unstructured text is hard to parse and combine.
5 The coordinator's system prompt is NOT visible to subagents — common mistake is putting shared instructions there and expecting subagents to follow them.