Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

Claude Code Subagents: When to Use Them and Which File Wins

Claude Code subagents are specialized assistants that take a side task off the main conversation, work in their own context window and hand back only a summary. As of October 2026 each one has its own system prompt, tool access and permissions, and you create them as Markdown files in .claude/agents/ for a project or ~/.claude/agents/ for all your projects.

The catch: subagents save context, not usage

People reach for subagents thinking they'll stretch their plan further. They won't. A subagent sends its own requests, and those requests count toward the same usage limits as your main conversation. Hand three subagents a job each and you've spent three jobs' worth of usage.

What you do save is room in your main conversation. Searching a codebase, reading logs or opening dozens of files fills the context with material you'll never look at again. A subagent does that work in its own context window and returns a short summary, so your main session stays focused.

There's a smaller cost too. Claude decides when to delegate by reading each subagent's description, and those descriptions take up context. When the combined descriptions of your non-built-in subagents go past 15,000 tokens, Claude Code shows a warning at startup with the total. Keep descriptions short and clear.

When a subagent is the right call

The docs give a simple test. Use one when a side task would flood the main conversation with search results, logs or file contents you won't reference again. Good examples:

  • Searching a large codebase to find where something is defined.
  • Reading long build or test logs to find the one error that matters.
  • Working through many files to answer a single question about them.
  • Running a routine job on a faster, lower-cost model such as Haiku, by setting the model field.

Subagents work within a single session. If you need several sessions running side by side, the docs point you to background agents. For sessions that message each other there's cross-session messaging, and for a supervised group there are agent teams.

The built-in subagents you already have

Claude Code ships with three you can use straight away.

  • Explore: fast and read-only, for finding files and searching code. It has three thoroughness levels: quick, medium and very thorough.
  • Plan: read-only research while you're in plan mode.
  • General-purpose: complex, multi-step work that mixes exploring with taking action.

Explore and Plan start without your CLAUDE.md files and the git status snapshot. That keeps them lean, but it means any house rules you've written in CLAUDE.md won't reach them. If you'd like your own version, a user-defined subagent named Explore overrides the built-in one and keeps its own model.

Where subagent files live and which one wins

The same subagent name can exist in more than one place. When that happens, the higher-priority location wins. Here's the order, highest first, as of October 2026.

LocationScopePriorityHow you create it
Managed settingsOrganization-wide1 (highest)Deployed via managed settings
--agents CLI flagCurrent session2Pass JSON when launching; not saved
.claude/agents/Current project3Ask Claude or create the file, then commit it
~/.claude/agents/All your projects4Ask Claude or create the file
Plugin agents/ folderWhere the plugin is enabled5 (lowest)Installed with plugins

Project subagents have one more rule. Claude Code walks up from your working directory, scanning every .claude/agents/ folder up to the repository root, and the definition closest to where you're working wins. Folders are scanned recursively too.

A subagent's identity comes only from its name field, not the file name. Two files with the same name inside them load only one, which is a quiet way to lose a subagent you thought you'd added. If you install subagents through plugins, my guide to Claude plugins covers how those get added.

What to put in a subagent file

Each subagent carries four things of its own: a context window, a custom system prompt, specific tool access and independent permissions. That's what makes them useful beyond saving context. You can give a reviewer read-only tools so it can look but never change a file, and give a different subagent the permissions it needs to act.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

The description does the most work. Claude reads it to decide when to hand a task over, so say plainly what the subagent is for and when to use it. A vague description means Claude either ignores the subagent or calls it for jobs it wasn't built for, and a long one eats into the 15,000-token startup budget for no gain.

There's a separate write-up on this in the Claude Mobile App guide.

How to set one up and call it

  1. Ask Claude to create a subagent, or write a Markdown file in .claude/agents/ for the project or ~/.claude/agents/ for your own use.
  2. Write a short, clear description so Claude knows when to delegate to it.
  3. Ask Claude to use it by name, for example: use the code-improver agent to suggest improvements in this project.
  4. If Claude can't find a new subagent and the folder is new, restart Claude Code.

That last step catches lots of people. If ~/.claude/agents/ didn't exist before your session started, the running session won't detect it. Restart and it'll appear. Running /agents now prints a reminder to ask Claude or edit the folders directly; on version 2.1.197 and earlier it opens an interactive wizard instead.

If you're comparing options, Claude Code Review fills in the rest.

My verdict on Claude Code subagents

I'd use subagents for any noisy side job, codebase searches and log reading above all, because keeping that out of your main conversation makes the rest of the session sharper. I'd point routine ones at Haiku with the model field. I'd skip them if you're hoping to save usage, because every subagent request counts against the same limits. If you're watching how far your plan stretches, this guide to Claude Code plans and limits is the place to check.

Frequently asked questions

Do Claude Code subagents use my usage limits?

Yes. Each subagent sends its own requests, and they count toward the same usage limits as your main conversation.

Where do I put a Claude Code subagent file?

In .claude/agents/ for the current project, or ~/.claude/agents/ for all your projects.

Why can't Claude find my new subagent?

If ~/.claude/agents/ didn't exist before the session started, the running session won't detect it. Restart Claude Code.

Which subagent wins if two have the same name?

The higher-priority location wins: managed settings first, then the --agents flag, then the project, then your personal folder, then plugins.

Can a subagent use a cheaper model?

Yes. Set the model field to route a task to a faster, lower-cost model such as Haiku.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.