Knowledge tree
On this page

Subagents

How an agent delegates a bounded task to another agent, and when parallel work repays its coordination cost.
Updated 28 Aug 2026

A subagent is another agent given part of the main agent’s work. It receives its own goal and context, runs its own loop, and returns a result to the parent.

Unlike one tool call, a subagent can make several decisions and use tools of its own. A read_file call performs one operation. A subagent reviewing a module may inspect several files, run tests, and prepare a conclusion.

Delegation example

During a repository review, the parent agent can ask one subagent to inspect the authentication module and another to review the configuration parser.

Parallel delegation and return The main agent delegates two independent repository reviews. Subagent A reviews the authentication module and Subagent B reviews the configuration parser in separate contexts, then both return findings to the main agent. Main agent Delegate and combine results Subagent A Review authentication moduleSeparate context Subagent B Review configuration parserSeparate context Main agent Delegate and combine results Independent tasksFindings return Parallel delegation and return The main agent delegates two independent repository reviews. Subagent A reviews the authentication module and Subagent B reviews the configuration parser in separate contexts, then both return findings to the main agent. Main agent Delegate and combine results Subagent A Review authentication moduleSeparate context Subagent B Review configuration parserSeparate context Main agent Delegate and combine results
Figure 1. The parent delegates two independent reviews with separate context, then brings both results back together.

Each worker receives:

  • The specific review objective.
  • The relevant files or instructions.
  • The expected result.

If the reviews are independent, they can run in parallel. The parent then integrates the findings, removes duplicates, and decides which issues need action.

The useful return is not each worker’s complete transcript. Conclusions, necessary evidence, affected files, and open questions are usually enough.

Separate context

The subagent does not need the parent’s full conversation. A bounded context avoids copying irrelevant information and keeps intermediate searches or output out of the parent’s context.

Isolation can also hide an important constraint. If the review must not modify files, that rule needs to be in the delegation. It is not enough for it to exist only in a parent turn the subagent never received.

When parallel work hurts

If two subagents edit the same file, parallel execution can create conflicts and take more time than it saves. The same is true when the second task continually depends on discoveries from the first.

In those cases, one agent or sequential delegation is simpler. Read-only work and clearly separated modules are better candidates for parallel execution.

More agents also mean more model calls and processed context. They may reduce elapsed time when they run concurrently, but the extra work is not free. API Pricing covers how that usage accumulates.

References