[BUG] Custom commands duplicated and non-functional when running Claude Code from home directory
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other:
- Claude CLI version: 1.0.29 (Claude Code)
- Operating System: Ubuntu 22.04 LTS (Pop!_OS)
- Terminal: Alacritty and Warp Terminal
Bug Description
When running Claude Code from the home directory, custom user commands from ~/.claude/commands/ are duplicated in the slash command list and become non-functional. Each scroll cycle adds more non-functional duplicate entries at the top of the command list.
Steps to Reproduce
- Create custom commands in
~/.claude/commands/ - Run
claudefrom home directory (cd ~ && claude) - Type
/to open command list - Scroll through the entire command list to the end or move between first and last entry.
- Observe additional duplicate lines appear
Expected Behavior
Each custom command should appear once in the list in alphabetical order.
Actual Behavior
- Custom commands are duplicated multiple times throughout the command list
- Each time you scroll to the end and back to top, another non-functional duplicate line is added at the top
- The duplicated commands at the top cannot be executed
- Command list becomes increasingly cluttered and difficult to navigate
Additional Context
- Issue only occurs when running Claude Code from the home directory (
~) - Commands work normally when running Claude Code from any other directory
- Personal commands are stored in
~/.claude/commands/as documented - Bug makes the command interface unusable when working from home directory
Can confirm this is the same on macOS and on other terminals like iTerm2 or IntelliJ integrated terminal.
In case any devs from Anthropic read this, the issue is that when the slash commands from both ~/.claude/commands and ./.claude/commands are combined, the duplicates throw off the renderer. You can just create a set of uniques by name to fix this.
With the latest version (1.59.0), you can do a
sed -i '' 's/\[\.\.\.o,\.\.\.v1\]/[...new Map([...o, ...v1].map(item => { return [item.name, item] })).values()]/g' "/path/to/cli.js"
to patch it.
Fixed in v1.0.61
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.