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
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

  1. Install/update Claude Code via npm on macOS
  2. Check permissions: ls -la ~/.nvm/versions/node/v20.19.3/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg
  3. Observe rw-r--r-- (no execute bit)
  4. 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 postinstall script 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

View original on GitHub ↗

4 Comments

Flamintus · 6 months ago

+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:

  • Custom agents, skills and commands silently disappear from /agents menu
  • Glob and Grep tools fail with EACCES errors
  • No visible error message to the user

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.

ericst-onge · 6 months ago

(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-executable rg binary, making this a guaranteed repro — no flaky timing or platform-specific conditions.

Dockerfile

FROM node:20
RUN npm install -g @anthropic-ai/claude-code
RUN useradd -m -s /bin/bash claude
RUN git config --system safe.directory '*'
WORKDIR /workspace
USER claude
ENTRYPOINT ["claude"]

Verify broken permissions

docker build -t claude-cli -f Dockerfile.claude .
docker run --rm --entrypoint bash claude-cli -c \
  "ls -la /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/*/rg"

Output:

-rw-r--r-- 1 root root 4658376 ... /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg

No execute bit.

Symptoms

  • Custom skills from .claude/commands/ don't appear in autocomplete
  • Invoking them manually returns Unknown skill: <name>
  • No user-facing error — skills silently don't load
  • CLAUDE.md, git operations, and everything else work fine, making it very hard to diagnose

Debug evidence

Running with --debug --debug-to-stderr reveals the problem:

[DEBUG] Loading skills from: managed=/etc/claude-code/.claude/skills, user=/home/claude/.claude/skills, project=[]
[DEBUG] Loaded 0 unique skills (0 unconditional, 0 conditional, managed: 0, user: 0, project: 0, additional: 0, legacy commands: 0)
...
[ERROR] Error: spawn .../vendor/ripgrep/arm64-linux/rg EACCES

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 with EACCES, the error is caught internally, and an empty array is returned — zero skills loaded, zero diagnostics shown to the user.

Workaround

RUN npm install -g @anthropic-ai/claude-code \
    && chmod +x /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/*/rg

Note on silent failure

Even with --debug --debug-to-stderr, the EACCES error 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 disabled would have saved hours of investigation.

Environment: Claude Code v2.1.89, Docker with node:20 base image (Debian), arm64-linux.

ashwin-ant collaborator · 6 months ago

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.

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