[BUG] Claude Code does not detect slash commands located under .claude/commands directory

Resolved 💬 20 comments Opened Oct 14, 2025 by epaprat Closed Feb 10, 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?

Claude Code is not detecting any slash commands placed in the .claude/commands folder. Even though the directory exists in the project root and contains valid command files, none of them appear in the Slash Commands list or autocomplete when using / in the editor.

What Should Happen?

Claude Code should automatically detect and load all slash commands located in the .claude/commands directory. These commands should appear in the Slash Commands list and be available for autocomplete when typing / in the editor.

Error Messages/Logs

No error messages appear in the Claude Code interface or console. The slash commands are simply not detected no warnings, logs, or failed load indicators are shown.

Steps to Reproduce

  1. Open any project folder in Claude Code.
  1. In the project root, create a directory named: .claude/commands
  1. Inside that directory, create a file named test.md with the following dummy slash command content:

This is a dummy command for testing Claude Code slash command detection.

  1. Save the file.
  1. Reload Claude Code or reopen the workspace.
  1. Try typing /test in the editor or check the “Slash Commands” panel.

Result:
The command does not appear in the list or autocomplete, and cannot be executed.

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.0.14

Claude Code Version

2.0.14

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

WSL (Windows Subsystem for Linux)

Additional Information

<img width="1386" height="554" alt="Image" src="https://github.com/user-attachments/assets/2a8b4821-e934-46d0-96cf-1ea29dde8e56" />

View original on GitHub ↗

20 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8831
  2. https://github.com/anthropics/claude-code/issues/9435
  3. https://github.com/anthropics/claude-code/issues/1212

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

epaprat · 9 months ago

Additional Notes / Troubleshooting Tried:
I’ve already tried the known fixes:

Clearing the ~/.claude/projects directory

Adjusting file permissions for .claude and .claude/commands in the project folder

Reinstalling Claude Code both locally and globally via npm

None of these resolved the issue.

epaprat · 9 months ago

After running the manual install below for WSL, the issue was resolved.
It seems that npm install somehow causes this problem.

Install latest version

curl -fsSL https://claude.ai/install.sh | bash -s latest

Dingzeefs · 9 months ago
After running the manual install below for WSL, the issue was resolved. It seems that npm install somehow causes this problem. # Install latest version curl -fsSL https://claude.ai/install.sh | bash -s latest

You would not believe it man but when running this command the script downloads an intel version instead of arm. I do not have my m1 macbook running in Rosetta so I am totally baffled why this happends

My NPM version is ARM based and downloads normally

bradleyfay · 9 months ago

Additional Reproduction Case: macOS Confirmation

I can confirm this issue on macOS (Darwin 24.6.0) with Claude Code v2.0.21.

### Environment

  • Platform: macOS Darwin 24.6.0
  • Claude Code: v2.0.21
  • Installation: Homebrew
  • Project: Fresh clone from Specify template with 8 command files in .claude/commands/

### Debug Log Evidence

From ~/.claude/debug/latest, the root cause is clear:

[DEBUG] Loading skills from directories:
managed=/Library/Application Support/ClaudeCode/.claude/skills
user=/Users/bfay/.claude/skills
project=/Users/bfay/pulpit/.claude/skills

[DEBUG] Total plugin commands loaded: 0
[DEBUG] Loaded 0 skills total (managed: 0, user: 0, project: 0)
[DEBUG] Slash commands included in SlashCommand tool:
[DEBUG] Skills and commands included in Skill tool:

The issue: Claude Code only scans .claude/skills/ directories but the project uses .claude/commands/. The
.claude/commands/ directory is never scanned.

### File Structure Verified

All 8 command files exist with proper permissions and frontmatter:

```bash
$ ls -la .claude/commands/
-rw-r--r-- 7.1K speckit.analyze.md
-rw-r--r-- 17K speckit.checklist.md
-rw-r--r-- 11K speckit.clarify.md
-rw-r--r-- 5.1K speckit.constitution.md
-rw-r--r-- 7.2K speckit.implement.md
-rw-r--r-- 2.9K speckit.plan.md
-rw-r--r-- 12K speckit.specify.md
-rw-r--r-- 6.1K speckit.tasks.md


  Each file has valid frontmatter:
  ---
  description: <command description>
  ---

  Hypothesis

  Claude Code v2.0 introduced "Skills" (v2.0.20) and "Plugin System" (v2.0.12). The command discovery logic appears
  to have been refactored to only scan .claude/skills/ without maintaining backward compatibility for
  .claude/commands/.

  This affects any project created with the older .claude/commands/ structure, including templates like the
  Specify/Pulpit template.

  Configuration Verification

  Confirmed this is NOT caused by:
  - Shell environment variables
  - Dotfile configuration
  - Git config
  - File permissions
  - Claude Code settings

  This is a directory naming/discovery issue in the command scanner itself.
youngdonkim · 8 months ago

I have a same problem

jwiegley · 8 months ago

Same problem for me.

gcherem · 8 months ago

Same for me

flamedmg · 8 months ago

same issue even on clean machine (macOS)

brucechou1983 · 8 months ago

Same here.

os: LinuxVersion: 6.8.0-1041-gcp
claude code v2.0.25

A workaround to me: the --plugin-dir option add both slash commands and sub-agents successfully

foglerek · 8 months ago

Confirming same issue on 2.0.27 (OSX 26.0.1). It was working until new sessions stopped loading the custom commands. This breaks my workflows. I tried clearing ~/.claude/projects to no avail.

jwiegley · 8 months ago

I noticed yesterday that my slash commands had started working again with 2.0.26, but I didn't do anything special to use them.

michal-samluk · 8 months ago

Same issue. When telling agent to use SlashCommand(/my_command) then it can run it.

mattkeenan · 7 months ago

i have a possible cause; the permissions on the npm vendor files under /usr/lib/node_modules/. I run tight permissions on my root user (umask 077) and this means that when installing / updating npm it caused the files to become non readable / executable for non root users. this silently broke custom commands (and possibly other things) for claude code. fixing the permissions fixed the problem.

obviously this might not be the only cause, but it was my cause.

run the following as root.

chmod -fR go+r /usr/lib/node_modules/*
find /usr/lib/node_modules -type d -print0 | xargs -0 chmod 755
find /usr/lib/node_modules -type f -perm -u+x -print0 | xargs -0 chmod go+x

the paths on macos will be different but i don't have a mac machine to test on

veraposeidon · 7 months ago
Same here. os: LinuxVersion: 6.8.0-1041-gcp claude code v2.0.25 A workaround to me: the --plugin-dir option add both slash commands and sub-agents successfully

claude --plugin-dir .claude/ works, thanks a lot!

OS: macOS 14.7.4
CC: 2.0.55 (Claude Code)

vobornik · 7 months ago

Still broken in 2.0.55 (npm) - Workaround confirmed

Environment:

  • Claude Code version: 2.0.55
  • Installation: npm (@anthropic-ai/claude-code@2.0.55)
  • OS: Linux (kernel 6.8.0-86-generic)
  • Structure: ~/.claude/commands/example.md (flat .md files, not subdirectories)

Problem:
Global slash commands in ~/.claude/commands/ are completely ignored. Debug logs show:
Loading skills from directories: user=/home/user/.claude/skills, ...
Loaded 0 unique skills (managed: 0, user: 0, project: 0)
Slash commands included in SlashCommand tool:

Code analysis:
I examined the minified cli.js (~10MB) and found:

  1. ✅ Skills loading exists - scans ~/.claude/skills/ for subdirectories with SKILL.md
  2. No code for loading slash commands from ~/.claude/commands/
  3. .claude/commands only appears in sandbox ignore patterns

Workaround that works:

claude --plugin-dir ~/.claude/

With this flag, /example executes correctly from ~/.claude/commands/example.md.

Permanent fix - add to .bashrc:

  alias claude='claude --plugin-dir ~/.claude/'

Question: Is --plugin-dir the intended way to use global commands, or is this a bug where the default user directory loading is broken?

The documentation suggests ~/.claude/commands/ should work automatically, but the npm installation doesn't seem to include that functionality.

sti0 · 7 months ago

I had the same problem and found my root cause. After installing a plugin marketplace the local slash commands were gone. After removing the plugin local slash commands are accessable again.

Workaround with alias claude='claude --plugin-dir ~/.claude/' works.

github-actions[bot] · 6 months ago

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.

github-actions[bot] · 5 months ago

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.

github-actions[bot] · 4 months 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.