[BUG] [Linux] Bundled ripgrep binary missing execute permission — silently breaks all user commands/skills
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
- Install Claude Code via npm:
npm install -g @anthropic-ai/claude-code - Create user commands in
~/.claude/commands/(e.g.~/.claude/commands/my-command.md) - 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:
$s1(skill loader) callsvoz()to load legacy commands from~/.claude/commands/vozcallsii("commands", projectRoot)which callsvh1()to scan for.mdfilesvh1invokes the bundled ripgrep binary with--files --hidden --follow --no-ignore --glob *.md- Ripgrep fails silently with
EACCES(permission denied) because the binary atvendor/ripgrep/x64-linux/rghas mode644instead of755 vh1catches the error and returns an empty array[]- 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)
- Any
/commandinvocation 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
- npm package: Ensure the ripgrep binary has execute permission set in the published tarball (npm
preinstall/postinstallscript or correct file modes in the package) - Runtime fallback: When the bundled ripgrep fails its first-use test,
vh1could fall back to Node's nativefs.readdir(recursive) with a.mdglob filter instead of returning an empty array. TheCLAUDE_CODE_USE_NATIVE_FILE_SEARCHenv var path already exists in the code but isn't triggered on ripgrep failure. - 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. Runchmod +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 sincemL6uses 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
- Install Claude Code globally on Linux via npm (npm i -g @anthropic-ai/claude-code)
- 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)
- Create any user command: mkdir -p ~/.claude/commands && echo -e "---\nname:
test\ndescription: test command\n---\nSay hello" > ~/.claude/commands/test.md
- Launch Claude Code and type /test
- Observe: Unknown skill: test
- Fix permissions: chmod +x .../vendor/ripgrep/x64-linux/rg
- 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_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗