Subagent
A subagent is a specialised AI assistant that Claude Code launches for a specific task. It runs in its own context window, with its own instructions, tools and permissions, does the work separately and returns only a summary to the main conversation. Claude Code ships with built-in subagents such as Explore, Plan and general-purpose, and you can define your own as Markdown files.
A separate helper that works for Claude, with its own working memory. It gets a task, does it off to the side and returns only the conclusion, like a colleague sent to the archive.
How it shows up in Claude Code
When a task would flood the conversation with text you won't need again (say, searching through hundreds of files), Claude hands it to a subagent. The subagent reads and searches in its own context, and you get only the conclusion. Claude uses the built-in ones on its own, for example Explore, which only reads and searches the code.
A custom subagent is a Markdown file in .claude/agents/ (for the project) or ~/.claude/agents/ (for all your projects). At the top it has a frontmatter block with name and description, and the rest of the text becomes its instructions.
Example
The file .claude/agents/reviewer.md:
---
name: reviewer
description: Reviews changed code and flags mistakes
tools: Read, Glob, Grep
---
You are a careful reviewer. Read the changes and point out what could break.
Then you tell Claude: “Use the reviewer subagent on what I changed today.” Because it only has reading tools, it can't modify anything.
Common mistakes
- A vague description. Claude picks subagents by their
description, so say clearly when to use it. - Giving it every tool. A reviewer has no need to write files.
- Assuming it's free. Subagents send their own requests, which count toward the same usage limits as your conversation.
Related terms and where you learn it
A subagent is still an agent, with its own system prompt. The difference from a skill: a skill is a recipe followed inside your conversation, while a subagent works on the side. You can get ready-made ones in a plugin. It's all covered in the lesson “What is a subagent?” in module 06 · Subagents: separate helpers.
How it appears in the course
A subagent is a “helper Claude”, which the main Claude sends off to do a particular job.
Introduction · Module 06, Subagents: separate helpers
A subagent is a separate copy of Claude.
What is a subagent? · Module 06, Subagents: separate helpers
You know what a subagent is. Now let’s see what it’s good for: there are four reasons.
Why do you need subagents? · Module 06, Subagents: separate helpers
Learn Claude Code from zero, in plain English
12 modules with 1–2 minute lessons, which you can also do on your phone. The first two modules are free.