Course/Skills, Subagents, Hooks, Plugins

8 min · +130 XP

Subagents: helpers for side work

A subagent does a side task in its own context and brings back only the result.

By the end of this lesson

You will be able to hand a side task to a subagent, run several in parallel and create your own helper file.

Some tasks involve a lot of reading you will not need again: searching a whole project, going through logs, comparing documents. A subagent is a helper Claude starts for such a task. It works in its own context window and brings back a short report, so your main conversation stays clear.

✕"An agent does whatever it wants"

A subagent works under the same rules as the main session. It inherits your permission rules, and when you work in auto, acceptEdits or bypass mode, it runs in that same mode. When a helper running in the background needs permission, the question appears in your main session with the helper's name on it.

When a subagent helps

Good jobs for a subagent

  1. 1Research that reads many files: "find every place where the app sends email".
  2. 2Long output you only need summarised: test logs, a large data file.
  3. 3Several independent questions at once: each helper takes one, and they run in parallel.
  4. 4A second opinion: a reviewer that did not write the code.

Keep the work in the main conversation when you go back and forth a lot, when the steps depend on each other, or for a quick small change. A subagent starts fresh and may need time to gather context.

💬 Ask for one in plain words

“Use a subagent to find every place in this project where we send email. Report only the file names, line numbers and one sentence for each.”

Claude starts the helper and shows a line with its name and task while it works. Your conversation receives the summary, not every file the helper read.

💬 Or several at once

“Use three subagents in parallel: one checks the sign-up page, one the payment page, one the settings page. Each lists only bugs it can reproduce. Then combine the results.”

Each subagent counts toward the same usage limits as your main conversation, so three helpers spend your plan's allowance faster than one.

Make your own helper

A custom subagent is a Markdown file in .claude/agents/ inside the project, or in ~/.claude/agents/ for all your projects. The simplest way to make one is to ask Claude, for example "create a read-only code-reviewer subagent in .claude/agents/". In recent versions the /agents command only reminds you to do exactly that, or to edit those folders yourself.

💬 Create a helper

“Create a read-only code-reviewer subagent in .claude/agents/. It should check my changes for bugs and unclear code and give specific advice, without editing anything. Show me the file.”

Claude writes a file like the one below. Read it, and ask for changes in plain words if something is not how you want it.

.claude/agents/code-reviewer.md
---
name: code-reviewer
description: Reviews code for quality and best practices. Use after writing or changing code.
tools: Read, Glob, Grep
model: inherit
---

You are a code reviewer. When invoked, analyze the code and give
specific, actionable feedback on quality, security and best practices.

What the fields mean

  1. 1name: the helper's name. Required.
  2. 2description: when Claude should hand work to it. Required; keep it short.
  3. 3tools: what it may use. Read, Glob and Grep make it read-only. Leave the field out and it gets every tool available to subagents.
  4. 4model: which model it runs on; inherit keeps the model of the main conversation.
  5. 5Below the dashes: the helper's instructions.
For beginners
›If Claude does not find the new helper

If the agents folder did not exist when the session started, Claude Code does not notice it. Type /exit, start claude again, and repeat the request. Edits to an existing helper file are picked up within a few seconds without a restart.

For experienced users
✦If you are experienced

Subagents that Claude spawns start in the background by default; /tasks lists them, and Ctrl+B in the terminal moves one Claude is waiting for to the background. isolation: worktree gives a subagent its own temporary git worktree. Other fields: permissionMode, maxTurns, skills (preloaded in full), mcpServers, memory, effort, color, background. Explore and Plan start without CLAUDE.md to stay fast and cheap. Combined custom descriptions above 15,000 tokens trigger a startup warning. Agent teams, where separate sessions coordinate, are experimental and off by default. For a question about something already in the conversation, /btw is lighter than a subagent.

Quick check

Claude has to read 200 log files to find one error. Why ask for a subagent?

Quick check

You create a reviewer subagent with tools: Read, Glob, Grep. What can it do?

Facts checked against the official Claude Code docs October 24, 2026 · source

EAEvgenii Arsentev

Author

Evgenii Arsentev

PhD · Founder & CEO, Dad4Kids