[Bug] Slash Commands Fail to Execute Properly

Status Closed — not planned
Maintainer reply None cached
Activity 11 comments · opened Sep 26, 2025 · closed Jan 9, 2026

Bug Description
slash commands aren't working!

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 1.0.127
  • Feedback ID: 58fdbcd2-c179-4ab7-82df-1027ba7afcd6

Errors

[{"error":"SyntaxError: Unexpected token 'H', \"Here's a d\"... is not valid JSON\n    at JSON.parse (<anonymous>)\n    at file:///Users/k/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:746:9932\n    at Q (file:///Users/k/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:713:13287)\n    at hT2 (file:///Users/k/.claude/local/node_modules/@anthropic-ai/claude-code/cli.js:1670:1769)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)","timestamp":"2025-09-26T18:39:56.198Z"}]

View original on GitHub ↗

11 Comments

github-actions[bot] · 11 months ago

---

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8201
  2. https://github.com/anthropics/claude-code/issues/7746
  3. https://github.com/anthropics/claude-code/issues/7147

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

---

trav · 11 months ago

@khromov What is the output of claude --version? Do you have more specific steps to reproduce, like which slash command?

khromov · 11 months ago

@trav The version is 1.0.127. It's very simple to reproduce:

  1. Run claude mcp add --transport http --scope project svelte-llm https://svelte-llm.stanislav.garden/mcp/mcp
  2. Run claude
  3. Type /svelte-llm and tab to fill in any of the suggested resources
  4. Press enter and you get Unknown slash command: svelte-llm:Svelte almost like it can't handle spaces correctly, the name of the command gets cut off

This has worked before and broke maybe 1-2 months ago.

mg-dev25 · 11 months ago

Had the same problem - custom commands AND agents not showing up in /help even though search was working.

Found the culprit was my ripgrep config. I had --color=always in my ~/.ripgreprc which was embedding ANSI color codes in file paths during Claude Code's
discovery process. It was trying to read files like [0m[1m[32m/path/to/command.md[0m instead of the actual path.

Fixed it by changing --color=always to --color=auto in my ripgrep config. Still get colors in terminal but Claude Code gets clean paths for file
discovery.

Worth checking if you have custom ripgrep settings - might be the same issue.

khromov · 11 months ago

@mg-dev25 Do the repro instructions I posted work correctly for you?

The only thing I'm using is Oh My Zsh, but even starting a new terminal from sh and launching claude does not solve the issue.

mg-dev25 · 11 months ago

@khromov Do you have ripgrep install on your system, Claude code are using it if he found it and this cause a lot of issue.
Did the issue happen only in VSCode ? What if you run Claude code in a normal terminal ?

Can you run claude --debug to see what if he found a particular issues?

khromov · 11 months ago

I do not have ripgrep/rg installed:

➜  tmp rg
zsh: command not found: rg
➜  tmp ripgrep
zsh: command not found: ripgrep

The error happens on both mac terminal and vscode terminal.

Running with --debug flag and reading /Users/k/Library/Logs/claude-cli-nodejs/-Users-k/debug-logs/debug.txt does show some ripgrep stuff, but it seems that it ultimately fails and doesn't use it? Also I cant' see the actual original error (which seemed to be a JSON parsing issue: SyntaxError: Unexpected token 'H', \"Here's a d\"... is not valid JSON). So I am not convinced this has to do with ripgrep but rather that Claude seems to mess up the JSON encoding.

[DEBUG] Ripgrep first use test: PASSED (mode=builtin, path=/Users/k/.claude/local/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg)
[DEBUG] rg error (signal=undefined, code=ERR_CHILD_PROCESS_STDIO_MAXBUFFER, stderr: rg: /Users/k/Library/Caches/com.apple.ap.adprivacyd: Operation not permitted (os error 1)
cat debug.txt 
[DEBUG] Watching for changes in setting files /Users/k/.claude/settings.json, /Users/k/.claude/settings.json...
[DEBUG] Writing to temp file: /Users/k/.claude.json.tmp.40398.1759089487849
[DEBUG] Preserving file permissions: 100644
[DEBUG] Temp file written successfully, size: 409188 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/k/.claude.json.tmp.40398.1759089487849 to /Users/k/.claude.json
[DEBUG] File /Users/k/.claude.json written atomically
[DEBUG] Found 0 plugins (0 enabled, 0 disabled)
[DEBUG] Creating shell snapshot for zsh (/bin/zsh)
[DEBUG] Looking for shell config file: /Users/k/.zshrc
[DEBUG] Snapshots directory: /Users/k/.claude/shell-snapshots
[DEBUG] Creating snapshot at: /Users/k/.claude/shell-snapshots/snapshot-zsh-1759089487933-t3ynj5.sh
[DEBUG] Shell binary exists: true
[DEBUG] Execution timeout: 10000ms
[DEBUG] Writing to temp file: /Users/k/.claude/todos/42cbbdb4-149c-4a7a-9734-b39bd8c8ed69-agent-42cbbdb4-149c-4a7a-9734-b39bd8c8ed69.json.tmp.40398.1759089487934
[DEBUG] Temp file written successfully, size: 2 bytes
[DEBUG] Renaming /Users/k/.claude/todos/42cbbdb4-149c-4a7a-9734-b39bd8c8ed69-agent-42cbbdb4-149c-4a7a-9734-b39bd8c8ed69.json.tmp.40398.1759089487934 to /Users/k/.claude/todos/42cbbdb4-149c-4a7a-9734-b39bd8c8ed69-agent-42cbbdb4-149c-4a7a-9734-b39bd8c8ed69.json
[DEBUG] File /Users/k/.claude/todos/42cbbdb4-149c-4a7a-9734-b39bd8c8ed69-agent-42cbbdb4-149c-4a7a-9734-b39bd8c8ed69.json written atomically
[DEBUG] Registered 0 hooks from 0 plugins
[DEBUG] Total plugin commands loaded: 0
[DEBUG] Ripgrep first use test: PASSED (mode=builtin, path=/Users/k/.claude/local/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg)
[DEBUG] rg error (signal=undefined, code=ERR_CHILD_PROCESS_STDIO_MAXBUFFER, stderr: rg: /Users/k/Library/Caches/com.apple.ap.adprivacyd: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/com.apple.homed: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/FamilyCircle: Operation not permitted (os error 1)
rg: /Users/k/Library/Messages: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/com.apple.containermanagerd: Operation not permitted (os error 1)
rg: /Users/k/Pictures/Photos Library.photoslibrary: Operation not permitted (os error 1)
rg: /Users/k/Pictures/Photo Booth Library: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/com.apple.Safari: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/CloudKit: Operation not permitted (os error 1)
rg: /Users/k/Library/Caches/com.apple.HomeKit: Operation not permitted (os error 1)
), 151983 results
[ERROR] RangeError: RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded
    at Socket.onChildStdout (node:child_process:484:14)
    at Socket.emit (node:events:508:28)
    at Socket.emit (node:domain:489:12)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
[DEBUG] Shell snapshot created successfully (182997 bytes)
[DEBUG] Writing to temp file: /Users/k/.claude.json.tmp.40398.1759089489016
[DEBUG] Preserving file permissions: 100644
[DEBUG] Temp file written successfully, size: 409188 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/k/.claude.json.tmp.40398.1759089489016 to /Users/k/.claude.json
[DEBUG] File /Users/k/.claude.json written atomically
[DEBUG] Writing to temp file: /Users/k/.claude.json.tmp.40398.1759089489030
[DEBUG] Preserving file permissions: 100644
[DEBUG] Temp file written successfully, size: 409188 bytes
[DEBUG] Applied original permissions to temp file
[DEBUG] Renaming /Users/k/.claude.json.tmp.40398.1759089489030 to /Users/k/.claude.json
[DEBUG] File /Users/k/.claude.json written atomically
[DEBUG] Cleaned up session snapshot: /Users/k/.claude/shell-snapshots/snapshot-zsh-1759089487933-t3ynj5.sh
mg-dev25 · 11 months ago

Claude code as built in ripgrep in its code. For me, I change the ENV to use the one on my system and use my ripgrep config not the build in config inside claude code. You can test installing it in your system and create a config file at the home dir to force color in auto. If rg fail he will not find your commands and agents

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