[BUG] Custom slash commands not discovered

Status Fixed / completed
Maintainer reply ✓ Yes — sid374
Activity 7 comments · opened Apr 2, 2025 · closed Apr 3, 2025
💡 Likely answer: A maintainer (sid374, contributor) responded on this thread — see the highlighted reply below.

FIrst off, I almost always git-ignore my claude files. .claude is a dot-directory, so if Claude is trained to ignore it, then it does not seem to pick up on any of the slash commands that I add, even after refreshing sessions. I have a .python-version file and it was not able to provide a response based on that file until I told it to look there. Is this a default setting? OK, no problem if it is, but shouldn't this be documented? And shouldn't .claude/ files be excluded?? Claude is not picking up on the slash commands that I'm adding there.

View original on GitHub ↗

7 Comments

sid374 contributor · 1 year ago

@hesreallyhim just to confirm you are putting your custom slash commands in .claude/commands right as documented here?

These should show up in the typeahead slash command menu when you type / in the prompt input

hesreallyhim · 1 year ago

Yes, I'm putting commands in ./.claude/commands and ~/.claude/commands, once in a while i see they are registered and they populate the auto-complete but lately it seems like it hasn't been working

hesreallyhim · 1 year ago

I'm almost always working from within a VS Code terminal, FWIW

sid374 contributor · 1 year ago

Fix incoming in new version!

hesreallyhim · 1 year ago

This seems to be working for me now! 🙏

hesreallyhim · 1 year ago

Some observations:

  • You can edit an existing slash-command inside a session and it will automatically update (presumably it reads these on-demand).
  • Directly editing CLAUDE.md does not seem to take immediate effect. I then wrote "please review Claude.md and update your memory" and it seems to have worked. Opening a new session also seems to work reliably.
  • Interactionsbetween slash-commands and instructions in the CLAUDE.md file. slash-commands seem to have access to CLAUDE.md instructions and information. But if there is a conflict, it seems like CLAUDE.md is given more weight. Example:

Claude.md: Every response should start with the word "RESPONSE: "
.claude/commands/say-hello.md: "Respond with the exact phrase, "Hello World!"

/project:say-hello is running…
  • RESPONSE: Hello World!

So it "disobeys" the slash-command somewhat, but follows the CLAUDE.md more strictly.

github-actions[bot] · 1 year ago

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.