claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG]

Open basselemam0612 opened this issue 1 year ago • 39 comments

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

  1. Created agent file at ~/.claude/agents/random-generator.md with proper YAML frontmatter
  2. Verified file exists and has correct format
  3. Restarted Claude Code
  4. Reinstalled Claude Code
  5. 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

  1. ✅ Verified correct file location (~/.claude/agents/)
  2. ✅ Verified correct YAML frontmatter format
  3. ✅ Checked file encoding (UTF-8 with LF line endings)
  4. ✅ Created simplified test agent
  5. ✅ Restarted Claude Code multiple times
  6. ✅ Reinstalled Claude Code
  7. ✅ 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.

basselemam0612 avatar Jul 29 '25 01:07 basselemam0612

+1

benjamin-johnston-work avatar Jul 29 '25 05:07 benjamin-johnston-work

+1

wangkangmao avatar Jul 29 '25 07:07 wangkangmao

+1

zarzet avatar Jul 29 '25 08:07 zarzet

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.

Inther-MCe avatar Jul 29 '25 08:07 Inther-MCe

same here

EunHyeokJung avatar Jul 29 '25 08:07 EunHyeokJung

same...

BennyShabtai avatar Jul 29 '25 09:07 BennyShabtai

+1

balrokko avatar Jul 29 '25 10:07 balrokko

+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.

crocware avatar Jul 29 '25 10:07 crocware

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 👍

EunHyeokJung avatar Jul 29 '25 11:07 EunHyeokJung

+1

saurabhabh avatar Jul 29 '25 11:07 saurabhabh

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 disabled

Works for me 👍

can confirm 👍

caesariodito avatar Jul 29 '25 13:07 caesariodito

+1

thedelph avatar Jul 29 '25 13:07 thedelph

+1

xSyphyx avatar Jul 29 '25 14:07 xSyphyx

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.

p-samuel avatar Jul 29 '25 14:07 p-samuel

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 disabled

Works for me 👍

can confirm 👍

Image

workd for me as well <3

basselemam0612 avatar Jul 29 '25 14:07 basselemam0612

+1

Woody-ROL avatar Jul 29 '25 15:07 Woody-ROL

+1

jeremy-schaab avatar Jul 29 '25 15:07 jeremy-schaab

+1

testlearnaccess avatar Jul 29 '25 15:07 testlearnaccess

+1

0MarkB avatar Jul 29 '25 16:07 0MarkB

+1

perkins228 avatar Jul 29 '25 16:07 perkins228