Emerging concepts

Subagent

AI-assisted editorial review:

A subagent is a helper AI agent that a main agent calls for a specific task. It runs in its own context window with its own instructions, tool access, and permissions, and typically returns its result or summary to the main agent.[1][5]

What does Subagent mean in simple terms?

A subagent lets a main AI hand part of its work to another, focused AI. Think of a team lead who gives research, slide drafting, and fact-checking to different team members and then combines what comes back. The main agent keeps the big picture, while each subagent looks only at its own task, so no single agent has to hold everything at once. The long search results or logs a subagent reads stay inside the subagent; the main conversation receives only a summary.[1] This is most useful when the same well-defined job comes up again and again, such as code review, running tests, or searching through documents.

How can Subagent be explained with an analogy?

It works like a project manager who sends one brief to several outside teams at the same time and then merges only their final reports.

Where is Subagent used?

Case 1

Anthropic Research — Parallel research subagents (company-reported)

Anthropic's Research feature in Claude uses an orchestrator-worker design. A lead agent breaks the user's question into parts and spins up 3–5 subagents in parallel, and each subagent calls 3 or more tools in parallel to gather information.[2] On Anthropic's internal research evaluation, a system with Claude Opus 4 as the lead and Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2%. One example was finding all board members of the Information Technology companies in the S&P 500, which the single agent failed to do with slow, sequential searches.[2] Anthropic also reported that parallelization cut research time by up to 90% for complex queries.[2]
Result (Anthropic internal evaluation): +90.2% versus a single Claude Opus 4 agent.[2]

Case 2

Kurly — Exploring a codebase domain by domain

Kurly's tech blog (December 2025) showed a log of four Claude Code Explore subagents searching one codebase in parallel, split into authentication, payment, notification, and search domains.[4] The authentication agent used 9 tool calls and 26.0k tokens, payment 6 calls and 14.7k tokens, notification 4 calls and 15.9k tokens, and search 7 calls and 14.8k tokens.[4] The author's point was that analyzing a whole codebase in one long context risks "Lost in the Middle", where information in the middle of a long context gets missed, while splitting by domain lets each agent work precisely in a small context.[4] Typical uses are learning in-house code conventions and checking the impact of a change.
Result: One large exploration split into four domain-level contexts of 14.7k–26.0k tokens each (Kurly's published log).[4]

Case 3

A read-only review subagent — Narrowing permissions

Anthropic's documentation describes giving a subagent a focused system prompt and a limited tool set. One documented allowlist includes Read, Grep, Glob, and Bash, which removes dedicated Write, Edit, and MCP tools. Bash can still run commands with side effects, so this alone is not a filesystem read-only guarantee.[1] The documented code-reviewer example instead allows only Read, Glob, and Grep.[1] The SDK documentation shows the same idea: a code reviewer with read-only tools and a separate test runner with Bash, Read, and Grep to run tests and analyze output.[5] Review and inspection steps that do not need write access are a natural fit.
Result: The review subagent can read and search code but cannot change files (configuration documented by Anthropic).[1][5]

Case 4

Microsoft AutoGen — An early research framework for multi-agent work

AutoGen, published by Microsoft Research and collaborators in August 2023, is an open-source framework for building LLM applications from multiple agents that converse with each other to complete tasks.[3] Agents can combine LLMs, human input, and tools, and developers can define how agents interact in natural language or code.[3] The paper reports example applications in domains including mathematics, coding, question answering, operations research, online decision-making, and entertainment.[3] It is a useful primary reference when designing role-specific agents such as a "math solver" and a "code checker".
Result: Effectiveness demonstrated across example applications in multiple domains (authors' empirical studies).[3]

Try it today

  1. In Claude Code, look at the built-in subagents such as Explore (fast, read-only codebase search) and Plan (research in plan mode).[1]
  2. Create one file, .claude/agents/code-reviewer.md, with name, description, and tools in its frontmatter, or ask Claude to write it for you. Only name and description are required.[1]
  3. Set tools to Read, Grep, and Glob to remove file-changing tools from this reviewer. Denying only Write and Edit still leaves other possible write paths, such as Bash or MCP tools.[1]
  4. Write a short, clear description; include a phrase like "use proactively" to encourage automatic delegation, or @-mention the subagent to make sure it runs.[1]
  5. For a large codebase, ask for several Explore subagents in parallel, one per domain, and compare token use and elapsed time with a single pass. Subagent requests count toward the same usage limits as your main conversation.[1][4]

Limits and direction

Anthropic's own write-up lists the costs. In its data, agents used about 4 times more tokens than chat interactions, and multi-agent systems about 15 times more, so the approach suits tasks whose value justifies the cost.[2] Tasks where all agents must share the same context, or where agents depend heavily on one another, are not a good fit today; Anthropic notes that most coding tasks have fewer truly parallel parts than research.[2] Early versions of its system spawned 50 subagents for simple queries and searched endlessly for nonexistent sources, which Anthropic addressed with prompt rules that scale effort to query complexity and with explicit guardrails.[2] Kurly also notes that results from several subagents can conflict because each works in an independent context; it suggests passing shared context to every subagent and adding a final step that merges the results.[4]

The design is moving toward asynchronous execution and less copying through the lead agent. Anthropic's lead agent waits for each set of subagents to finish, so one slow subagent can block the whole system; asynchronous execution would add parallelism but makes coordination, state consistency, and error handling harder.[2] Anthropic also describes subagents storing outputs in external systems such as a file system and passing lightweight references back, to avoid information loss.[2] In Claude Code, subagents work inside a single session, while background agents, cross-session messaging, and agent teams cover work across sessions.[1] As documented for TypeScript SDK v0.3.219 and Python SDK v0.2.127 or later (bundling Claude Code v2.1.219 or later), subagents can spawn their own subagents; the SDK sets a default depth of 3 layers and 20 concurrent subagents, offers a spend cap, and points to a separate Workflow tool for runs that coordinate dozens to hundreds of agents.[5] The SDK lets developers define subagents in code, which also opens non-coding uses such as internal back-office automation.[5]

How has Subagent evolved?

2023-08-16
AutoGen paper
Microsoft Research and collaborators publish AutoGen, a framework for building applications from multiple conversing agents.[3]
2025-06-13
Anthropic multi-agent research system
Anthropic explains how Claude's Research feature uses a lead agent that spawns parallel subagents.[2]
2025-12-17
Explore subagents in practice
Kurly publishes a log of four Claude Code Explore subagents exploring a codebase in parallel by domain.[4]
2026-10
Documented nested-subagent limits (snapshot)
Claude Code documentation describes subagents that can spawn their own subagents, with default limits on depth and concurrency and an optional spend cap.[5]

Which concepts are related to Subagent?

  • Foundation
    AI AgentA subagent is a kind of AI agent that can use tools and act on its own, but it works on a task delegated by a main agent.[1]
  • Next step
    Multi-Agent OrchestrationScaling the pattern up leads to several agents working in parallel or in sequence under coordination.[2]
  • Related concept
    AI OrchestrationOrchestration manages the flow across AI systems and models; a subagent is one unit of execution inside that flow.[2]
  • Tool
    Claude CodeClaude Code provides built-in and custom subagents for tasks such as code search, review, and testing.[1]

Subagent vs Multi-Agent Orchestration

ComparisonSubagentMulti-Agent Orchestration
PatternA main agent delegates one task to a helper and receives its result[1]Several agents with assigned roles work in parallel or in sequence[2][3]
CommunicationTypical delegation flow: main agent → subagent → result or summary back[5]Agents may exchange messages and give each other feedback[3]
StrengthsKeeps the main context clean; easy to specialize and restrict tools; simpler to build and debug[1]Can tackle complex, broad tasks from several angles[2]
WeaknessesSubagents cannot easily coordinate with each other; the main agent must handle all coordination[2]High coordination overhead, harder debugging, and much higher token use[2]

Which sources explain Subagent?

  1. Anthropic — Claude Code Docs: Create custom subagents — https://code.claude.com/docs/en/sub-agents
  2. Anthropic Engineering — How we built our multi-agent research system (2025-06-13) — https://www.anthropic.com/engineering/multi-agent-research-system
  3. Wu et al. (Microsoft Research), arXiv — AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation (2023-08-16) — https://arxiv.org/abs/2308.08155
  4. Kurly Tech Blog — Predictable vibe coding strategies with Claude Code (2025-12-17) — https://helloworld.kurly.com/blog/vibe-coding-with-claude-code/
  5. Anthropic — Claude Code Docs: Subagents in the SDK — https://code.claude.com/docs/en/agent-sdk/subagents