[BUG] Duplicate slash commands when ~/.claude is symlinked to dotfiles directory (regression of #2316 in v2.0.36)
Resolved 💬 4 comments Opened Nov 10, 2025 by gh-tyl Closed Dec 10, 2025
Description
Custom slash commands are displayed twice in the command list when ~/.claude is a directory symlink to a dotfiles repository. Each command appears with two different labels: (project) and (project, gitignored).
Environment
- OS: macOS 26.0.1 (Darwin 25.0.0, Build 25A362)
- Claude Code version: 2.0.36
- Setup:
~/.claude → ~/.dotfiles/.claude(directory symlink)
Steps to Reproduce
- Create a dotfiles directory structure:
````
~/.dotfiles/.claude/
├── commands/
│ ├── commit.md
│ ├── pr.md
│ └── save-context.md
├── settings.json
└── settings.local.json
- Create a directory symlink:
``bash``
ln -s ~/.dotfiles/.claude ~/.claude
- Launch Claude Code from any directory (not just home directory)
- Type
/to open the command list
- Observe duplicate entries for each custom command
Expected Behavior
Each custom command should appear only once in the command list.
Actual Behavior
Each custom command appears twice with different labels:
- First occurrence: labeled as
(project) - Second occurrence: labeled as
(project, gitignored)
Example output:
/commit 変更内容を確認し、適切な粒度でコミットを作成する (project)
/commit 変更内容を確認し、適切な粒度でコミットを作成する (project, gitignored)
/pr 効率的にPR作成(変更分析、title/body生成、レビュアー自動指定) (project)
/pr 効率的にPR作成(変更分析、title/body生成、レビュアー自動指定) (project, gitignored)
Additional Context
- This issue occurs in all directories, not just when running from the home directory
- Issue #2316 reported a similar problem that was fixed in v1.0.61, suggesting this may be a regression
- The physical file location is the same (confirmed via
readlink -f), but Claude Code appears to register it twice through different paths - Commands are functional despite being duplicated
Related Issues
- #2316 - Similar duplication issue, marked as fixed in v1.0.61
- #10573 - Symlink detection issue (different problem: commands not detected at all)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗