| Error | panic(main thread): Segmentation fault at address 0x... and oh no: Bun has crashed. This indicates a bug in Bun, not your code. |
|---|---|
| Desktop app | Claude Code process exited with code 3 |
| Tool | Claude Code on native Windows: CLI and the desktop app's Code tab. Reports name 2.1.321 to 2.1.332 (Bun 1.4.4 and 1.4.6) |
| Fix | claude update; else "autoUpdatesChannel": "stable", or install a specific version and set DISABLE_AUTOUPDATER |
| Last working version | 2.1.326, reported by users in #112842 and #110950 (not official) |
| Status | No Anthropic reply on these issues as of 4 Dec 2026 |
| Checked | 4 Dec 2026, against the sources listed below |
Fix it
- Update first. A newer build may not have the crash (install commands and PATH fixes: Install Claude Code on Windows):
claude update - Still crashing? Switch to the stable channel. Anthropic's docs say stable is "typically about one week old, skipping releases with major regressions". Add this to
%USERPROFILE%\.claude\settings.json, or set it in/config> Auto-update channel:
A native install then moves to the stable version even if it is older than yours.{ "autoUpdatesChannel": "stable" } - Or install the last version that worked for you. In PowerShell:
Users in #112842 and #110950 reported 2.1.326 working where 2.1.330 and 2.1.332 crashed. Use the version that last worked on your machine. Check it with& ([scriptblock]::Create((irm https://claude.ai/install.ps1))) <version>claude --version. - Stop auto-update from bringing the crash back. In
settings.json:{ "env": { "DISABLE_AUTOUPDATER": "1" } }claude doctorshould then showAuto-updatesasdisabled (set by env: DISABLE_AUTOUPDATER). Remove it once a fixed version is out, so you don't miss security fixes. - Resume your work with
claude --resume. One user noted the crash leaves the terminal in mouse-tracking mode, so moving the mouse prints junk like[<35;40;12M. Open a new terminal window if that happens.
Why it happens
Claude Code ships as one executable built on the Bun runtime. These crashes happen inside Bun or its JavaScript engine, not in your project, which is what "This indicates a bug in Bun, not your code" means. Users narrowed them to specific builds: one reporter says the crash started after the auto-update to 2.1.332 (Bun 1.4.6), even with a fresh config folder, and went away on 2.1.326. A fresh CLAUDE_CONFIG_DIR didn't help, so deleting your settings won't fix it either.
How to check it's this crash
- The terminal prints a
Bun v1.4.x ... Windows x64header, thenpanic(...): Segmentation fault at address .... - Or, in the desktop app, the Code tab shows "Claude Code crashed" and
%LOCALAPPDATA%\Claude\logs\main.loghasClaude Code process exited with code 3followed by the Bun panic lines. - Note the version (
claude --version) and whether it crashes at startup, mid-turn or while idle. Reports differ, and the version is what matters for the fix.
Related Windows crash codes reported in the same weeks, with different signatures: Illegal instruction in Bun 1.4.6 (#113032), exit 0xC0000374 heap corruption (#113199) and exit 3221226505 / 0xC0000409 (#113128). The version steps above are the same.
Desktop app note
The desktop app's Code tab runs the Claude Code version bundled with the app (reports name 2.1.330 inside desktop 6.28899.x). The CLI steps above change the CLI only. For the desktop app, report the crash with the panic lines from main.log on github.com/anthropics/claude-code.
Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review
FAQ
What does 'oh no: Bun has crashed' mean in Claude Code?
Claude Code runs on the Bun runtime, and Bun itself crashed. It's a bug in that Claude Code build, not in your code or settings.
How do I go back to an older Claude Code version on Windows?
In PowerShell: & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) followed by the version number that last worked for you. Then set DISABLE_AUTOUPDATER to 1 in settings.json so it doesn't update straight back.
Which version doesn't crash?
Users reported 2.1.326 working where 2.1.330 and 2.1.332 crashed. Anthropic hasn't confirmed a fixed version as of 4 Dec 2026.
What is the stable channel?
A release channel that serves a version typically about one week old and skips releases with major regressions. Set "autoUpdatesChannel": "stable" in settings.json or in /config.
Related errors
- Claude Code not working in VS Code
- Claude Code: Failed to authenticate / 403
- Claude Code: usage limit reached
Sources
Read 4 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.
- Claude Code docs: advanced setup (install a specific version, release channels, disable auto-updates): code.claude.com/docs/en/setup
- anthropics/claude-code #112842 (2.1.332 / Bun 1.4.6 segfault; 2.1.326 works): github.com/anthropics/claude-code/issues/112842
- anthropics/claude-code #110950 (Bun segfault, exit code 3; 2.1.325/2.1.326/2.1.328 ran without it): github.com/anthropics/claude-code/issues/110950
- anthropics/claude-code #112895 (desktop app, 115 crashes, main.log lines): github.com/anthropics/claude-code/issues/112895
- anthropics/claude-code #113031 (idle SIGSEGV, 2.1.321 / Bun 1.4.4): github.com/anthropics/claude-code/issues/113031
- anthropics/claude-code #113032 (Illegal instruction, Bun 1.4.6): github.com/anthropics/claude-code/issues/113032
- anthropics/claude-code #113199 (0xC0000374, terminal left in mouse-tracking mode): github.com/anthropics/claude-code/issues/113199
- reviewready CLI: one command that checks an AI app repo before it ships
- Exposed API key checker: find API keys committed to a repo or shipped to the browser
- CLAUDE.md security check: find risky instructions in agent rules files