[BUG] Project slash command with same name as user command always executes user version
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?
Description
When a slash command exists in both ~/.claude/commands/ (user) and .claude/commands/ (project), selecting the (project) version from the autocomplete menu still executes the (user) version instead.
According to the official documentation, "Project commands override personal commands with the same name." However, this override does not work — the user-level command is always executed regardless of which one is selected.
Steps to Reproduce
- Create a global command:
~/.claude/commands/worktree.md(with distinct content, e.g., description "Create Git Worktree") - Create a project command with the same name:
<project>/.claude/commands/worktree.md(with different content) - Open Claude Code in the project directory
- Type
/and observe two entries:
/worktree Create Git Worktree (user)/worktree Create Git Worktree (project)
- Select the
(project)version
Expected: The project-level worktree.md content is executed.
Actual: The user-level worktree.md content is executed.
This also reproduces with worktree-remove.md — same name exists in both locations, and the user version is always used.
Environment Info
- Claude Code version: v2.1.42
- Claude model: Opus 4.6 · Claude Max
- Platform: macOS (MacBook Pro, M4)
- Terminal: Warp (v0.2026.02.11.08.23.stable_01)
Screenshots
1. Global commands (~/.claude/commands/)
Contains: code-review.md, pair-review.md, pr-description.md, worktree-remove.md, worktree.md
2. Project commands (<project>/.claude/commands/)
Contains: worktree.md, worktree-remove.md
3. Autocomplete shows both (user) and (project) — but selecting (project) runs (user)
<img width="465" height="158" alt="Image" src="https://github.com/user-attachments/assets/0438a180-6326-47e4-96d2-a8755346cc4c" />
Additional Context
- The UI correctly distinguishes between
(user)and(project)in the autocomplete menu - Despite explicitly selecting the
(project)entry, the user-level command content is always executed - Both commands have different content and produce visibly different behavior, confirming it's the wrong file being used
What Should Happen?
When both user-level and project-level commands share the same name:
Selecting (project) should execute the project-level file, and selecting (user) should execute the user-level file. The UI already distinguishes between the two — the execution should match the selection.
If only one should exist (i.e., project overrides user as documented), then the (user) entry should not appear in the autocomplete at all when a (project) version exists, to avoid confusion.
Either behavior is acceptable, but the current state — where both appear in the menu yet only the user version ever runs — is clearly a bug.
Error Messages/Logs
Steps to Reproduce
- Create a global command:
~/.claude/commands/worktree.md(with distinct content, e.g., description "Create Git Worktree") - Create a project command with the same name:
<project>/.claude/commands/worktree.md(with different content) - Open Claude Code in the project directory
- Type
/and observe two entries:
/worktree Create Git Worktree (user)/worktree Create Git Worktree (project)
- Select the
(project)version
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.42
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Warp
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗