[BUG] [Linux] Bundled ripgrep binary missing execute permission — silently breaks all user commands/skills

Resolved 💬 5 comments Opened Mar 31, 2026 by CryptVenture Closed Apr 18, 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?

Bug Report: Bundled ripgrep binary loses execute permission, silently breaks user commands/skills

Summary

The bundled ripgrep binary at vendor/ripgrep/x64-linux/rg inside the Claude Code npm package has its execute permission stripped (-rw-r--r-- instead of -rwxr-xr-x). This causes all user-defined commands in ~/.claude/commands/ to silently fail to load, returning "Unknown skill" for every user command.

Environment

  • Claude Code version: 2.1.88
  • Platform: Linux x86_64 (Ubuntu, kernel 6.17.0-19-generic)
  • Node: v24.1.0 (installed via nvm)
  • Install method: npm global (@anthropic-ai/claude-code)
  • Shell: bash

Steps to Reproduce

  1. Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
  2. Create user commands in ~/.claude/commands/ (e.g. ~/.claude/commands/my-command.md)
  3. Launch Claude Code and try to invoke the command with /my-command

Expected Behavior

The command should load and execute normally.

Actual Behavior

Claude Code returns:

Unknown skill: my-command

All user commands from ~/.claude/commands/ are invisible. Plugin skills and built-in commands work fine.

Root Cause Analysis

Traced through the minified source (cli.js) to identify the exact failure chain:

  1. $s1 (skill loader) calls voz() to load legacy commands from ~/.claude/commands/
  2. voz calls ii("commands", projectRoot) which calls vh1() to scan for .md files
  3. vh1 invokes the bundled ripgrep binary with --files --hidden --follow --no-ignore --glob *.md
  4. Ripgrep fails silently with EACCES (permission denied) because the binary at vendor/ripgrep/x64-linux/rg has mode 644 instead of 755
  5. vh1 catches the error and returns an empty array []
  6. Zero user commands are loaded — the debug log confirms:

``
Ripgrep first use test: FAILED (mode=builtin, path=.../vendor/ripgrep/x64-linux/rg)
Loaded 0 unique skills (managed: 0, user: 0, project: 0, legacy commands: 0)
``

  1. Any /command invocation hits the "Unknown skill" code path

Evidence from Debug Logs

2026-03-31T11:44:42.314Z [DEBUG] Ripgrep first use test: FAILED (mode=builtin, path=/root/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg)
2026-03-31T11:44:42.244Z [DEBUG] Loading skills from: managed=/etc/claude-code/.claude/skills, user=/root/.claude/skills, project=[]
2026-03-31T11:44:42.294Z [DEBUG] Loaded 0 unique skills (0 unconditional, 0 conditional, managed: 0, user: 0, project: 0, additional: 0, legacy commands: 0)
2026-03-31T11:44:42.670Z [DEBUG] getSkills returning: 0 skill dir commands, 52 plugin skills, 8 bundled skills, 0 builtin plugin skills

File Permission State

$ ls -la .../vendor/ripgrep/x64-linux/rg
-rw-r--r-- 1 root root 5621616 Mar 31 11:58 rg    # <-- missing +x

$ file .../vendor/ripgrep/x64-linux/rg
rg: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), static-pie linked, stripped

Workaround

chmod +x "$(dirname "$(readlink -f "$(which claude)")")/../lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg"

Or directly:

chmod +x ~/.nvm/versions/node/v24.1.0/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg

After applying the fix, all user commands load correctly and "Unknown skill" errors are resolved.

Suggested Fixes

  1. npm package: Ensure the ripgrep binary has execute permission set in the published tarball (npm preinstall/postinstall script or correct file modes in the package)
  2. Runtime fallback: When the bundled ripgrep fails its first-use test, vh1 could fall back to Node's native fs.readdir (recursive) with a .md glob filter instead of returning an empty array. The CLAUDE_CODE_USE_NATIVE_FILE_SEARCH env var path already exists in the code but isn't triggered on ripgrep failure.
  3. User-visible warning: The ripgrep failure is logged at [DEBUG] level only. When it causes zero user commands to load, a [WARN] or user-facing message would help with diagnosis (e.g. "Ripgrep unavailable: user commands may not load. Run chmod +x ... to fix.")

Impact

  • Severity: High — all user-defined slash commands silently stop working
  • Scope: Likely affects any Linux install via npm where file permissions are not preserved (root installs, certain npm versions, Docker containers)
  • User experience: No error message at startup; users only discover the problem when they try to use a command. The "Unknown skill" error gives no hint about the actual cause (a permissions issue on an internal binary).

Additional Notes

  • The fix at v2.1.76 ("Fixed slash commands showing Unknown skill") may have been a different manifestation of this same underlying issue, or a separate bug. The permission problem persists through v2.1.88.
  • Plugin skills are unaffected because they use a different loading path (kH6) that reads manifest files directly rather than scanning directories with ripgrep.
  • The ~/.claude/skills/ directory (new format) would also be affected since mL6 uses the same ripgrep-based scanning, but .claude/skills/ is a newer convention and fewer users have commands there yet.

What Should Happen?

User-defined commands in ~/.claude/commands/ and ~/.claude/skills/ should load regardless of whether the bundled ripgrep binary is executable. At minimum, a user-visible warning should appear at startup when ripgrep fails and command scanning is degraded.

Error Messages/Logs

Steps to Reproduce

  1. Install Claude Code globally on Linux via npm (npm i -g @anthropic-ai/claude-code)
  2. Check the ripgrep binary permissions: ls -la "$(dirname "$(readlink -f "$(which

claude)")")/../lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg" —
it will show -rw-r--r-- (no execute bit)

  1. Create any user command: mkdir -p ~/.claude/commands && echo -e "---\nname:

test\ndescription: test command\n---\nSay hello" > ~/.claude/commands/test.md

  1. Launch Claude Code and type /test
  2. Observe: Unknown skill: test
  3. Fix permissions: chmod +x .../vendor/ripgrep/x64-linux/rg
  4. Restart Claude Code, type /test — now it works

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.88

Platform

Anthropic API

Operating System

Ubuntu Linux 24.04

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗