Tiny install script that sets up Claude Code on FreeBSD by running Anthropic's own Linux x64 binary under Linuxulator. This is just an automated version of the workaround Anthropic's ant-kurt posted on issue #30640:
Starting with Claude Code 2.1.101, you can run Claude Code under Linuxulator with this additional env var:
BUN_JSC_useBBQJIT=0 claude.
This is a temporary workaround. The real fix is a native FreeBSD Bun build (work-in-progress upstream at oven-sh/bun#1524 / lwhsu/bun's claude/freebsd-support branch). Once that lands, this repo becomes obsolete.
curl -fsSL https://raw.githubusercontent.com/8ff/claude-code-freebsd/main/install.sh | shTested on FreeBSD 15 amd64. Should also work on FreeBSD 13.2+ / 14.x amd64 as long as linux_base-rl9 (glibc 2.34) is in your pkg repo — older linux_base-c7 (glibc 2.17) is too old for Bun's Linux binary. On first run, if Linuxulator isn't fully set up, the script prints the doas commands you need to run and exits; it never runs privileged commands on your behalf. On FreeBSD 15 you usually only need doas pkg install -y linux_base-rl9 because the Linux ABI is compiled into the GENERIC kernel; on 13/14 you may also need doas kldload linux64 and doas service linux start.
The script downloads ~230 MB from Anthropic's CDN, verifies sha256 against their signed manifest, installs the binary to ~/.local/share/claude/claude-linux-x64, and drops a wrapper at ~/.local/bin/claude that sets BUN_JSC_useBBQJIT=0 automatically.
After install, open a new shell and run claude.
rm -f ~/.local/bin/claude ~/.local/share/claude/claude-linux-x64
rm -rf ~/.claude ~/.claude.json ~/.cache/claude-cli-nodejsAnthropic's Claude Code binary is their proprietary software and is not stored in this repo. The install script downloads it directly from Anthropic's own CDN at install time. Use is subject to Anthropic's Commercial Terms.
The scripts and docs in this repo are GPL v3 (LICENSE).
- ant-kurt at Anthropic — for publishing the
BUN_JSC_useBBQJIT=0flag on issue #30640. This repo exists because of that comment. - Li-Wen Hsu (@lwhsu) — for driving the actual native port upstream.