Subagent
A subagent is a child agent spawned by a parent to handle a scoped sub-task · common pattern in Claude Code, Roo Code, and multi-agent frameworks.
A subagent is a child agent spawned by a parent to handle a scoped sub-task · common pattern in Claude Code, Roo Code, and multi-agent frameworks.
Basic
In multi-agent patterns, a parent "orchestrator" plans a task and delegates subtasks to "subagents." Each subagent runs in isolated context with its own tools and memory. Example: orchestrator plans a refactor; subagent A rewrites backend, subagent B updates tests, subagent C edits docs · all in parallel. Claude Code ships first-class subagent support (April 2025).
Deep
Subagent systems solve two problems: context window limits (each subagent has fresh context) and task specialization (each gets tailored prompts and tool subsets). Coordination patterns vary: Claude Code uses a parent that issues Task tool calls, each spawning a subagent that returns a summary. Roo Code runs multi-tab orchestration with persistent sub-workspaces. AutoGen and CrewAI formalize the pattern with role-named agents and turn-taking.
Expert
Subagent design trade-offs: isolation (more reliable, no context pollution) vs shared state (more efficient, less duplication). Common anti-patterns: recursive depth (subagent spawning subagent indefinitely), context loss at handoff (key details dropped when only summary returns), and latency amplification (parallel subagents lock-step to slowest). Best practice: fixed-depth task trees, explicit handoff contracts, and a "supervisor" pattern where the parent only receives structured output.
Subagent patterns are the hot agent research area of 2026 · Claude Code, Roo Code, and every enterprise framework are investing.
Depending on why you're here
- ·Subagent = isolated child agent with own context + tools
- ·Pattern formalized in AutoGen, CrewAI · shipping in Claude Code
- ·Trade-off: isolation vs shared state
- ·Use for tasks that naturally parallelize (multi-file refactors, parallel tests)
- ·Watch for recursive depth and context-loss bugs
- ·Claude Code and Roo Code ship reference implementations
- ·Multi-agent is the 2026 agent research frontier
- ·Enterprise AI workflows increasingly rely on subagent orchestration
- ·Moat: whoever nails the coordination layer wins the next generation
- ·One AI delegates to smaller AIs for sub-tasks
- ·Like a manager + team · each handles their part
- ·Shipped in Claude Code and similar tools
Subagents are the Lego brick of 2026 agentic workflows. Every serious orchestration framework converges on the pattern.