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

Slash commands with hyphens in filename not recognized (v2.0.76)

Open murillodutt opened this issue 11 months ago • 0 comments

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?

Custom slash commands defined in .claude/commands/ with hyphens in the filename are not recognized by Claude Code CLI v2.0.76. Commands using underscores work correctly.

What Should Happen?

Both docs-sync.md and docs_sync.md should be recognized as valid command filenames, as official documentation shows hyphenated examples like security-review.md, fix-issue.md, and review-pr.md.

Custom slash commands in .claude/commands/ with hyphens are NOT recognized:

  • docs-sync.md → /docs-sync NOT FOUND
  • docs_sync.md → /docs_sync WORKS

Error Messages/Logs

Unknown slash command: docs-sysnc

Steps to Reproduce

  1. Create .claude/commands/docs-sync.md with valid frontmatter:

  2. description: Sync documentation

    1. Try to invoke /docs-sync → command not found
    1. Rename to .claude/commands/docs_sync.md
    1. Invoke /docs_sync → works correctly

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

v2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Workaround: Use underscores instead of hyphens in command filenames.

Note: Documentation and examples should be updated to reflect actual behavior, OR hyphens should be supported as shown in docs.

murillodutt avatar Dec 30 '25 23:12 murillodutt