[BUG] Slash commands from other projects appear in unrelated project sessions
Resolved 💬 2 comments Opened Jan 14, 2026 by adamggg Closed Jan 15, 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?
Description:
When working in Project A, slash commands defined in Project B's .claude/commands/ directory appear in the available skills list, even though Project B is a completely separate repository.
Current Behavior:
Commands from other projects the user has previously worked on appear in the skills list. These commands fail if invoked (file not found), but they clutter the available commands.
Environment:
- OS: macOS
- Claude Code version: 2.1.7
Notes:
- The commands in question are project-scoped (defined in each project's
.claude/commands/directory), not global user commands in~/.claude/ - This suggests the skill registry is incorrectly merging/caching commands across project boundaries
- Restarting Claude Code does not fix the issue
- Clearing
~/.claude/cache/does not fix the issue - The phantom commands appear to persist across sessions
What Should Happen?
Only commands from the current project's .claude/commands/ directory should appear in the skills list.
Error Messages/Logs
From ~/.claude/debug/{session-id}.txt:
[DEBUG] Loaded 11 unique skills (managed: 0, user: 0, project: 0, legacy commands: 11)
[DEBUG] Skills and commands included in Skill tool:
groupA:cmd1, groupA:cmd2, groupA:cmd3, groupA:cmd4, groupA:cmd5, groupA:cmd6,
groupB:cmd1, groupC:cmd1, groupC:cmd2,
otherproject:cmd1, otherproject:cmd2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ These are from a DIFFERENT repository
Note: This project's .claude/commands/ contains 3 subdirectories (groupA/, groupB/, groupC/)
with 9 total commands. The 2 "otherproject:*" commands do NOT exist in this project -
they leak in from a completely separate repository I previously worked on.
Steps to Reproduce
- Create Project A with custom commands in
.claude/commands/projectA/command1.md - Create Project B with different commands in
.claude/commands/projectB/command2.md - Open Claude Code in Project A
- Observe that
/projectB:command2appears in the available skills list
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.0
Claude Code Version
2.1.7
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Cursor
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗