← Back to patterns
build

Anthropic's Disposable Subagent Architecture for Parallel Search

TRIGGER

Long-running agents accumulate context from exploratory searches, causing context window bloat where most retrieved information isn't ultimately useful for the final task.

APPROACH

The Claude Agent SDK enables orchestrator agents to spawn subagents with isolated context windows, achieving parallelization and context management simultaneously. Input: search queries distributed to N subagents. Output: condensed summaries (typically 1,000-2,000 tokens) returned to orchestrator, discarding tens of thousands of tokens of exploration context. For an email agent, the orchestrator spawns multiple search subagents in parallel—each searching different date ranges or running different queries—and each returns only relevant excerpts rather than full email threads. Anthropic's multi-agent research system used this pattern to outperform single-agent systems on complex queries, with parallel execution cutting research time by up to 90%. The isolation boundary acts as a compression function: subagents explore extensively but the orchestrator receives only distilled findings.

PATTERN

Your agent's quality degrades after 3-4 search iterations not because of bad prompts, but because the context window filled with search debris. Subagents with isolated contexts explore broadly but return only relevant excerpts—context isolation at the boundary acts as a compression function.

WORKS WHEN

  • Search tasks are embarrassingly parallel (different queries, date ranges, or data partitions)
  • Most retrieved content will be discarded after filtering (>80% irrelevant)
  • Orchestrator needs synthesis across multiple searches but not raw details
  • Subagent spawning cost is lower than context window overflow cost (typically when context exceeds 50k tokens)

FAILS WHEN

  • Search results require cross-referencing between subagent results before filtering (dependencies break isolation)
  • Subagent overhead exceeds benefit for small searches (<5k tokens of potential context)
  • Task requires maintaining full audit trail of all explored content
  • Latency budget doesn't allow for subagent coordination overhead

Stage

build

From

September 2025

Want patterns like this in your inbox?

3 patterns weekly. No fluff.