Bundled ripgrep binary loses execute permission on macOS (breaks command/skill discovery)
Status Fixed / completed
Reported on v2.1.89
Maintainer reply ✓ Yes — ashwin-ant
Workaround ✓ Mentioned in thread ↓
Activity 4 comments · opened Apr 1, 2026 · closed Apr 18, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator)
responded on this thread — see the highlighted reply below.
Bug Description
After updating Claude Code (observed on v2.1.89 via nvm/npm), the bundled ripgrep binary at vendor/ripgrep/arm64-darwin/rg is installed with 644 (rw-r--r--) permissions instead of 755 (rwxr-xr-x). This causes command and skill discovery to silently fail — / slash commands from .claude/commands/ and .claude/skills/ are not listed or invocable.
Environment
- Claude Code version: 2.1.89
- OS: macOS (Darwin 25.0.0, Apple Silicon)
- Node: v20.19.3 (installed via nvm)
- Install method:
npm install -g @anthropic-ai/claude-code
Steps to Reproduce
- Install/update Claude Code via npm on macOS
- Check permissions:
ls -la ~/.nvm/versions/node/v20.19.3/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg - Observe
rw-r--r--(no execute bit) - Try to use
/commands — custom commands/skills are not discovered
Debug Log Evidence
From ~/.claude/debug/*.txt:
2026-04-01T14:46:00.566Z [DEBUG] Ripgrep first use test: FAILED (mode=builtin, path=/Users/.../@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg)
2026-04-01T14:46:01.091Z [ERROR] Error: Error: spawn /Users/.../@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg EACCES
at ChildProcess._handle.onexit (node:internal/child_process:285:19)
at onErrorNT (node:internal/child_process:483:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Impact
- All custom command and skill discovery silently fails
- No user-visible error — commands simply don't appear in
/menu - Same version (2.1.89) works correctly on a remote Linux host (different binary path, correct permissions)
Workaround
chmod +x ~/.nvm/versions/node/v20.19.3/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg
Then restart Claude Code.
Suggested Fix
- Ensure the npm package sets execute permissions on vendor binaries via a
postinstallscript or by preserving file modes in the tarball - Consider adding a startup warning when the bundled ripgrep fails its first-use test, rather than silently degrading
4 Comments
+1
Confirmed on Linux VM running with HyperV on Win11 (Debian 13, x64) — not macOS-only
Same issue here on a fresh npm install -g @anthropic-ai/claude-code@2.1.89 on Debian (ext4 filesystem). The bundled vendor/ripgrep/x64-linux/rg binary is installed with 644 permissions instead of 755.
Symptoms:
Quick fix (breaks after every update):
chmod +x $(dirname $(which claude))/../lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/x64-linux/rg
⚠️ This needs to be re-applied after every npm install -g @anthropic-ai/claude-code until the bug is fixed.
Permanent workaround — use system ripgrep:
Install ripgrep system-wide
sudo apt install ripgrep # Debian/Ubuntu
or: brew install ripgrep (macOS)
Tell Claude Code to use it
echo 'export USE_BUILTIN_RIPGREP=0' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc or source ~/.bashrc
This survives Claude Code updates — no need to chmod +x after every npm install -g.
(found and reproduced by Claude.ai - wow!)
Docker reproduction (100% reliable)
This is trivially reproducible in any Docker container using
npm install -g. Every fresh install produces a non-executablergbinary, making this a guaranteed repro — no flaky timing or platform-specific conditions.Dockerfile
Verify broken permissions
Output:
No execute bit.
Symptoms
.claude/commands/don't appear in autocompleteUnknown skill: <name>CLAUDE.md, git operations, and everything else work fine, making it very hard to diagnoseDebug evidence
Running with
--debug --debug-to-stderrreveals the problem:Internally,
baz()→Wr("commands", projectRoot)→OS1()correctly resolves the.claude/commands/directory and finds the files. But the subsequent gitignore-aware file scan via ripgrep fails withEACCES, the error is caught internally, and an empty array is returned — zero skills loaded, zero diagnostics shown to the user.Workaround
Note on silent failure
Even with
--debug --debug-to-stderr, theEACCESerror only appears much later in the log (associated with plugin refresh timing, not the skill loading phase). The skill scan catches the error and returns[]with no diagnostic at all. A startup warning like⚠ Bundled ripgrep not executable — skill discovery disabledwould have saved hours of investigation.Environment: Claude Code v2.1.89, Docker with
node:20base image (Debian),arm64-linux.This was fixed in v2.1.91 — The bundled ripgrep binary now ships with execute permissions on macOS, restoring command and skill discovery. If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.
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.