[BUG] Custom slash commands not executable via /command syntax in v2.x (regression from v1.0.112)
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?
Custom slash commands placed in .claude/commands/ are loaded into the SlashCommand Tool context but cannot be executed by typing /commandname directly. This is a regression - the same commands work correctly in v1.0.112.
Environment:
Claude Code version: 2.0.55
Node.js version: v22.20.0
OS: Linux (WSL2) - Linux JS-NB-22042 6.6.87.2-microsoft-standard-WSL2
Shell: bash
Steps to Reproduce:
Create a simple slash command:
bashmkdir -p .claude/commands
cat > .claude/commands/hello.md << 'EOF'
---
description: Test command
---
Say hello!
EOF
2. Start Claude Code: `claude`
3. Check `/context` - shows `SlashCommand Tool · 1 commands`
4. Type `/hello` - returns `Unknown slash command: hello`
5. Type `/help` and navigate to custom-commands tab - shows `No custom commands found`
6. Ask Claude: "Run the /hello command" - **WORKS** (Claude executes it via SlashCommand tool)
**Expected Behavior:**
- `/hello` should execute the command directly (as it does in v1.0.112)
- `/help` should list custom commands
- Tab completion after `/` should show custom commands
**Actual Behavior:**
- `/hello` returns "Unknown slash command"
- `/help` shows "No custom commands found"
- Tab completion only shows built-in commands
- BUT asking Claude to "run /hello" works (commands ARE loaded into context)
**Debug Log Evidence:**
[DEBUG] SlashCommand Tool · 4 commands # Commands ARE loaded
[DEBUG] Slash commands included in SlashCommand tool: # But this line is EMPTY
[DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results # ripgrep abort
[ERROR] AbortError: The operation was aborted # Timeout?
Workaround:
Use v1.0.112: npx @anthropic-ai/claude-code@1.0.112
Or ask Claude to run commands instead of typing them directly
Additional Context:
The rg (ripgrep) command works fine manually in the same directory
Issue occurs in fresh directories without spaces in path (tested in /tmp/testclaude)
Skills (.claude/skills/) load and work correctly - only slash commands affected
File this at: https://github.com/anthropics/claude-code/issues
What Should Happen?
Custom slash commands in .claude/commands/ should be executable by typing /commandname directly, just like they work in v1.0.112.
/hello should execute the command
/help custom-commands tab should list my commands
Tab completion after / should show custom commands
Error Messages/Logs
/hello should execute the command
/help custom-commands tab should list my commands
Tab completion after / should show custom commands
Error Messages/Logs
Debug log (claude --debug):
2025-11-29T16:59:39.377Z [DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results
2025-11-29T16:59:39.395Z [ERROR] AbortError: AbortError: The operation was aborted
at abortChildProcess (node:child_process:750:27)
at AbortSignal.onAbortListener (node:child_process:820:7)
...
2025-11-29T16:59:53.082Z [DEBUG] Skills and commands included in Skill tool: hello
2025-11-29T16:59:53.083Z [DEBUG] Slash commands included in SlashCommand tool:
Note: The ripgrep call is being aborted, and "Slash commands included in SlashCommand tool:" line is EMPTY even though commands exist. However, asking Claude to "Run the /hello command" WORKS - commands are loaded into context but not registered for direct / execution.
Steps to Reproduce
Create a fresh test directory with a minimal slash command:
bashcd /tmp
rm -rf test-slash-bug
mkdir -p test-slash-bug/.claude/commands
cat > test-slash-bug/.claude/commands/hello.md << 'EOF'
---
description: A simple test command
---
Say hello to the user!
$ARGUMENTS
EOF
cd test-slash-bug
Start Claude Code v2.0.55:
bashclaude
3. Type `/hello` and press Enter:
/hello
Unknown slash command: hello
4. Check `/help` → tab to `custom-commands`:
No custom commands found
5. Check `/context` - note it shows commands ARE loaded:
SlashCommand Tool · 1 commands
6. Ask Claude to run the command (this WORKS):
Run the /hello command The "hello" skill is running
[Claude executes the command successfully]
Exit and test with v1.0.112 - same directory, same command file:
bashnpx @anthropic-ai/claude-code@1.0.112
/hello
[Works correctly - command executes]
Summary: Commands load into SlashCommand Tool context (visible in /context) and Claude CAN execute them when asked, but typing /commandname directly fails. Same commands work in v1.0.112.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
1.0.112
Claude Code Version
2.0.55 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Debug log analysis (claude --debug):
The ripgrep call that scans for slash commands is being aborted before completion:
2025-11-29T16:59:39.377Z [DEBUG] rg error (signal=undefined, code=ABORT_ERR, stderr: ), 0 results
2025-11-29T16:59:39.395Z [ERROR] AbortError: AbortError: The operation was aborted
This happens even though ripgrep works fine manually:
bash$ ~/.claude/local/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg --files ".claude/commands/"
.claude/commands/hello.md
**Key debug log lines showing the disconnect:**
[DEBUG] Skills and commands included in Skill tool: hello # ← Loaded as skill
[DEBUG] Slash commands included in SlashCommand tool: # ← EMPTY - nothing registered
Commands ARE being loaded (they work when Claude invokes them), but they're not being registered for direct /command execution - likely because the ripgrep scan that populates the slash command registry is aborting.
Environment details:
Platform: WSL2 on Windows 11
Tested in paths with spaces (/mnt/c/Users/.../OneDrive - Tangent IT Solutions/...) AND without spaces (/tmp/testclaude) - same behavior
Fresh npm install of Claude Code
No custom plugins or MCP servers (tested in clean directory)
Confirmed working in v1.0.112, broken in v2.0.55 (and likely other v2.x versions based on similar GitHub issues mentioning ripgrep/rg errors).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗