Skip to content

ScottyBam/claude-code-asahi-fix

Repository files navigation

Claude Code — vendored ripgrep fix for 16k page kernels (Asahi Linux)

Claude Code ships a pre-built arm64-linux ripgrep binary that crashes immediately on kernels using a 16k page size, including the Asahi Linux kernel for Apple Silicon Macs.

Signal: 6 (ABRT)
<jemalloc>: Unsupported system page size
memory allocation of 160 bytes failed

This fix replaces the vendored binary permanently using a systemd bind mount, so the system rg (installed via your package manager) is always used instead. The mount survives reboots and Claude Code updates.

Requirements

  • ripgrep installed via your package manager (e.g. sudo dnf install ripgrep)
  • systemd

Install

1. Replace the vendored binary with your system rg (needed before the mount can attach):

sudo cp /usr/bin/rg /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg

2. Get the correct unit filename — the filename must exactly match the escaped mount path:

systemd-escape -p --suffix=mount /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg

This outputs the required filename. Copy the .mount file in this repo to /etc/systemd/system/ using that exact name:

sudo cp *.mount /etc/systemd/system/

3. Enable and start:

sudo systemctl daemon-reload
sudo systemctl enable --now "$(systemd-escape -p --suffix=mount /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg)"

4. Verify:

/usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg --version
# ripgrep 14.x.x  ← should show your system version, not crash

How it works

A bind mount overlays /usr/bin/rg on top of the vendored binary at the filesystem level. npm/node cannot overwrite a bind mount, so Claude Code updates leave it intact.

When your system rg is updated via the package manager, the mount automatically reflects the new version — no action needed.

Known limitation: npm atomic updates

npm performs package installs atomically by renaming the old package directory before placing the new one (e.g. claude-code.claude-code-XXXXXX). When this happens, the bind mount follows the renamed directory's inode rather than the new install path, leaving the new vendored rg exposed until the mount is restarted.

After a Claude Code update, if you see the crash again:

# Replace the binary in the new install
sudo cp /usr/bin/rg /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg

# Restart the mount
sudo systemctl restart "$(systemd-escape -p --suffix=mount /usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg)"

Tested on

  • Fedora Asahi Remix 42, aarch64, 16k page kernel
  • Apple M1 MacBook Pro

About

Fix Claude Code vendored ripgrep crash on Asahi Linux (16k page kernel / Apple Silicon)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors