[BUG] [Windows] Claude Code crashes with segfault after ~9 min — canary Bun embedded in auto-updated claude.exe
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code crashes after ~9 minutes with a segmentation fault originating from Bun v1.3.9-canary.62, which is bundled inside the auto-updated claude.exe — not the system-level Bun installation.
Important: Setting release_channel = "stable" in .bunfig.toml does not prevent this crash. That config only governs the system-level Bun CLI. It has no effect on the Bun runtime embedded in claude.exe itself. Users cannot self-protect through .bunfig.toml.
What Should Happen?
Claude Code should remain stable indefinitely. If auto-updates are enabled, they should only pull builds containing a stable (non-canary) embedded Bun runtime.
Error Messages/Logs
panic(main thread): Segmentation fault at address 0x18
**Resource state at crash:**
- Elapsed: 523 seconds (~9 min)
- RAM: 0.75 GB (peak: 0.76 GB)
- Total committed: 1.03 GB
- Page faults: 827,052 (critically high — indicates memory thrashing)
**Additional MCP error contributing to instability (secondary):**
JSON Parse error: Single quotes (') are not allowed in JSON [repeated 150+ times]
JSON Parse error: Expected ']'
JSON Parse error: Unexpected identifier "toolName"
These came from n8n MCP v2.30.2 (known bug, separate issue) and contributed to cascade failures.
Steps to Reproduce
- Allow Claude Code to auto-update on Windows (auto-updater pulls canary Bun)
- Start a session with MCP servers configured
- Run the session for 9–15 minutes
Result: panic(main thread): Segmentation fault at address 0x18
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Prior to the auto-update that bundled Bun v1.3.9-canary.62
Claude Code Version
2.1.x
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
System Information
- Claude Code version at crash: 2.1.x (auto-updated; current stable is 2.1.45, no canary detected)
- Embedded Bun version at crash: v1.3.9-canary.62
- Last working version: Prior to the auto-update that bundled Bun v1.3.9-canary.62
- OS: Windows 11 Home, Build 26100
- RAM: 14.88 GB
- Shell: bash (Claude Code embedded)
- API platform: Anthropic
Current Workaround
Added DISABLE_AUTOUPDATER=1 to ~/.claude/settings.json to prevent further auto-updates from pulling canary builds. This is temporary — the permanent fix requires pinning the embedded runtime to stable Bun releases in the build pipeline.
Additional Context
0x18 is a near-null pointer dereference, consistent with a use-after-free or uninitialized struct access in Bun's memory allocator — a known category of issue in canary/experimental Bun builds on Windows.
Request:
- Pin the embedded Bun runtime to stable releases in the
claude.exebuild pipeline - Clarify in docs that
.bunfig.tomldoes not govern the embedded runtime (to prevent user confusion) - Communicate in release notes when a stable embedded Bun version ships, so users with
DISABLE_AUTOUPDATER=1know it's safe to re-enable
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗