Custom agents in .claude/agents/ directory not loading in Task tool or /agents command

Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Sep 27, 2025 · closed Sep 27, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

  1. Version: 1.0.127
  2. Platform: Windows
  3. Issue: Custom agents in .claude/agents/ directory not loading in Task tool or /agents command
  4. Evidence: claude agents list shows them but they're not available for use
  • ✅ Updated: Claude Code 1.0.65 → 1.0.127
  • ✅ Agents exist: Files are properly formatted in .claude/agents/
  • ✅ CLI recognition: claude agents list shows them
  • - ❌ /agents slash command doesn't find them
  • ❌ Task tool doesn't load them as available agent types

What Should Happen?

i am expecting Claude Code to load custom agents from the .claude/agents/ directory.

Error Messages/Logs

code-reviewer(Test agent after update)
  ⎿  Initializing…
  ⎿  Error: Agent type 'code-reviewer' not found.

Steps to Reproduce

add a custom agent using claude code
edit custom agent wiht my desired agent prompt
restart claude to accept edits
run /agents coomand

result no agents found

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.127

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

5 Comments

github-actions[bot] · 1 year ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7429
  2. https://github.com/anthropics/claude-code/issues/5289
  3. https://github.com/anthropics/claude-code/issues/4728

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

mg-dev25 · 1 year ago

Had the same problem - custom commands AND agents not showing up in /help even though search was working.

Found the culprit was my ripgrep config. I had --color=always in my ~/.ripgreprc which was embedding ANSI color codes in file paths during Claude Code's
discovery process. It was trying to read files like [0m[1m[32m/path/to/command.md[0m instead of the actual path.

Fixed it by changing --color=always to --color=auto in my ripgrep config. Still get colors in terminal but Claude Code gets clean paths for file
discovery.

Worth checking if you have custom ripgrep settings - might be the same issue.

mj313194 · 1 year ago
Had the same problem - custom commands AND agents not showing up in /help even though search was working. Found the culprit was my ripgrep config. I had --color=always in my ~/.ripgreprc which was embedding ANSI color codes in file paths during Claude Code's discovery process. It was trying to read files like [0m[1m[32m/path/to/command.md[0m instead of the actual path. Fixed it by changing --color=always to --color=auto in my ripgrep config. Still get colors in terminal but Claude Code gets clean paths for file discovery. Worth checking if you have custom ripgrep settings - might be the same issue.

i added an additional agent and did not select a color. Restarted Claude and now all three agents are found. Confirmed to also be loaded as task tools. Thanks

mj313194 · 1 year ago

i added an additional agent and did not select a color. Restarted Claude and now all three agents are found. Confirmed to also be loaded as task tools.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.