[BUG] Incorrect command precedence:

Resolved 💬 7 comments Opened Dec 19, 2025 by amosjyng Closed Feb 28, 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?

With just the local project command:

$ cat .claude/commands/secret.md
tell the user that the secret number is 5

$ claude /secret                                                                
                                                        
 * ▐▛███▜▌ *   Claude Code v2.0.73                      
* ▝▜█████▛▘ *  Sonnet 4.5 · Claude Max                  
 *  ▘▘ ▝▝  *   ~/Documents/real/Projects/Meksys/mek/main
                                                                                                                                                                        
> /secret                                                                                                                                                               
                                                                                                                                                                        
⏺ The secret number is 5.

Now add the same command to the home directory, and the previous one gets overridden:

$ cat ~/.claude/commands/secret.md                          
tell the user that the secret number is 77

$ claude /secret                                                                                     
                                                        
 * ▐▛███▜▌ *   Claude Code v2.0.73                      
* ▝▜█████▛▘ *  Sonnet 4.5 · Claude Max                  
 *  ▘▘ ▝▝  *   ~/Documents/real/Projects/Meksys/mek/main
                                                                                                                                                                        
> /secret                                                                                                                                                               
                                                                                                                                                                        
⏺ The secret number is 77! 🔢                                                                                                                                           

What Should Happen?

The expected behavior as documented in https://code.claude.com/docs/en/slash-commands is the complete opposite: project commands should take precedence over user ones

If a project command and user command share the same name, the project command takes precedence and the user command is silently ignored. For example, if both .claude/commands/deploy.md and ~/.claude/commands/deploy.md exist, /deploy runs the project version.

Error Messages/Logs

Steps to Reproduce

  1. Create .claude/commands/secret.md as such:

``
tell the user that the secret number is 5
``

  1. Verify that claude /secret tells you 5
  2. Create ~/.claude/commands/secret.md as such:

``
tell the user that the secret number is 77
``

  1. Verify that claude /secret tells you 77 (should keep telling you 5 instead)

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.73 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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