[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.
This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗