[BUG] Native Windows binary (Bun Canary v1.3.9) segfaults on ~50% of launches
I've been using Claude Code on Windows for a while. I originally had it installed via npm and it worked great. At some point I was prompted to switch to the native binary, so I did, and it's been a toss up ever since.
About half the time I launch claude, I get this:
Bun Canary v1.3.9-canary.62 (6d2fefba) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\<user>\.local\bin\claude.exe" "--resume" "<session-id>"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(7) jsc spawn(28) standalone_executable yaml_parse(38)
Elapsed: 2910ms | User: 921ms | Sys: 562ms
RSS: 0.51GB | Peak: 0.51GB | Commit: 0.69GB | Faults: 132831
panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Environment:
- Windows 11 (build 26200, x64)
- Claude Code v2.1.42
- Bundled Bun Canary v1.3.9-canary.62
- Installed via native PowerShell installer
- 23.9GB RAM
Steps to reproduce:
- Install Claude Code via native installer on Windows 11
- Run claude or claude --resume
- Crashes roughly half the time with the segfault above. No consistent pattern.
What works:
- npm install -g @anthropic-ai/claude-code (Node.js runtime) has no crashes
I'm far from the first person to hit this. There's a trail of Windows native binary issues going back months: #11201, #18567, #9261, #18273, #24584. Even the Bun creator recommended npm as the workaround in #11201.
The native binary bundles a canary Bun build and users can't swap it out since it's embedded in claude.exe. So when the bundled Bun has a bug on Windows, there's nothing we can do except wait for a new release.
I switched away from something that worked because I was told it was being deprecated in favor of something better, and now my experience is significantly worse.
It would be great to not deprecate npm on Windows until the native binary actually works reliably, and to ship a stable Bun build instead of canary. Also when the native binary crashes, it would help to mention alternative install methods as a fallback instead of just showing a Bun crash report link.
Workaround for anyone else: npm install -g @anthropic-ai/claude-code runs on Node.js instead of Bun. No more crashes.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗