Subagents: How Specialized Agents Work (And What’s Official)
Subagents are isolated specialists with scoped tools and separate context.
“Subagents” sounds like marketing until you look at the underlying constraint it addresses.
From first principles, a single agent conversation has two problems:
- Context contamination: lots of intermediate notes and searches pollute the main thread.
- Tool risk: a general agent with broad permissions can do the wrong thing.
Subagents solve both by creating specialists with separate context and restricted tool access.
What Subagents Are (Official Anthropic Definition)
Anthropic’s Claude Code documentation explicitly supports “custom AI subagents” stored as Markdown files with YAML frontmatter:
- Project subagents in
.claude/agents/ - User subagents in
~/.claude/agents/
https://docs.claude.com/en/docs/claude-code/settings
Anthropic’s Agent SDK also documents subagents and emphasizes:
- subagents maintain separate context from the main agent
- they can have restricted tool access
- they can run concurrently for speed
https://docs.claude.com/en/docs/claude-code/sdk/subagents
The Core Pattern
Think of a subagent as a constrained worker:
- The main agent holds the plan and integrates results.
- A research subagent can scan files and summarize without editing.
- A code-review subagent can read diffs and flag risk without changing code.
- A test-runner subagent can run approved commands and return logs.
The system benefit is composability: you can build a workflow out of small, reliable parts.
Why Separation of Context Matters
If a research pass dumps 30 files worth of notes into the main context, you get:
- slower responses
- higher cost
- worse reasoning (too much irrelevant text)
Anthropic calls out the value directly: a research subagent can explore “without cluttering the main conversation” and return only relevant findings.
https://docs.claude.com/en/docs/claude-code/sdk/subagents
Why Tool Scoping Matters
Tool scoping turns “trust” into configuration.
Anthropic gives examples like a doc-reviewer subagent that only has read tools so it “can analyze but never accidentally modify” docs.
https://docs.claude.com/en/docs/claude-code/sdk/subagents
This is a concrete safety move: least privilege by construction.
Are Subagents Universal Across All Agents?
Many agent frameworks support “multi-agent” patterns, but the implementation details differ.
What we can say officially (and precisely) is:
- Subagents are a supported concept in Claude Code (filesystem-defined agents) and in Anthropic’s Agent SDK (programmatic and filesystem-based definitions).
https://docs.claude.com/en/docs/claude-code/settings
https://docs.claude.com/en/docs/claude-code/sdk/subagents
Other tools may have equivalents (workers, copilots, parallel tasks), but “subagent” isn’t a single standardized mechanism across every vendor today.
How This Applies to OutcomeDev
OutcomeDev already operationalizes the same first-principles constraints:
- tasks run in isolated sandboxes
- tools are attached explicitly via connectors (MCP servers)
- execution is verified by commands and logs
Subagents are a natural extension of that philosophy: split “do work” into smaller specialists and keep the main task focused on plan + integration.
Sources
- Claude Code settings (subagent locations) — https://docs.claude.com/en/docs/claude-code/settings
- Claude Code SDK subagents — https://docs.claude.com/en/docs/claude-code/sdk/subagents