Page languageFrançaisEnglish
Teacher area
Laurent PoupetClaude trainer and artificial intelligence architectStudent area

Category · Agents and orchestration

What is a subagent?

A subagent is an agent with a narrow mission that a main agent calls like a tool. It works in its own context and returns only its conclusion. For example, it reads long documentation while the main agent keeps a clean context.

By , Claude trainer and artificial intelligence architect · Updated

How it works

  • The subagent receives a precise instruction and its own tools, works alone, then returns a short result, which keeps the main agent’s context clean.
  • It is used to isolate a hungry task, such as reading long documentation, or to give narrower permissions to part of the work.
  • Several subagents can work in parallel on independent parts, which cuts the total time, at the price of higher token consumption.

The trap to avoid

The trap is a vague mission; a subagent that does not know exactly what to return explores too much, burns many tokens and sends back an unusable result.

A concrete example

Before changing a large project, the main agent asks a subagent to “read the 40 files of the billing folder and tell me where the discount is computed”. The subagent reads everything in its own context and sends back three lines only: the file, the function, the rule. The main agent keeps a clean context to make the change.

What is the difference with a multi-agent system?

CriterionSubagenta multi-agent system
OrganisationOne main agent that delegatesSeveral agents that cooperate
What comes backA short conclusionExchanges between agents
Main goalKeep the main context cleanSplit a large piece of work

Related terms

Where this is taught

Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.

See the full program

Sources

All glossary terms

Trial lesson · 30 min · $20

Book (new tab)