Skip to content

Custom agents in ~/.claude/agents/ not detected by /agents command #4728

Description

@dimension-zero

Issue Description

Custom agents placed in ~/.claude/agents/ are not being detected or listed by the /agents command, despite following the documented format.

Steps to Reproduce

  1. Create ~/.claude/agents/someagent.md with proper YAML frontmatter:
---
name: someagent
description: Use this agent when you need
[... rest of agent content ...]
  1. Restart Claude Code
  2. Run /agents command

Expected Behavior

The someagent agent should appear in the agents list and be available for use.

Actual Behavior

  • /agents shows "No agents found"
  • Only general-purpose appears as built-in
  • Custom agent is not detected or usable

Environment

  • Platform: Windows 11
  • Claude Code: Latest version
  • File location: C:\Users\[username]\.claude\agents\someagent.md
  • File encoding: ASCII text
  • File format: Validated against documentation

Additional Information

File Contents

The agent file follows the exact format specified in the documentation:

  • Valid YAML frontmatter with name and description fields
  • Proper markdown content below the frontmatter
  • No extraneous fields or formatting issues

This appears to be a bug in the agent detection/loading system rather than a user configuration issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions