Submit a toolSubmit

Claude Code can’t find your custom subagent. Fix the file and frontmatter

If Claude Code can’t find a custom subagent, fix name and description frontmatter in `.claude/agents/` or `~/.claude/agents/`. Restart if that folder is new. Short answer: 5 steps. 1) Put the file where Claude Code actually scans; 2) Require valid YAML frontmatter with name and description; 3) Keep names unique, then validate the directory; 4) Restart when the agents directory is brand new, or when using --add-dir; 5) Confirm it appears, then invoke it deliberately.

Last updated: · This page is the decision checklist; the tools list for “Make Claude Code custom subagents load” is a separate URL.

The problem: If Claude Code can’t find a custom subagent, fix name and description frontmatter in `.claude/agents/` or `~/.claude/agents/`. Restart if that folder is new.

How do I fix the file and frontmatter when Claude Code can’t find a custom subagent?

  1. Put the file where Claude Code actually scans

    Project subagents live in `.claude/agents/` (discovered walking up from the working directory to the repo root). Personal ones live in `~/.claude/agents/` (all projects on this machine). Claude Code scans those trees recursively; identity comes from the frontmatter `name`, not the folder path. Docs: https://code.claude.com/docs/en/sub-agents

  2. Require valid YAML frontmatter with name and description

    The file must start with `---` on line 1, then YAML, then a closing `---`, then the system-prompt body. Only `name` and `description` are required. Claude Code silently skips project/user/managed agent files when `name` is missing, `description` is missing, YAML doesn’t parse, the opening `---` isn’t the first line, or `name` starts with `-`, contains `:`, or is longer than 256 characters—often with a note only in the debug log (`claude --debug`).

  3. Keep names unique, then validate the directory

    Duplicate `name` values under the same `.claude/agents/` tree load only one definition (filesystem read order). Across nested project folders, the definition closest to the working directory wins. Run `claude plugin validate` against `.claude/agents` or `~/.claude/agents` (Claude Code v2.1.233+) to catch unparsable frontmatter before the next session.

  4. Restart when the agents directory is brand new, or when using --add-dir

    Claude Code watches existing `~/.claude/agents/` and `.claude/agents/` folders and picks up edits within a few seconds. If `~/.claude/agents/` did not exist when the session started, create the directory and restart so the watcher attaches. Subagents under a directory added with `--add-dir` / `/add-dir` are also not hot-reloaded—restart after adding or editing them there.

  5. Confirm it appears, then invoke it deliberately

    Ask Claude to use the subagent by name, or use the Agent tool / `/agents` flow described in the docs. If Explore or Plan ignore project instructions you expected from `CLAUDE.md`, remember those built-ins skip `CLAUDE.md` at startup—restate critical rules in the delegation prompt, or put them in the custom subagent body. Directory map: https://code.claude.com/docs/en/claude-directory

Which tools are best to make Claude Code custom subagents load?

Create custom subagents

File locations, required frontmatter, skip rules, watchers, and --add-dir behavior.

Explore the .claude directory

Where agents, skills, and settings live under project and user scopes.

Extend Claude with skills

Related layout if you preload skills into a subagent with the skills field.

Debug your configuration

Symptom table for skills, hooks, MCP, and other config that fails to load.

All tools for “Make Claude Code custom subagents load” →

Related fixes

See also AI tools launched today on the daily board.