Token Efficiency Encyclopedia

Subagents as Context Firewalls

A subagent does not see what its parent has been doing. It starts from an empty context, and the only thing it knows is the prompt the parent hands it. This is usually described as a limitation — "the subagent lacks context" — but it is the mechanism that makes delegation pay: the parent's accumulated transcript, however long it has grown, costs nothing to dispatch a child, because none of it travels downward.

The parent therefore does not share context with a child. It constructs the child's context, one field at a time: the task, the paths, the acceptance criteria, the return format. Everything the child needs must be stated; everything else is, by construction, firewalled out.

Principle

Children never inherit the parent's history. The parent writes exactly the input the child gets, and gets back exactly what it asked for. Both directions of the boundary are closed by default, which preserves the parent's own context for coordination rather than for content.

The Two Directions

The firewall has an inbound and an outbound side, and they save different things:

An agent can implement one without the other. A "fork"-style subagent that inherits the full parent conversation gives the upward saving but not the downward one — useful when the child genuinely needs the history, expensive when it does not.

Consequences of the Firewall

The Parent Stays a Coordinator

Because content never flows back in bulk and history never flows out, the parent's transcript accumulates decisions and results rather than material. A session that fans out ten investigations holds ten conclusions, not ten corpora plus ten copies of itself. This is what makes long-running orchestration viable at all.

Parallel Dispatch Becomes Cheap

Independent children share nothing, so there is no ordering constraint and no combined context to fit into a window. N children cost N constructed prompts, not N copies of the parent. The firewall is the precondition for fan-out, not a side effect of it.

The Prompt Is the Whole Interface

The child cannot ask "what were we doing?" — there is no shared referent. Deictic instructions ("continue with the other one", "same as before", "the file we discussed") resolve to nothing. The parent must inline the referents.

Underspecification Fails Silently

A child missing a constraint does not error; it invents a plausible one and returns confident output. The cost of a firewall is that the parent must front-load the brief, and cannot rely on ambient correction.

Constructing a Child's Input

Trade-offs

Firewalled child Inheriting fork
Input cost Size of the constructed brief Size of the parent transcript
Cost growth over a session Flat Grows with every parent turn
Briefing effort High — all referents inlined None
Failure mode Silent underspecification Cost, and irrelevant context distracting the child

Anti-patterns

See Also

Tools