Lv.1 0 XP

Subagent Spawning Patterns — Choosing the Right Approach

Core 7 min +30 XP
💡
THE ANALOGY

Staffing a project. Sometimes you hire specialists with specific skill sets (scoped subagents). Sometimes you bring in a generalist who figures out their own approach (dynamic subagents). Sometimes you fork an existing team member's work (fork_session). The right choice depends on what you need from them.

⚠️ EXAM TRAP — The Wrong Answer People Choose

Assuming all subagents should be maximally capable (many tools, broad scope). Scoped subagents with minimal tool access are more reliable and easier to reason about.

KEY POINTS
1 Static spawning: coordinator knows exactly which subagents to spawn at design time — use for predictable, well-understood workflows.
2 Dynamic spawning: coordinator decides at runtime which subagents to spawn based on what it discovers — use for open-ended investigation tasks.
3 Explore subagent: specialized pattern for verbose discovery that would fill the coordinator context window — returns only summary, not raw discovery output.
4 The Explore subagent pattern prevents context exhaustion during large codebase analysis or multi-source research.
5 Spawning failure: subagent errors should be returned as structured tool_results, not exceptions that crash the coordinator.