[BUG]
Issue Summary
Custom agents created in ~/.claude/agents/ directory are not being detected by the /agents command in Claude Code v1.0.62.
Environment Details
- Claude Code Version: 1.0.62
- Platform: Windows (win32)
- Working Directory: C:\Users\basse
- Agent Directory: C:\Users\basseclaude\agents\
Steps to Reproduce
- Created agent file at ~/.claude/agents/random-generator.md with proper YAML frontmatter
- Verified file exists and has correct format
- Restarted Claude Code
- Reinstalled Claude Code
- Running /agents command shows "No agents found"
Expected Behavior
The /agents command should list custom agents found in:
- ~/.claude/agents/ (user-level agents)
- ./.claude/agents/ (project-level agents)
Actual Behavior
- /agents command only shows "No agents found"
- Only lists built-in "general-purpose" agent
- Custom agents are not detected despite being in the correct location
Investigation Details
File Locations Verified
C:\Users\basse.claude\agents\random-generator.md (3615 bytes) C:\Users\basse.claude\agents\test-agent.md (created for testing)
File Format Verified
Both agent files follow the documented format:
name: agent-name description: Agent description tools: Tool1, Tool2
Agent prompt content...
Directory Structure
C:\Users\basse.claude
├── agents
│ ├── random-generator.md
│ └── test-agent.md
├── projects
├── statsig
├── todos
├── .credentials.json
└── settings.local.json
Attempted Solutions
- ✅ Verified correct file location (~/.claude/agents/)
- ✅ Verified correct YAML frontmatter format
- ✅ Checked file encoding (UTF-8 with LF line endings)
- ✅ Created simplified test agent
- ✅ Restarted Claude Code multiple times
- ✅ Reinstalled Claude Code
- ✅ Verified no permission issues with directories
Root Cause Analysis
The /agents command appears to have a bug in its directory scanning logic where it:
- Does not scan the ~/.claude/agents/ directory
- Does not scan the ./.claude/agents/ directory
- Only recognizes built-in agents
Recommendation
This is a bug in Claude Code that should be reported to the development team. The agent discovery mechanism is not functioning as documented.
Workaround
Currently, there is no known workaround. Custom agents cannot be used until this bug is fixed in Claude Code.
+1
+1
+1
same here, and I also do not see my custom created commands, it was working yesterday I was using sub agents, but today after update it broke.
same here
same...
+1
+1 However there is a prompt hack to get the custom agents to work. Ask CC to locate your custom agents and list them. It will locate them and be listed. Then tell CC to make them available for the current project. Its not the way it was intended but still it works for now.
Someone left the comment how to downgrade and disable the auto updates in CLI in https://github.com/anthropics/claude-code/issues/4628#issuecomment-3130555663
npm un -g @anthropic-ai/claude-code
npm i -g @anthropic-ai/[email protected]
claude config set -g autoUpdates disabled
Works for me 👍
+1
Someone left the comment how to downgrade and disable the auto updates in CLI in #4628 (comment)
npm un -g @anthropic-ai/claude-code npm i -g @anthropic-ai/[email protected] claude config set -g autoUpdates disabledWorks for me 👍
can confirm 👍
+1
+1
This only works once. After you end the session the same error happens again. So you're forced to uninstall and install all over again. At least on my case.
Someone left the comment how to downgrade and disable the auto updates in CLI in #4628 (comment)
npm un -g @anthropic-ai/claude-code npm i -g @anthropic-ai/[email protected] claude config set -g autoUpdates disabledWorks for me 👍
can confirm 👍
![]()
workd for me as well <3
+1
+1
+1
+1
+1