A subagent is an artificial intelligence (AI) agent started by another agent to carry out one delegated piece of work. The parent, usually called the lead agent or orchestrator, writes a task description, hands it over, and gets back a condensed result. The subagent works in its own context window - the block of text a large language model (LLM) can hold in view at once - with its own instructions and, often, a narrower set of tools. It exists because long tasks fill a single model's working memory with search results, logs and files irrelevant to the final answer, and because some tasks split into parts that can run at the same time. What makes it a distinct term is the boundary: the subagent does not share the parent's conversation, and the parent sees only what the subagent reports.

How delegation works

The pattern has five steps in most implementations.

  1. Decision to delegate. The lead agent decides a task is self-contained enough to hand off. In Claude Code, Anthropic's command-line coding agent, it matches the task against short descriptions of the available subagents.
  2. Briefing. The parent calls a delegation tool - Agent in current Claude Code, formerly Task - with a written prompt, the subagent's only knowledge of the work. Claude Code's documentation states that subagents receive "only this system prompt plus basic environment details like the working directory, not the Claude Code system prompt."
  3. Isolated execution. The subagent searches, reads files, calls tools and reasons inside a separate context window, drawing on the same usage limits as the parent.
  4. Return. It sends a summary back. The raw material stays behind.
  5. Synthesis. The parent combines the summary with other results and continues.

A hypothetical example shows the economics. An agent asked to audit 40 Google Ads campaigns for pacing problems might read 300,000 tokens of exports before writing a line. A lead agent can instead start four subagents of ten campaigns each. Each reads about 75,000 tokens and returns a 500-word finding, so the lead holds four short reports rather than 40 exports. Total tokens rise, since each subagent repeats some setup, but the lead's view stays clean.

Configuration is where the term becomes concrete. Claude Code defines custom subagents as Markdown files with YAML frontmatter, stored in .claude/agents/ for a project or ~/.claude/agents/ for a user. Only two fields are required, name and description. Optional fields include tools and disallowedTools, model, permissionMode, maxTurns to cap the number of steps, memory, and isolation: worktree, which gives the subagent a separate copy of a git repository so its edits cannot collide with the parent's. Claude Code ships built-in types too: Explore for read-only searches, Plan for research during planning mode, and a general-purpose agent for tasks that need both reading and editing.

Other frameworks reach the same structure under different names. Google's Agent Development Kit (ADK) gives every agent a sub_agents list and a parent_agent field; its source code notes that "an agent can ONLY be added as sub-agent once," which makes the system a strict tree. OpenAI's Agents SDK offers two patterns. Under agents as tools, "a manager agent keeps control of the conversation and calls specialist agents through Agent.as_tool()," according to the SDK documentation. Under handoffs, a triage agent passes the conversation to a specialist, which then becomes the active agent.

Who builds and runs them

Subagents appear in coding agents, in frameworks such as ADK, the OpenAI Agents SDK and LangGraph, and, in marketing technology, behind products where a coordinating agent directs specialist ones. Mediaocean's chief innovation officer, Zvika Netter, summarised its NIVO system in June 2026 as "NIVO thinks, Orchestrator connects, and Agents act." NIVO directs twelve specialised agents grouped into creative, delivery, measurement and optimisation. Buy-side and sell-side agents negotiating under the Ad Context Protocol (AdCP) are peers rather than subagents, since each answers to a different company; a subagent answers to the agent that started it.

Origin and evolution

Delegation between software agents is old; network management used the word well before LLMs (see below). The current meaning took shape in 2023 and 2024 with open-source frameworks such as AutoGen and CrewAI, and OpenAI's experimental Swarm library in October 2024.

Three releases in 2025 fixed the vocabulary. OpenAI launched the Agents SDK, with handoffs as a core primitive, on March 11, 2025; the package first appeared on the Python Package Index (PyPI) on March 4. Google announced ADK at Cloud Next on April 9, 2025, building sub_agents into its base agent class. Anthropic published an engineering account of its Research feature on June 13, 2025, describing "an orchestrator-worker pattern, where a lead agent coordinates the process while delegating to specialized subagents that operate in parallel." The company reported that a system with Claude Opus 4 as lead and Claude Sonnet 4 subagents outperformed a single Claude Opus 4 agent by 90.2% on its internal research evaluation.

User-defined subagents reached Claude Code in version 1.0.60, released on July 24, 2025, with the changelog line "You can now create custom subagents for specialized tasks! Run /agents to get started." The Explore subagent, then powered by the smaller Haiku model, followed on October 15, 2025, and the Plan subagent on October 27, 2025. Worktree isolation arrived on February 19, 2026.

Nesting changed in 2026. Early implementations kept trees one level deep. Claude Code version 2.1.219, released on July 24, 2026, raised the default to three layers below the main conversation, with an environment variable, CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH, to lower it. Version 2.1.302, on October 16, 2026, made fork subagents the default across the command line, the Agent SDK, the desktop app and VS Code. A fork inherits the parent conversation instead of starting blank, trading isolation for continuity.

Why marketers encounter the term

Subagents sit underneath much of the agentic tooling reaching advertising operations. An assistant that pulls reports from several ad platforms and reconciles them is increasingly a lead agent dispatching workers. The design choice matters for cost, accuracy and control. Anthropic's own marketing operations team offers an example: its event workflow uses a dispatcher that hands each request to one of five specialist skills, then passes the finished build to a fresh Claude instance for audit, an instance that starts with no prior context.

Cost comes first. Anthropic stated in June 2025 that its agents "typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats." Broader usage data points the same way: OpenRouter figures published in August 2026 showed AI agents consuming about five times the tokens of human users. Agencies inherit that multiplier each time a task fans out. A KPMG survey found 49% of leaders had scaled back agent deployments when costs outran value.

Control is the second. Because each subagent carries its own tool list, a reporting worker can be read-only while changes to bids or budgets stay with the lead agent or a human.

Limitations and disputes

The sharpest criticism came from Cognition, the company behind the coding agent Devin. In a post titled "Don't Build Multi-Agents," published on June 12, 2025, Walden Yan argued that parallel subagents with partial context make conflicting assumptions, setting out two principles: "Share context, and share full agent traces, not just individual messages" and "Actions carry implicit decisions, and conflicting decisions carry bad results." Anthropic concedes part of the point: "most coding tasks involve fewer truly parallelizable tasks than research."

Information loss is structural: a summary is a lossy compression, and the parent cannot audit what was left out. Claude Code's documentation advises against subagents when "latency matters," since a non-fork subagent "starts fresh and may need time to gather context."

Accountability weakens as trees deepen. With three layers of nesting, one request can produce dozens of model calls, and tracing an error or a spend decision to a step requires logging many deployments lack. Anthropic's 90.2% figure is an internal benchmark, and the company found token usage alone explained 80% of performance variance on the BrowseComp evaluation, suggesting part of the gain is simply more computation.

  • Agent team. In Claude Code, an agent team is a set of separate sessions that message one another and are supervised by a lead, rather than workers that report only upward and then end. Subagents work "within a single session," according to the documentation.
  • Tool call. A tool call runs a fixed function and returns its output. A subagent runs its own reasoning loop, possibly with many tool calls, before returning anything.
  • Handoff. In the OpenAI Agents SDK, a handoff transfers the conversation to another agent, which then answers the user. A subagent in the strict sense returns control to its parent.
  • Older meanings. In network management, an SNMP subagent is a process that exposes part of a device's management data through a master agent, standardised in the AgentX protocol, RFC 2741, in January 2000. In US real estate and insurance, a subagent is a licensee acting for a principal through another agent, a usage unrelated to software.

Recent developments

The direction in late 2026 has been towards deeper trees: Claude Code's three-layer nesting and forks by default both widen what one request can set in motion. In advertising, coordination products such as Magnite Orchestration on June 11, 2026, place a layer above specialist agents, while cost pressure runs the other way: Draft Digital collapsed twelve MCP calls into a single buyer agent to contain token spend. No industry body has yet defined how a subagent should be identified or logged inside an advertising transaction.


Timeline

  • January 2000 - RFC 2741 publishes the AgentX protocol, defining master agents and subagents in SNMP network management.
  • October 2024 - OpenAI releases Swarm, an experimental library for agent handoffs.
  • March 11, 2025 - OpenAI launches the Agents SDK with handoffs as a core primitive.
  • April 9, 2025 - Google announces the Agent Development Kit, with sub_agents in its base agent class.
  • June 12, 2025 - Cognition's Walden Yan publishes "Don't Build Multi-Agents."
  • June 13, 2025 - Anthropic describes its orchestrator-worker Research system and reports a 90.2% gain over a single agent on an internal evaluation.
  • July 24, 2025 - Claude Code 1.0.60 introduces custom subagents and the /agents command.
  • October 15, 2025 - Claude Code 2.0.17 adds the built-in Explore subagent.
  • October 27, 2025 - Claude Code 2.0.28 adds the Plan subagent, subagent resumption and per-subagent model choice.
  • February 19, 2026 - Claude Code 2.1.49 adds worktree isolation for subagents.
  • July 24, 2026 - Claude Code 2.1.219 allows subagents to spawn subagents up to three layers deep by default.
  • October 16, 2026 - Claude Code 2.1.302 turns fork subagents on by default across its surfaces.

Summary

  • Who: Lead agents built on LLMs, and the developers who configure them in tools such as Claude Code, Google's Agent Development Kit and the OpenAI Agents SDK; in advertising, vendors building coordinated agent systems for media buying and operations.
  • What: An AI agent spawned by another agent to perform one delegated task in its own context window, with its own instructions and tools, returning only a summary.
  • When: The pattern spread through agent frameworks in 2023 and 2024, was formalised in SDKs in March and April 2025, reached Claude Code as a configurable feature on July 24, 2025, and gained default three-layer nesting in July 2026.
  • Where: Inside coding agents, research assistants and agent frameworks, and increasingly behind marketing tools that pull, reconcile and act on advertising data.
  • Why: To keep a lead agent's context free of raw material, to run independent subtasks in parallel and to restrict permissions per task, at the price of higher token consumption and lost context between agents.