[BUG] Slash Commands Not Loading from .claude/commands Directory in v2.0.22
[BUG] Slash Commands Not Loading from .claude/commands Directory
Environment
Claude Code Version: 2.0.22
Platform: Linux (WSL2)
OS Version: Linux 6.6.87.2-microsoft-standard-WSL2
Installation Type: Native
Working Directory: /workspaces/knowledge-forge
Issue Summary
Custom slash commands defined in .claude/commands/*.md are not being discovered or loaded by Claude Code. The directory exists, contains properly formatted command files, but zero commands are registered.
Expected Behavior
According to Claude Code documentation, commands placed in .claude/commands/ should be automatically discovered and available as slash commands. These should appear:
- In autocomplete when typing
/ - In the SlashCommand tool available commands list
- Be executable via
/command-name
Actual Behavior
- Zero commands are loaded despite 17 properly formatted
.mdfiles in.claude/commands/ - Typing
/shows only built-in commands - Debug logs show
[DEBUG] Slash commands included in SlashCommand tool:(empty) - No scanning/discovery process runs for slash commands
- No error messages or warnings about command loading
Directory Structure
/workspaces/knowledge-forge/.claude/
├── commands/
│ ├── architect.md
│ ├── breakdown.md
│ ├── execute.md
│ ├── github.md
│ ├── hello.md # Simple test command
│ ├── help.md
│ ├── initiate.md
│ ├── integrate.md
│ ├── phase.md
│ ├── scope-review.md
│ ├── specify.md
│ ├── status.md
│ ├── test.md # Minimal test command
│ ├── validate.md
│ ├── validate-scope.md
│ └── workflow-status.md
├── settings.json
└── settings.local.json
Directory Permissions:
drwxr-xr-x 2 vscode vscode 4096 Oct 19 16:55 commands/
-rw-r--r-- 1 vscode vscode 86 Oct 19 16:55 hello.md
-rw-r--r-- 1 vscode vscode 144 Oct 19 16:08 test.md
Command File Format
All command files follow the correct frontmatter format:
hello.md:
---
description: Test hello command
---
Hello World! This is a minimal test command.
test.md:
---
description: Simple test command
argument-hint: message
---
This is a test command. You said: $ARGUMENTS
Current working directory: $(pwd)
All 17 files have valid YAML frontmatter with description field.
Debug Log Evidence
From: ~/.claude/debug/71ebfaa0-a184-4792-a500-689f569923c4.txt
Skills Loading (Works Correctly)
[DEBUG] ENABLE_SKILLS check passed, loading skills...
[DEBUG] Loading skills from directories: managed=/etc/claude-code/.claude/skills, user=/home/vscode/.claude/skills, project=/workspaces/knowledge-forge/.claude/skills
[DEBUG] Total plugin skills loaded: 0
[DEBUG] Total plugin commands loaded: 0
[DEBUG] Loaded 0 skills total (managed: 0, user: 0, project: 0)
Slash Commands Loading (Broken)
[DEBUG] Skills and commands included in Skill tool:
[DEBUG] Slash commands included in SlashCommand tool:
[DEBUG] Loaded plugins - Enabled: 0, Disabled: 0, Commands: 0, Agents: 0, Errors: 0
Critical Missing Log: There is NO equivalent "Loading slash commands from directories..." message. The system that scans .claude/commands/ never runs or logs anything.
Repeated Throughout Session
The log contains 29 instances of:
[DEBUG] Slash commands included in SlashCommand tool:
All are empty - no commands listed.
Comparison: Skills vs Commands
| Feature | Directory | Log Message | Status |
|---------|-----------|-------------|--------|
| Skills | .claude/skills/ | "Loading skills from directories..." | ✓ Scanning runs |
| Slash Commands | .claude/commands/ | (none) | ✗ No scanning |
The slash command discovery mechanism never executes or fails silently.
Configuration
settings.json:
{
"env": {
"PYTHONPATH": "${PWD}",
"PROJECT_ROOT": "${PWD}",
"SLASH_COMMAND_TOOL_CHAR_BUDGET": "100000",
"USE_BUILTIN_RIPGREP": "0"
},
"permissions": {
"allowedTools": [
"SlashCommand",
...
]
},
"model": "claude-sonnet-4-5-20250929"
}
Additional Observations
- Settings loading works: Debug shows settings files being watched and loaded
- Hooks work: PostToolUse hooks execute correctly
- Directory detection works: Manual
test -d /workspaces/knowledge-forge/.claude/commandssucceeds - File reading works: Manual
cat /workspaces/knowledge-forge/.claude/commands/test.mdsucceeds - Only discovery is broken: The automated scanning/loading of commands never happens
Secondary Issue (Possibly Unrelated)
Ripgrep builtin test fails:
[DEBUG] Ripgrep first use test: FAILED (mode=builtin, path=/home/vscode/.local/share/claude/versions/2.0.22)
This path is incorrect (it's a file, not a directory), but system ripgrep works fine:
$ which rg
/usr/bin/rg
$ rg --version
ripgrep 13.0.0
Settings specify "USE_BUILTIN_RIPGREP": "0" so this may be unrelated.
Steps to Reproduce
- Create
.claude/commands/directory in project root - Add a simple command file with valid frontmatter:
```markdown
---
description: Test command
---
Hello from test command.
```
- Start Claude Code session
- Type
/in conversation - Observe: Only built-in commands appear, custom command is missing
Workarounds Attempted
- ✗ Restarting Claude Code
- ✗ Checking file permissions
- ✗ Verifying YAML frontmatter format
- ✗ Creating minimal test commands
- ✗ Checking settings configuration
Related GitHub Issues
This appears to be a known issue affecting multiple users:
- #9518: Claude Code does not detect slash commands located under .claude/commands directory
- #8831: Custom slash commands not discovered in ~/.claude/commands/
- #1212: Claude Code not finding custom commands
- #1483: Commands Not Detected in .claude/commands Directory
- #7283: Custom slash commands no longer working
Request
Please investigate why the slash command discovery/scanning mechanism is not running in version 2.0.22. The skills loading mechanism works (logs show directory scanning), but there's no equivalent scanning for .claude/commands/ directories.
---
Full debug log available upon request.
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Manual SlashCommand Tool Testing - Confirms Bug
I manually tested the SlashCommand tool to verify command discovery, and the results confirm the bug:
Test Commands
Analysis
Custom Commands (NOT WORKING):
/helloand/testboth exist as.mdfiles in.claude/commands/Unknown slash commanderrorBuilt-in Command (Different Behavior):
/helpreturns a different error: "not a prompt-based command"Conclusion
✅ SlashCommand tool itself works
✅ Built-in commands are recognized
❌ Custom commands from
.claude/commands/are NOT loadedThis manual test confirms what the debug logs showed:
↑ Empty - zero custom commands registered despite 17 valid
.mdfiles existingThe command discovery/scanning mechanism is definitely not running in v2.0.22.
✅ Issue Resolved - Root Cause Identified
Status: Slash commands now loading correctly after configuration refactoring
---
🎯 Root Cause
The issue was caused by unsupported configuration options and overly restrictive tool patterns in
settings.local.jsonthat interfered with Claude Code's tool initialization and command discovery system.Primary Culprits
memory,parallelTools,outputStyle,statusLineblocksBash(git *),Bash(gh *),Task(general-purpose), etc..claude/commands/Memorytool andMultiEdittool---
🔧 Configuration Changes That Fixed It
❌ Broken Configuration
✅ Working Configuration
---
🔍 Key Changes
memory,parallelTools, etc.)Bash(git *))Memory,MultiEdit)permissions.allowsectioncontinueOnError: true)---
✅ Verification
After configuration fix:
/statusand other commands execute successfully---
💡 Recommendations for Claude Code Team
settings.local.jsonon startup--validate-configflag for testing---
📝 Workarounds Attempted (All Failed)
Before finding the config issue:
~/.claude/projects)None of these worked because the issue was in the configuration itself.
---
🎯 Takeaway
The issue was entirely configuration-based. Unsupported config blocks caused silent failures in the tool initialization process, which prevented slash commands from being discovered. Simplifying to documented configuration options resolved the issue immediately.
Platform: WSL2 (Linux)
Version: Claude Code 2.0.22
Resolution: Configuration refactoring (removed unsupported options)
Time to Resolution: ~4 hours of debugging
Hope this helps others encountering similar issues! 🎉
this was fixed by https://github.com/anthropics/claude-cli-internal/pull/8646 and in claude already. Please let me know if you can still repro. thanks
Claude Code VS-Code extension 2.0.25 is not seeing custom Slash commands for me on MacOS.. but the terminal CC does. @whyuan-cc
Same for me.
issue still persists. I tried to remove any Claude configs, started clean and still having this issue
In the mentioned above post, I have screenshots showing two projects with the same exact configs are loading differently in Claude Code. One is not reading the .claude folder or claude.md at all.
Up-to-date VS Code, latest Claude Code, and latest Claude Code extension.
<img width="1858" height="393" alt="Image" src="https://github.com/user-attachments/assets/e505cee3-e07a-4d52-a381-d6234b9da632" />
thanks for reporting. Let me take a look.
facing same issue with claude-code V2.0.28 cli in mac terminal [macOS 15.6.1] but works with VScode claude-code extension
having the latest version of the claude code (2.0.28) but suddenly and unfortunately all the global slash comments given via SYMLINKS are not recognized anymore. In the same time, I can use global slash commands when they are given via regular files - here for both terminal and IDE extensions.
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.