claude-code
claude-code copied to clipboard
Slash commands with hyphens in filename not recognized (v2.0.76)
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
- Create
.claude/commands/docs-sync.mdwith valid frontmatter: -
-
- description: Sync documentation
-
-
-
- Try to invoke
/docs-sync→ command not found
- Try to invoke
-
- Rename to
.claude/commands/docs_sync.md
- Rename to
-
- Invoke
/docs_sync→ works correctly
- Invoke
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.