[BUG] Slash Commands not recognized
Resolved 💬 18 comments Opened May 29, 2025 by natepiano Closed Jan 25, 2026
💡 Likely answer: A maintainer (bcherny, collaborator)
responded on this thread — see the highlighted reply below.
Environment
- Platform (select one):
- [X] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.5
- Operating System: MacOS 15.5
- Terminal: iTerm2, Zed
Bug Description
slash commands from my .claude/commands folder no longer show up when i type a /
they used to work great
Steps to Reproduce
- run claude
- type a / to bring up the list of commands
Expected Behavior
My custom slash commands are there
Actual Behavior
My custom slash commands aren't there
Additional Context
This is painful - I spent a lot of time on these and i like the usability
18 Comments
I agree, this would be a huge QoL feature
There is a previous open issues with work arounds for restoring slash commands:: #1212
Hi! Are you setting the
CLAUDE_CONFIG_DIRenv var? And do you mean your~/.claude/commands/, or the.claude/commands/from the directory you're runningclaudein? If the latter, please share the full path.@bcherny I am experiencing this as well. WSL2 Ubuntu. Clearing the project folder from ~/.claude/projects/TheProjectIAmOn resolves the issue, but of course isn't ideal
I'm seeing this as well - it seems to only happen after purging worktrees
Also having this issue, even though root dir is recognized by Claude code
This behavior was happening for me to and just confirming that what @StephenBadger said worked for me to restore the slash commands.
Recycled the weird solve while debugging, left my notes on
1.0.44 (Claude Code)on macOSSequoia 15.5in case this helps anyone:``
export CLAUDE_CONFIG_DIR=$HOME/.claude``In my version of a
.zshrconly this worked (might reset default and delete any MCPs you have, back up Claude.) Got the idea from this solution, as there is nothing about this variable anywhere in the docs.EDIT:
Does not last, I ran
/mcpagain after adding one back with a custom commands, and they all came back. However, now that all my MCP servers work the commands are gone again, lol.Need the MCP servers more so just gonna wait and see what happens. Explicitly ask claude to look for that command at a location when I need it, but it runs that command wrong.
Process:
1) Missing several custom commands in my
~/.claude/commands, realized while trying to use a worktree command and its missing2) While fiddling with
~/.claude.jsonI find that I have the$XDG_CONFIG_HOMEversion of claude somehow, living in~/.config/claude; decide to delete the conflicting folder3) Custom commands still not working, and won't save to
~/.claude/commandsor./.claude/commands4) Created an empty
~/.config/claudeand the commands briefly came back5) Found the above secret parameter and tried it; defaulted me back to regular claude and I lost all my MCPs in the process, but commands are back
Related:
https://github.com/anthropics/claude-code/issues/1212
https://github.com/anthropics/claude-code/issues/1455
https://github.com/anthropics/claude-code/issues/2277#issuecomment-2997951442
filed new issue.
@lightningRalf Please file a new issue for what you're seeing. I would also recommend removing
from your config, since it is functionally the same as how we look for your user-level config dir by default.
I'm running into the same problem. I ran claude with
staceand it looks like ANSI escape sequences are used for accessing the files in my case.It accesses other files OK, CLAUDE.md is read, and settings too, example:
I've had a similar issue where
claude doctorshowed everything working well with the native installer, but I couldn't find any custom commands.Fixed it by installing
ripgrepusingbrew install ripgrep.https://docs.anthropic.com/en/docs/claude-code/troubleshooting#search-and-discovery-issues
I just ran into the same issues and here's how I solved it:
After the installation, this issues was solved.
By the way, here's the environment information of my work space:
Actually maybe you just need to run "claude --debug" and throw all the debug messages to Claude again, you can figure out what happen.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
I experienced similar symptoms today (claude code 2.0.76).
When running with
--debugand reviewing the generated log file, I too noticed that the files in~/.claude/commandsit was complaining about being unable to read were colored when viewing the log file withlessin my macOS iterm terminal. Noticing that a previous line in the debug log was testing whether or notrg(ripgrep) worked (successfully), I speculated thatrgis being used to find files, and thatrg's output had ansi color sequences in it, and that subsequent attempts to open the files returned byrginclude those color sequences in the filenames, resulting in theENOENT: no such file or directoryerrors in the debug logs.I tracked down the problem in my installation being my global configuration of
rg, as set withexport RIPGREP_CONFIG_PATH=$HOME/.ripgreprcto point to~/.ripgreprc, with--color always.Removing this configuration resolved claude code's inability to read the slash command files, and now the slash commands appear as expected.
While I wouldn't say this is a bug in claude code, claude code could be extended to check for leading/trailing ansi color sequences in the outputs it gets from
rg, and removing them before further processing. Or, figure out if there's a way to force it to not output color even when the user has that specified in~/.ripgreprc. I was unable to find a way to do that in the 60 seconds tried.This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
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.