Skip to content

Sub-Agents and Delegation

When and how an agent should hand work to other agents with their own context, and the trade-offs involved.

Editorial team 1 min read

A sub-agent is a separate agent instance that a main agent starts to handle part of a task, with its own instructions and fresh context.

Why Delegate

  • Context isolation: a sub-agent can read many files or search results, and return only a short conclusion, keeping the main agent's context clean.
  • Parallelism: independent sub-tasks run at the same time.
  • Specialisation: sub-agents can have tailored instructions and tools — a researcher, a tester, a reviewer.

Good Candidates

  • Searching a large codebase for relevant files.
  • Researching several independent questions.
  • Reviewing work with a fresh perspective.

Costs

  • More total tokens and cost.
  • Coordination overhead and possible duplicated work.
  • Information lost when results are summarised.

Delegating Well

Give each sub-agent a clear, self-contained task: the goal, relevant context, constraints and the exact form of result wanted. Sub-agents don't see the main agent's history unless it's passed on.

Don't Overuse

For small or tightly coupled tasks, a single agent is simpler and often better. Use evaluation to decide whether delegation helps.

More in Agent harnesses

All Agent harnesses guides →
Agent harnesses Guide · 2 min

What Is an Agent Harness?

The software around a language model that turns it into an agent: the loop, tools, context, permissions and memory.

Agent harnesses 2 min read 27 Sep 2025

Agent harnesses Guide · 1 min

The Agent Loop Explained

The core cycle every agent runs: think, call a tool, observe the result, repeat — and how the loop knows when to stop.

Agent harnesses 1 min read 26 Sep 2025

Agent harnesses Guide · 1 min

Designing Tools for AI Agents

How to write tools agents use well: clear names, precise descriptions, sensible inputs and informative outputs.

Agent harnesses 1 min read 25 Sep 2025

Agent harnesses Guide · 1 min

Context Management in Agent Harnesses

How agents stay effective over long tasks: what to keep in context, what to summarise, and what to store outside.

Agent harnesses 1 min read 24 Sep 2025