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

Resolved 💬 6 comments Opened Dec 30, 2025 by murillodutt Closed Feb 20, 2026

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. ```yaml
  3. ---
  4. description: Sync documentation
  5. ---
  6. ```
  7. 2. Try to invoke /docs-sync → command not found
  8. 3. Rename to .claude/commands/docs_sync.md
  9. 4. 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.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗