⌨️Claude Code Subagent
Also known as Custom subagent, .claude/agents, /agents
A helper agent you define in a Markdown file. Claude hands it tasks to do.
Think of it like
It is like a helper with one job card. You call them in, they do that job, and they report back.
Example
Emma makes a code-improver subagent. She gives it only Read, Grep and Glob. Claude now sends it code to review, and it can look but never edit.
Why it matters
Each subagent works in its own clean context. Big searches stay out of your main chat, and each helper gets only the tools it needs.
Definition
Example code
markdown
---
name: code-improver
description: Suggests code fixes. Use after writing code.
tools: Read, Grep, Glob
model: sonnet
---
You review code and suggest clear fixes.Common mistake
Key takeaways
- 1One file each. Markdown with a header on top.
- 2Fresh context. It works apart and reports back.
- 3Only its tools. List just what the job needs.