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

Project commands don't override global commands (precedence reversed)

Open Stefan-Nitu opened this issue 2 weeks ago • 1 comments

Description

According to the documentation, project commands (.claude/commands/) should take precedence over global/user commands (~/.claude/commands/). However, in practice, global commands take precedence over project commands.

From the docs:

If a project command and user command share the same name, the project command takes precedence and the user command is silently ignored.

Steps to Reproduce

  1. Create a global command:

    mkdir -p ~/.claude/commands
    echo "Global version of the command" > ~/.claude/commands/my-command.md
    
  2. Create a project command with the same name:

    mkdir -p .claude/commands
    echo "Project-specific version" > .claude/commands/my-command.md
    
  3. Run /my-command in the project

Expected Behavior

The project command should run: "Project-specific version"

Actual Behavior

The global command runs instead: "Global version of the command"

Environment

  • Restarted Claude Code multiple times
  • Tested in multiple projects
  • Both files confirmed to exist in correct locations

Workaround

Remove the global command so only project commands exist.

Stefan-Nitu avatar Jan 04 '26 17:01 Stefan-Nitu