Aiodic

Back to the table

105 Advanced Sa Subagents Agents & Automation

Subagents

Helper agents launched for a focused job.

What it is

A subagent is a helper AI that a main AI agent launches to do one focused job, and then reports back. The main agent, often called the lead agent or orchestrator, writes a short brief, hands it to the helper, waits for the answer, and carries on with its own work using whatever came back.

The key detail is that the helper starts fresh. It doesn't see the long conversation, the dozens of files, or the pile of search results the main agent has been working through. It sees only its brief. It does its job in its own working space, and when it finishes, only its answer travels back to the main agent. All the reading, searching and false starts it went through along the way stay behind and are thrown away.

Picture a manager with a desk covered in papers for a big project. She needs to know one thing: what the supplier's contract says about late delivery. She could clear space, pull out the forty-page contract, and read it herself, adding it to the pile. Or she can ask an assistant: "Please read the Harlow contract and tell me, in two or three sentences, what happens if they deliver late. Quote the clause number." The assistant goes off, reads the whole thing at another desk, and comes back with three sentences. The manager's desk stays clear, and she has exactly the answer she needed.

That is the whole idea. The manager is the main agent. The assistant is the subagent. The desk is the context window: the limited working space where an AI holds everything it's currently looking at. Every page on the desk takes up room, costs money to process, and competes for attention. A subagent lets the main agent get an answer without having to put all the raw material on its own desk.

Subagents are one of the tools of context engineering, the craft of choosing what information an AI sees. They're also a form of delegation, and they bring the same questions any human delegation does: how clear was the brief, did the helper understand what was really wanted, and can the answer be trusted?

This article is about one specific shape: a lead agent that stays in charge and sends helpers off for narrow jobs. That's related to, but not the same as, multi-agent systems in which several agents with different roles work together as a team of peers, and to handoffs, in which one agent passes the whole conversation over to another and steps back. With a subagent, the lead never lets go. It asks, receives, and decides.

A subagent usually has three things set for it:

Why it matters

It keeps the main agent's head clear. Long jobs fill up an agent's working space quickly. A coding agent that searches a large project for every place a function is used might read hundreds of lines it will never need again. A research agent might pull in twenty web pages to extract two facts. If all of that lands in the main context, the agent slows down, costs more, and becomes more likely to lose track of what it was doing. Researchers have shown that models read long, cluttered contexts less reliably than short, focused ones. Sending that work to a helper and keeping only the result is one of the most practical fixes.

It lets work happen in parallel. One agent working alone does things one after another. A lead agent can send three or five helpers off at once to look at different parts of a question, and wait for all of them. For a job that splits cleanly, such as "check what each of these five competitors charges", that can turn an hour into minutes.

It allows specialisation. Each helper can be given its own instructions, its own tools and its own limits. One reads and never writes. One reviews work against a checklist. One is only allowed to search the web. Narrow roles are easier to get right and easier to keep safe.

It costs more, and that matters too. Every helper reads its own material and writes its own answer, and all of that is paid for. Anthropic reported in June 2025 that its multi-agent research system used about 15 times as many tokens, the small chunks of text that AI usage is measured and billed in, as an ordinary chat. Subagents are worth it when the task is valuable and splits well. They are wasteful when a single agent could simply have answered.

It introduces the oldest problem in management. Anything lost between the manager's head and the assistant's brief is lost for good. The helper can't see what the lead knows, so it fills gaps with its own guesses. Two helpers can guess differently. Understanding subagents is largely about understanding that trade: a clean context in exchange for a narrower view.

Real-world examples

Anthropic's research system learns to write a brief (June 2025)

On 13 June 2025, Anthropic engineers published "How we built our multi-agent research system", an account of the setup behind Claude's Research feature. It uses what they called an orchestrator-worker pattern, a name Anthropic had already used in its December 2024 guide "Building effective agents" for a design in which a central model breaks a task down, hands the pieces to worker models, and combines their results. In the research system, a lead agent plans the investigation and launches subagents, each with its own context window, to search different parts of the question at the same time. They send back condensed findings, and the lead decides whether more research is needed. The headline performance numbers are covered in the Context Engineering article. The more useful part for anyone delegating to an AI is what went wrong on the way.

The engineers were candid about early failures. Their first versions made mistakes like spawning 50 subagents for simple queries, searching endlessly for sources that didn't exist, and distracting each other with too many updates. The lead agent had no sense of proportion, so the team wrote rules into its instructions: simple fact-finding needed just one agent making three to ten tool calls, direct comparisons might need two to four subagents, and only complex research used more than ten.

Vague briefs caused the other big problem. When the lead gave a short instruction such as "research the semiconductor shortage", subagents misread the task or repeated each other's work. In one case, a subagent looked into the 2021 car-industry chip crisis while two others duplicated each other investigating supply chains in 2025. The fix was a better brief. The post says each subagent needs an objective, an output format, guidance on which tools and sources to use, and clear task boundaries. That list is a good checklist for any delegation, human or AI.

The post was also honest about where the pattern fits. Tasks where every agent needs the same shared picture, or where the pieces depend heavily on each other, were not a good fit at the time, and the engineers noted that most coding tasks have fewer truly independent pieces than research does.

Cognition and the two Flappy Birds (June 2025)

A day earlier, on 12 June 2025, Walden Yan of Cognition, the company behind the coding agent Devin, published "Don't Build Multi-Agents". It is the clearest statement of the risk in delegation. His example: ask a system to build a Flappy Bird clone, and have a lead agent split the job into two pieces for two subagents, one to build the moving background with its green pipes and one to build the bird. The first helper misunderstands and builds a background that looks like Super Mario Bros. The second builds a bird that doesn't look like a game character or move like the one in Flappy Bird. Each did a reasonable job with the brief it was given. The lead agent is then stuck combining two parts that don't fit.

The point is not that the helpers were careless. Each piece of work carries small decisions the brief never mentioned, such as art style, scale, and how things move, and helpers that can't see each other make those decisions differently. Yan's two principles were to share full context, meaning the record of what every agent has done and not just individual messages, and that actions carry hidden decisions, and conflicting decisions produce bad results. He recommended a single agent working through the task in one continuous thread, using summaries to manage the length when needed.

Yan also described Claude Code's approach at that time as a cautious one: its helper never worked in parallel with the main agent and was usually asked to answer a question rather than write code. That is the fair middle ground many builders reached. Send helpers off to find things out, where a mismatch costs little, and keep the decisions that must fit together in one place. Read side by side, Anthropic's and Cognition's posts agree more than their titles suggest. Both are about who needs to see what.

Claude Code lets users define their own helpers (July 2025)

Claude Code, Anthropic's coding agent, already had a way to launch a helper: a built-in tool, originally called Task and later renamed Agent, which the main agent could use to send a search or investigation off into a fresh context. In late July 2025, version 1.0.60 added custom subagents, with a changelog entry inviting users to "create custom subagents for specialized tasks" by running an /agents command.

At the time of writing, Claude Code's documentation describes each subagent as running in its own context window with its own instructions, its own tool access and its own permissions. A custom subagent is written as a short text file: a name, a description of when to use it, the tools it may use, optionally which model it runs on, and then its instructions in plain language. The main agent reads the descriptions and decides when to delegate. The documentation lists the reasons to use one in terms that match this article: keeping exploration out of the main conversation, limiting which tools a helper can use, reusing the same helper across projects, focusing behaviour with specific instructions, and saving cost by sending some jobs to a faster, cheaper model. It also names the typical signal for delegating: a side task that would flood the main conversation with search results, logs or file contents that won't be needed again.

Features, names and limits in tools like this change often, so check the current documentation rather than relying on this summary.

OpenAI's "agents as tools" (March 2025 onwards)

On 11 March 2025, OpenAI released its Agents SDK, an open-source toolkit for developers building agents. At the time of writing, its documentation describes two ways for agents to work together. In a handoff, a triage agent passes the conversation to a specialist, and the specialist takes over and answers directly. In the other, called "agents as tools", a manager agent keeps control of the conversation and calls specialist agents the same way it would call any other tool, then combines what they return. The documentation's own example is a manager that calls a Spanish translation agent and a French translation agent when a user asks for both.

The distinction is worth knowing because it's the difference between a subagent and a handoff. Use a subagent when you want one agent to own the final answer. Use a handoff when the specialist should talk to the user directly. The SDK documentation also notes that independent tasks can be run in parallel to save time.

An everyday scenario: the launch-week helper

This is an illustration, not a documented case. A self-published author is using an AI agent to plan her book launch. The conversation is already long: her marketing plan, three rounds of edits to the blurb, and her email list notes. She needs to know what five comparable books in her genre charge for the ebook. Rather than letting the agent search the web in the middle of all that, she opens a fresh chat and writes a brief: the five titles, "report each ebook price on Amazon US today, with the date you checked, in a five-row table; if you can't find a price, say so; don't recommend a price". Ten minutes later she pastes the table back into her main conversation and asks the agent to suggest her price. The main conversation never saw the twenty pages the helper read, and she spot-checks two of the five prices herself before she decides.

Try it yourself

You don't need a special tool to learn this. Any chatbot will do, because you're going to play the lead agent yourself, with one chat as your "main desk" and a second, fresh chat as your subagent. Allow about half an hour.

  1. Pick a task with a clean side-question in it. Good candidates: planning a trip where you need opening hours for three places; writing a newsletter where you need a summary of one long article; preparing a proposal where you need what three competitors offer. The side-question should be answerable on its own, without the rest of your project.
  2. Start your main chat. Explain the overall task to the AI as you normally would and work on it for a few messages.
  3. Spot the moment to delegate. When a question comes up that would mean pasting in a long document or a lot of research, stop. That's the side task.
  4. Write the brief. Open a new chat and paste in a brief based on this template. Fill in every line. The discipline is in the filling.
You are helping with one narrow task. You won't see the rest of my project,
so everything you need is below.

Background (two or three sentences): [why I need this and what it's for]

Your task: [one specific question or job]

What to return: [exact format, e.g. "a table with columns X, Y, Z" or
"three bullet points, under 100 words in total"]

Limits:
- Only use [these sources / the text I paste below].
- Don't [the thing you don't want, e.g. "make recommendations" or "rewrite anything"].
- If you can't find something, say "not found". Don't guess.

At the end, list anything you were unsure about or any assumption you made.

[Paste any material here]
  1. Read the answer before you use it. Check the format is what you asked for. Read the list of assumptions carefully; that's where misunderstandings show up. Spot-check at least one fact against the original source.
  2. Integrate it. Go back to your main chat and paste in only the result, with one line of framing:
I've had a helper look into this. Here is the result, which I've checked.
Use it for the next step, and flag anything that doesn't fit what we've
already decided.
[paste the result]
  1. Try it in parallel. Next time, split a question into two or three independent parts and send each to its own fresh chat at the same time, with the same brief structure. Then compare: did any helper interpret its task differently from the others? That's the Flappy Bird problem, in miniature.
  2. Notice what didn't need delegating. If a side-question took you longer to brief than it would have taken to ask in the main chat, it wasn't worth a helper. That judgement is the skill.

If you use a coding agent or another tool with built-in subagents, you can apply the same brief template to the instructions you give a custom helper. At the time of writing, features, names and limits differ from product to product and change often, so check your tool's current documentation.

Common mistakes and misunderstandings

Writing a one-line brief. "Research the competitors" gives a helper nothing to work with. It doesn't know which competitors, what to compare, how much detail you want or when to stop. Anthropic's engineers found that vague briefs led directly to duplicated work and gaps. A good brief states the objective, the format of the answer, which sources or tools to use, and where the task ends.

Assuming the helper knows what you know. A subagent has a clean context. That's the point, and it's also the danger. Anything you didn't put in the brief doesn't exist for it: your audience, your earlier decisions, the thing you ruled out an hour ago. Include the background it needs, even if it feels obvious.

Splitting work whose parts must fit together. Research questions, fact look-ups and reviews split well, because a mismatch between two answers is easy to spot and cheap to fix. Building one coherent thing, such as a program, a book chapter or a brand's visual style, splits badly, because every piece carries decisions the others need to match. Keep those decisions in one place.

Using helpers for everything. Launching a subagent has overhead: writing the brief, the extra tokens, the time to check the result. For a simple question, the main agent asking it directly is faster and cheaper. Anthropic's early system spawning 50 helpers for a simple query is the cautionary tale.

Trusting the summary without checking. The helper's answer arrives looking tidy and confident, and the messy reading behind it is gone. If it misread a source or invented a detail, the main agent usually can't tell. Ask helpers to report their uncertainties and cite where each fact came from, and check a sample yourself. A tidy summary is still a claim, not a fact.

Confusing subagents with a team of equals. A subagent is a helper under a lead, not a colleague with its own agenda. Systems where several agents with different roles debate, negotiate or pass work around as peers are multi-agent systems, and they have their own strengths and problems. The design of who does what, in what order, is orchestration.

Forgetting the bill. Parallel helpers are fast, and every one of them is reading and writing on your account. Multiply the cost of one helper by the number you launch before deciding it's a good idea.

Giving helpers more power than the job needs. A helper that only needs to read shouldn't be able to delete, send or buy. Narrow tools and permissions are one of the main benefits of subagents. Use them.

Related elements