
If your Claude Code subagent is not used, there are two likely reasons. Either the file never loaded, or it loaded and Claude decided to do the task itself. Type @ in the prompt to see which subagents loaded, then ask for yours by name: “Use the bug-reviewer subagent to check this file”, or @agent-bug-reviewer when it must run.
We tested this in a small project with five subagent files. Only one of the five loaded. And the one that loaded was still skipped when we asked a plain question, even after we rewrote its description.
This guide covers every cause we found, with the real terminal output for each, and the fix. The short version: the description is only a hint, and naming the subagent is what made Claude delegate in our tests.
Browse all our Claude Code tutorials for more fixes and how-tos.
Tested with Claude Code v2.1.332 on macOS on December 2, 2026. We used a throwaway demo project called shop-api, started with project and local settings only. The main session ran on Sonnet, and each delegation test was run once, so treat the results as one demo and not a benchmark.
Quick Summary: Why a Claude Code Subagent Is Not Used
| Cause | What you see | Fix | How we checked it |
|---|---|---|---|
File is outside .claude/agents/ | Subagent missing from the @ list | Move it to .claude/agents/name.md | Tested in the terminal |
Blank line above the opening --- | Missing from the @ list, no error | Make --- the first line | Tested in the terminal |
No description field | Missing from the list, error in the debug log | Add a description | Tested in the terminal |
| YAML that does not parse | Missing from the list, error in the debug log | Fix the frontmatter | Tested in the terminal |
| Small task, description only | Claude reads the file and answers itself | Name the subagent or @-mention it | Tested in the terminal |
Agent(name) in permissions.deny | Claude says a permission rule blocks it | Remove the deny rule | Tested in the terminal |
Misspelled tools list | “would be spawned with zero tools” | Use real tool names such as Read | Tested in the terminal |
File is in an --add-dir folder | Edits are not picked up | Restart Claude Code | From the official docs |
How Claude Code Decides to Delegate to a Subagent
A subagent is a Markdown file with a name, a description and a system prompt. Claude runs it in its own context window and gets back only a summary. If you are new to the idea, start with our guide to Claude Code subagents.
The official subagents documentation says Claude delegates based on three things: the task in your request, the description field of each subagent, and the current context. That means delegation is a judgment call. Nothing forces Claude to pick your subagent just because the description matches.
The same page lists when the main conversation is the better place for a task: quick, targeted changes, work that needs back-and-forth, and cases where speed matters. A subagent starts fresh and needs time to gather context. So for a small job, skipping the subagent is often the expected behavior, not a bug.
A description tells Claude when a subagent could help. Only your prompt tells Claude that you want it used.
So there are two separate questions to answer. Did the subagent load? And if it did, how strongly did you ask for it?
Step 1: Check That the Subagent Actually Loaded
Our demo project started with five subagent files. One was correct and four had a common mistake each.
.claude/agents/helper.md (correct)
.claude/agents/doc-writer.md (blank line above the first ---)
.claude/agents/test-planner.md (name, but no description)
.claude/agents/sql-helper.md (broken YAML: unclosed quote)
agents/changelog-writer.md (not inside .claude)To see what loaded, type @ in the prompt and look at the entries marked (agent). Ours showed the built-in agents plus one of our own. The other four files were silently ignored, with no notice at startup.

Why /agents no longer helps
Many older guides tell you to run /agents to check. In the current version that command only prints a reminder. The docs say the interactive wizard, with its list of subagents, exists only in v2.1.197 and earlier.

Find the broken file with the validator
For frontmatter problems, run the validator from your shell. It checks every file in the folder you name.
claude plugin validate .claude/agents
It found two of our four broken files. It did not flag the file with the blank first line, and it cannot know about a file sitting in the wrong folder. The docs also note that it does not flag a file whose frontmatter parses but has no name.
Read the debug log
The second check is the debug log. Start Claude Code with a log file, exit, and search the log for your agents folder.
claude --debug-file debug.log
grep -i "agents/" debug.log
Again, two files were named. The blank-line file and the wrong-folder file left no trace at all. According to the docs, a file without readable frontmatter is treated as documentation kept next to your agents, so Claude Code does not see it as an error.
The rules a subagent file must follow
Here are the load rules from the official docs. Our four broken files each broke one of them.
- The file goes in
.claude/agents/for one project, or~/.claude/agents/for all your projects. Subfolders inside those are fine. - The opening
---must be the first line of the file. - Both
nameanddescriptionare required. - The
namecannot start with-, contain:, or be longer than 256 characters. - The YAML must parse. One unclosed quote drops the whole file.
- Project subagents are found by walking up from the folder where you start Claude Code to the repository root. Start it in the wrong place and they are not there.
For a correct template of every field, see our subagent file format examples. The same kind of path mistakes hide custom commands, which we covered in the fix for a missing slash command.
Step 2: Claude Does the Work Itself
This is the case most people mean by “Claude Code won’t use my subagent”. The file is fine, the subagent is in the list, and Claude still handles the task alone.
Our working subagent had a lazy description:
---
name: helper
description: Helps with code.
tools: Read, Grep, Glob
model: haiku
---
You are a careful Python bug reviewer. Read the file you are given and
report real bugs only.We asked a plain question: “Check orders.py for bugs. Report only, no edits.” Claude read the file and answered in ten seconds. No subagent ran.

That is fair. “Helps with code” gives Claude no reason to pick this subagent for a bug check.
A better description was not enough for a small task
The docs suggest making the description specific and adding a phrase like “use proactively”. So we renamed the subagent and rewrote the description:
name: bug-reviewer
description: Reviews Python files for bugs and risky logic. Use proactively whenever the user asks to check, review or find bugs in code.We started a new session and sent the exact same prompt. The result surprised us: Claude again read the file and answered itself.

This is one run on one model, so do not read it as “descriptions do not work”. A clear description still matters when you have several subagents and Claude has to route between them. But it shows that a description alone will not push a small task to a subagent.
For a job this size, Claude’s choice matches what the docs recommend. Where automatic delegation tends to pay off is work that produces a lot of output, such as running a test suite or searching many files. Our subagent best practices guide goes deeper on descriptions.
Fix 1: Ask for the Subagent by Name
The docs list three ways to request a subagent yourself. The first needs no special syntax. You just name it.
We went back to the vague helper subagent and asked: “Use the helper subagent to check orders.py for bugs. Report only, no edits.” This time Claude delegated right away.

Two things are worth noting here. The subagent with the worst possible description still ran, because we asked for it. And it started in the background, which is the default in current versions, so Claude told us it would pass along the findings when it finished.
The docs word this carefully: when you name a subagent, Claude “typically delegates”, and it still decides. In our test it did.
Fix 2: @-Mention the Subagent So It Must Run
The second way is stronger. The docs say an @-mention tells Claude to run that subagent for one task.
Type @, pick the agent from the list, and add your request. Or type the mention by hand as @agent- plus the name.
@agent-bug-reviewer check orders.py for bugs. Report only, no edits.
One detail from the docs: while you type the manual form, the menu shows file matches instead of agents. That is normal. The mention still resolves when you press Enter, and it did for us.
Fix 3: Run the Whole Session as the Subagent
The third way removes the choice completely. Start Claude Code with --agent and the main conversation itself takes on that subagent’s prompt, tool limits and model.
claude --agent bug-reviewer
To make this the default for a project, the docs give a setting for .claude/settings.json:
{
"agent": "bug-reviewer"
}We captured the startup header only and did not send a prompt in this mode. Keep in mind that the subagent’s system prompt replaces the default Claude Code prompt here, so use it for focused sessions, not for general work.

Fix 4: Remove a Deny Rule That Blocks the Subagent
Sometimes Claude wants to delegate and is not allowed to. A deny rule in the form Agent(name) turns off one subagent. We added this to the project’s .claude/settings.json:
{
"permissions": {
"deny": ["Agent(bug-reviewer)"]
}
}Then we asked for the subagent by name. Claude looked for the agent first, then told us plainly that a project permission rule blocks it, and offered to review the file itself.

One trap: the denied subagent still appeared in our @ list. So the list tells you a file loaded, not that it is allowed to run.
If Claude mentions a permission rule, search every settings file for Agent(. Our guide to settings file locations shows where they all live.
The docs list three more switches that have the same effect on a wider scale:
- Denying the
Agenttool itself stops all delegation. - The
--disallowedTools "Agent(name)"flag blocks one subagent for a session. - In an agent started with
--agent, atoolsline such asAgent(worker, researcher)allows only those subagent types, and leavingAgentout allows none.
For how deny rules are matched, see our guide to Claude Code permissions.
Fix 5: Repair the Tools List
The last cause looks different. The subagent is chosen, starts, and fails at once. We wrote a subagent with tool names that do not exist:
tools: ReadFile, SearchFilesWhen we asked for it, the launch was refused with this message, visible in the lower half of the screenshot above:
Agent 'readme-checker' would be spawned with zero tools - refusing.
Its tools list resolved to nothing: unrecognized [ReadFile, SearchFiles].
Fix the agent's tools frontmatter or pass a different subagent_type.The fix is to use real tool names, such as Read, Grep, Glob, Bash, Edit and Write. Or delete the tools line, and the subagent inherits every tool available to subagents. The official error reference has an entry for this message.
A quieter version of this problem comes from the docs, and we did not test it. Subagents run in the background by default, and a background subagent keeps only a set list of built-in tools.
Other built-in tools are removed without an error, even if you list them. A few tools, such as AskUserQuestion, are never given to any subagent.
So if your subagent runs but cannot do part of its job, check its tools line against that list. A misspelled field name is also ignored without an error, so write disallowedTools and maxTurns exactly as the docs do.
After the Fixes: Every Subagent Loaded
We repaired every file, including the one with bad tool names: moved one into .claude/agents/, deleted the blank first line, added the missing description, closed the quote and corrected the tool names. The validator passed, and the @ list showed all of them.

Do you need to restart after editing a subagent? Usually not. The docs say Claude Code watches both agents folders and picks up a change within a few seconds.
They name two exceptions: agent folders inside directories added with --add-dir, and sessions started with --disable-slash-commands. In our test we restarted between changes, so the no-restart behavior comes from the docs.

Other Reasons a Subagent Is Skipped
These come from the official docs. We did not reproduce them.
- Name clashes. When two subagents share a name, the higher-priority location wins: managed settings, then the
--agentsflag, then the project, then your user folder, then plugins. Your edit may be going into the copy that loses. - Two files in the same folder with the same
name. Only one loads. The/doctorcheckup reports these. - Plugin subagents use a scoped name such as
my-plugin:code-reviewer. Ask for that full name. - Too many descriptions. Past 15,000 tokens of combined descriptions, Claude Code shows a startup warning. Every subagent still loads, but long descriptions make routing harder, so keep them short and specific.
- A model that is not allowed. If an
availableModelsallowlist blocks the subagent’s model, it runs on a different one. Our guide to subagent models covers the order.
Try It Yourself
Open any project in Claude Code and paste this prompt. It creates one working subagent.
Create a project subagent at .claude/agents/bug-reviewer.md.
Frontmatter must start on line 1 with name, a one-sentence description
that says when to use it, and tools: Read, Grep, Glob.
The system prompt should tell it to report real bugs only, in under
120 words. Do not create any other files.Then type @ and check that bug-reviewer (agent) is listed. Ask a plain question about a file and see whether Claude delegates. Then repeat it with @agent-bug-reviewer in front and compare the two transcripts.
Common Mistakes
- Saving the file in
agents/or.claude/agent/. The folder is.claude/agents/, plural, with the dot. - Leaving a blank line or a comment above the opening
---. - Writing a
nameand forgetting thedescription. - Running
/agentsand expecting a list. It no longer shows one. - Expecting a description to force delegation on a one-file task.
- Guessing tool names.
ReadFileis not a tool;Readis. - Forgetting an old
Agent(name)deny rule in a settings file. - Assuming the subagent ran because the answer looks right. Look for the row with its name.
Pro Tips
- Make the
@list your first check, and the validator your second. - Put the trigger in the description: say what the subagent does and when to use it, in one or two sentences.
- For steps that must always go to a subagent, write the @-mention into your prompt or a custom command instead of hoping for automatic delegation.
- After a background subagent finishes, run
/tasksto open its transcript. The docs say it stays listed for about 30 seconds. - Use subagents for noisy work such as test runs and wide searches. That is where delegation saves context, and our guide to parallel agents shows the pattern.
- For other error text, see our list of common errors.
Cheat Sheet

Frequently Asked Questions
Why is my Claude Code subagent not used automatically?
Either the file did not load, or Claude judged the task quicker to do itself. Type @ to confirm the subagent is listed. If it is, name it in your prompt or use @agent-name.
How do I force Claude Code to use a subagent?
Use an @-mention such as @agent-bug-reviewer for one task. For a whole session, start with claude --agent bug-reviewer or set "agent" in .claude/settings.json.
How do I see which subagents are loaded?
Type @ in the prompt and look for entries marked (agent). The /agents command no longer lists them. For files that fail to load, run claude plugin validate .claude/agents or read the debug log.
Does “use proactively” in the description guarantee delegation?
No. The docs say it encourages delegation, and in our single test Claude still handled a one-file task itself. It is a hint that helps Claude route work, not a rule.
Do subagents work the same outside the terminal?
The same files are used by other Claude AI coding surfaces, and the docs describe the same delegation rules for VS Code and the desktop app. We tested only the interactive terminal on macOS.
Conclusion
When Claude Code won’t use your subagent, check loading first: type @, and if the subagent is missing, fix the folder, the first-line ---, the name and description, and the YAML. If it is listed and still skipped, stop relying on the description. In our tests a plain request was handled by Claude itself both times, while naming the subagent or using @agent-name delegated every time. If Claude says it is blocked, look for an Agent(name) deny rule, and if the launch fails, correct the tools list. Keep automatic delegation for large, noisy tasks, and ask by name for everything else.


