Subagent
A specialized AI agent invoked by a main agent to handle a bounded task, with its own context window, system prompt, and tool permissions, but no autonomous existence outside its parent.
Also known as: sub-agent · specialist agent · child agent · delegated agent
What is Subagent?
A subagent is a specialized AI agent invoked by a main agent to handle a bounded task. Each subagent has its own context window, its own system prompt, and its own tool permissions, but it does not exist autonomously: it runs only when the main agent calls it, returns a result, and shuts down. Subagents let you decompose a large workflow into focused units, each operating in a clean context without polluting the main agent's history. Common uses include code review, security scanning, document QA, and parallel research where four subagents read four documents simultaneously and return summaries. The pattern is first-class in Claude Code and most modern agent harnesses; it is how a single conversation can effectively become a small fleet without becoming chaotic.
Christos Papadimitriou, theagency47 · Updated May 18, 2026Why subagents matter
A monolithic agent trying to do everything in one conversation hits two ceilings fast: its context window fills up with intermediate work, and its system prompt has to anticipate too many task shapes to stay sharp on any of them. Subagents solve both by letting the main agent delegate.
A practical example: a sales-research agent needs to enrich 50 prospects. Instead of running 50 sequential lookups in its own context, it spawns 50 subagent invocations in parallel, each with a clean window and a tight “enrich one prospect” prompt. Total time drops from minutes to seconds; the main agent’s context stays uncluttered for the next phase.
How theagency47 uses subagents in agent builds
Most of our Workforce Pro builds use a main-agent / subagent topology. The main agent owns planning and integration; subagents handle specialized work like:
- Eval subagent, runs the test suite against the main agent’s draft output before delivery.
- Compliance subagent, checks responses against client-specific policy (no investment advice, no medical diagnosis, etc.).
- Lookup subagent, handles a single API call and returns clean structured data, isolating any errors.
- Summary subagent, compresses long retrieved documents into the main agent’s working context.
Our showcase agents Sofia, Yiannis, and Maria all delegate to specialist subagents when the workflow shape calls for it.
FAQ
What is the difference between a subagent and a tool?
A tool is a single function call, deterministic, fast, no reasoning. A subagent is itself an LLM-powered agent with its own reasoning capacity. Use a tool when the action is mechanical (read a database row, send an email). Use a subagent when the action requires judgment (summarize, classify, decide).
How is this different from a multi-agent system?
A multi-agent system is a team of peer agents collaborating on a goal, often with persistent identities. A subagent is invoked, runs, returns, and dies. Subagents are a building block; a multi-agent system is an architecture.
Can subagents call other subagents?
Yes, and they often do. A research subagent might invoke a sub-subagent to handle one specialized lookup. We typically cap nesting at three levels, beyond that, the workflow shape is usually wrong and a flatter design is cheaper to maintain.
Related terms
AI Agent
A software system that takes a goal, plans steps, calls tools, and acts autonomously to produce an output, without step-by-step human prompting.
Tool Use
An LLM's ability to call external functions or APIs as part of its response, enabling actions beyond text generation. Also called function calling.
System Prompt
The instructional text that defines an AI agent's role, voice, boundaries, and decision rules. The single most important customization layer of an agent.