Skip to content
Free and open to everyone. The lessons keep improving thanks to your feedback.
Language : EN

Subagents: delegating a search

In testingChecked on 24/10/2026 (French version)Translated on 27/10/2026

This lesson is still being tested: it improves with learners' feedback. If something is unclear, it is the lesson that needs fixing, not you.

Follow this lesson with Claude Code

With the course companion installed, open Claude Code in your working folder and type:

/formation-ia:suivre m07-l05 en

It reads the up-to-date lesson on this site and guides you step by step, without changing anything without your consent. Install the companion. Claude Code is not included in the free plan: an eligible Claude subscription, or a Console account billed by usage for the terminal.

By the end of this lesson, you will be able to

  • say what a subagent is, and when it is useful;
  • delegate a search to a subagent, and check its summary;
  • create your own subagent, read-only;
  • choose between a subagent, a skill and the main conversation.

Why it matters to you

When Claude searches through many files, your conversation fills up with results that you will never read again. It gets long, slow, and Claude follows what matters less well. A subagent does the search separately, then gives you back only the essentials. It is a delegation: useful, as long as you check the result.

Before you start

You needClaude Code (app or terminal), in Manual mode, and your mon-espace-ia folder with a few notes or documents
CostThe agent subscription: Claude Pro at minimum, €18 per month excl. VAT, price shown in France on 24/10/2026. A subagent uses your usage limit just like your conversation
Duration35 minutes
ReminderThe subagent reads your files like Claude does: nothing from the “never” list in your folder

Understand it in 3 minutes

A subagent is a specialized assistant that Claude launches for a task, according to the documentation (24/10/2026):

  • it works in its own context and only returns the summary;
  • its requests count toward the same usage limits as your conversation;
  • Claude Code already has some, for example Explore, which searches and reads, without being able to write or edit;
  • you can create your own: a text file, with a name, a description and the tools it is allowed to use.

Subagent, skill or conversation?

ChooseWhen
The main conversationAn ongoing exchange, a small fix, a task where each step depends on the previous one
A skill (lesson 2)A way of doing things that you repeat, applied in your conversation
A subagentA separate task, which would produce a lot of useless output, and which can be summarized

Delegating does not excuse you from checking. A summary cites files or passages: open at least one.

Do it together

In mon-espace-ia, in Manual mode, write:

Use a subagent to search my folder for notes and documents that talk about budget. Give me only a summary of 5 lines at most, with the file names.

In our test, Claude launched the Explore subagent, which searched read-only, then returned a summary of three files, specifying which ones did not mention it.

2Step 2: Check the summary

Open one of the cited files: does it really talk about budget, as the summary says? If a file is missing, ask: “Why is [file] not in your list?”

3Step 3: Create your subagent, read-only

Create a project subagent named chercheur-de-notes, in .claude/agents/chercheur-de-notes.md. Description: "Searches the notes and documents of this folder, and returns a short summary with the file names. To be used to find information in my notes." Tools: only reading and file search (Read, Grep, Glob). It does not edit anything. Show me the file before creating it.

Read the header: the name, the description, the list of tools. The .claude folder is protected: Claude Code asks for your permission, in the app and in the terminal alike. Allow it if it looks right.

4Step 4: Use it

Open a new session (a subagent created during a session may only be seen at the next session), then:

Use the chercheur-de-notes subagent to find what I decided about [a topic from your journal].

Check the summary against your journal.

Your turn

  1. Delegate a real search in your folder, and check at least one cited file.
  2. If you often do this kind of search, keep your chercheur-de-notes subagent; otherwise, delete it (lesson 7).
  3. Write in your journal what you delegated, and what the check showed.

Check your work

It worked if:

  • you got a summary from a subagent, and checked at least one file it cites;
  • your chercheur-de-notes subagent exists, with only read tools, or you decided not to keep it;
  • you can say, for a given task, whether the conversation, a skill or a subagent is better.

Common mistakes:

  • delegating a small task: it takes longer, and it uses up your usage limit;
  • giving a subagent write rights “just in case”;
  • taking its summary for proof;
  • multiplying subagents: each description weighs on the context of every session.

Keep it and pick it up later

  • Your project subagents are files in .claude/agents/: they are part of your folder, and so of your copies.
  • At the monthly upkeep, remove the ones you no longer use.

Going further

optional
  • You can also call a subagent with @ followed by its name, to be sure it is the one working.
  • The official documentation, in English: code.claude.com/docs/en/sub-agents (creation, personal or project scope, choice of tools and model).

New words

4 words explained
WordWhat it means
SubagentA specialized assistant that Claude launches for a separate task, and that returns a summary
ContextWhat Claude has in front of it during the session; a subagent has its own
ExploreThe subagent provided with Claude Code to search and read, without writing
DelegateHand over a task, then check what comes back

Check your understanding

3 questions, no grade. An explanation appears after each answer.

1When is a subagent useful?
2Does a subagent use your usage limit?
3The subagent returns a summary that cites three files. What do you do?

What's next?

Lesson 6 · Plugins and provenance: checking before installing: looking at what a package of extensions can do, before adding it.

Module 7:

✏️ Do the exercises

My space: your progress, your exercises and your last lesson.

The delegation in step 1 was actually run with Claude Code 2.1.310 in a test folder (test report, T40). The creation of the subagent in step 3 was not run.

Sources and checks

2 sources

Date, version, sources Written on 24/10/2026. Checks on 24/10/2026 on code.claude.com/docs/en/sub-agents: own context and summary, same usage limits, Explore subagent read-only, subagent file (name, description, tools), .claude/agents/ folder, call by name or with @, choice between conversation, skill and subagent, new agents folder not seen by an already open session. Claude Pro price: claude.com/pricing.

Sources checked: