# Subagent

Concept · [Building with AI](https://ecosystem.samcarlton.com/ai)

Also called: subagents, child agent, helper agent

A second [agent](https://ecosystem.samcarlton.com/ai-agent) that the main agent starts to handle one piece of a job in its own separate [session](https://ecosystem.samcarlton.com/session). The helper does the reading and searching and sends back a short report, so the main agent's context stays uncluttered.

**For example:** The main [agent](https://ecosystem.samcarlton.com/ai-agent) sends a subagent to search 200 files for every place prices are calculated and gets back a list of five files.

## Connects to (10)

- [AI agent](https://ecosystem.samcarlton.com/ai-agent): An AI tool that does more than answer a question.
- [Session](https://ecosystem.samcarlton.com/session): One stretch of work with an AI agent, from a blank start until it is cleared, closed or compacted.
- [Context window](https://ecosystem.samcarlton.com/context-window): How much text an LLM can take into account at one time.
- [Handoff](https://ecosystem.samcarlton.com/handoff): Passing work from one session to the next, or from one agent to another, so the new one can continue without the full history.
- [Secondary source](https://ecosystem.samcarlton.com/secondary-source): A description of the original material rather than the material itself, such as a summary, a README or a compaction note.
- [Tool use](https://ecosystem.samcarlton.com/tool-use): A way for a model to ask the software around it to run a defined action, such as a search or a database lookup, and send back the result.
- [Agent swarm](https://ecosystem.samcarlton.com/agent-swarm): Many AI agents working on parts of a larger task at the same time, coordinated by software or by a lead agent.
- [Agent loop](https://ecosystem.samcarlton.com/agent-loop): The repeating cycle that makes an AI agent work: the model decides on a step, calls a tool, reads the result and decides the next step…
- [Startup ecosystem](https://ecosystem.samcarlton.com/startup-ecosystem): The people, money and organizations in one place that help new companies start and grow.
- [Automated review](https://ecosystem.samcarlton.com/automated-review): Having an AI model read and critique work, usually code, before a person does.

## Sources

- <https://code.claude.com/docs/en/sub-agents>


Map view: https://ecosystem.samcarlton.com/subagent
