Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / Bun segmentation fault (Windows)
Fix · Claude Code · Windows

Claude Code on Windows: Segmentation fault / Bun has crashed

Fix: move off the crashing build. Run claude update. If it still crashes, switch to the stable release channel, or install the last version that worked, for example & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) <version> (the last one that worked for you), and turn off auto-updates until a fixed version ships.

At a glance
Errorpanic(main thread): Segmentation fault at address 0x... and oh no: Bun has crashed. This indicates a bug in Bun, not your code.
Desktop appClaude Code process exited with code 3
ToolClaude 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)
Fixclaude update; else "autoUpdatesChannel": "stable", or install a specific version and set DISABLE_AUTOUPDATER
Last working version2.1.326, reported by users in #112842 and #110950 (not official)
StatusNo Anthropic reply on these issues as of 4 Dec 2026
Checked4 Dec 2026, against the sources listed below

Fix it

  1. Update first. A newer build may not have the crash (install commands and PATH fixes: Install Claude Code on Windows):
    claude update
  2. 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:
    {
      "autoUpdatesChannel": "stable"
    }
    A native install then moves to the stable version even if it is older than yours.
  3. Or install the last version that worked for you. In PowerShell:
    & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) <version>
    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 claude --version.
  4. Stop auto-update from bringing the crash back. In settings.json:
    {
      "env": {
        "DISABLE_AUTOUPDATER": "1"
      }
    }
    claude doctor should then show Auto-updates as disabled (set by env: DISABLE_AUTOUPDATER). Remove it once a fixed version is out, so you don't miss security fixes.
  5. 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 x64 header, then panic(...): Segmentation fault at address ....
  • Or, in the desktop app, the Code tab shows "Claude Code crashed" and %LOCALAPPDATA%\Claude\logs\main.log has Claude Code process exited with code 3 followed 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

Sources

Read 4 Dec 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools