claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Bun v1.3.5 crashes on Windows with "integer does not fit in destination type" - prevents installation and startup

Open Dyl-M opened this issue 10 months ago • 41 comments

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 immediately on startup and during installation on Windows 11 with a Bun runtime panic: integer does not fit in destination type. This affects both running Claude Code and attempting fresh installs via the PowerShell installer script.

The crash occurs in the bundled Bun v1.3.5 runtime. This specific bug was fixed in Bun v1.3.6 (released January 13, 2026), which includes a fix for this exact error when reading files on Windows systems with limited memory or on network drives.

What Should Happen?

Claude Code should start normally and installation should complete without Bun crashes.

Error Messages/Logs

Bun v1.3.5 (1e86cebd) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\foo\.local\bin\claude.exe"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(33) jsc spawn(20) standalone_executable process_dlopen
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2" "node:diagnostics_channel"
Elapsed: 5272ms | User: 2390ms | Sys: 3390ms
RSS: 3.21GB | Peak: 3.22GB | Commit: 3.30GB | Faults: 797032 | Machine: 16.60GB

panic(thread 1552): integer does not fit in destination type
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Steps to Reproduce

  1. Run Claude Code on Windows 11: claude or attempt fresh install irm https://claude.ai/install.ps1 | iex
  2. Observe crash with Bun

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.9

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

  • Bundled Bun Version: 1.3.5 (needs to be upgraded from Claude Code itself)
  • Machine RAM: 16.60GB

Dyl-M avatar Jan 16 '26 12:01 Dyl-M

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/16691

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Jan 16 '26 12:01 github-actions[bot]

Not the same issue at all.

Dyl-M avatar Jan 16 '26 12:01 Dyl-M

I'm having the same issue!! HELP!

davistroy avatar Jan 17 '26 15:01 davistroy

I fixed it, but this is the nuclear option - don't blame me if you use this (Powershell 7):

Remove-Item -Recurse -Force "$env:USERPROFILE.claude"

davistroy avatar Jan 17 '26 15:01 davistroy

Same for me - unable to launch/update Claude on Windows.

Bun v1.3.5 (1e86cebd) Windows x64 (baseline)
panic(thread 10984): integer does not fit in destination type

mattroper avatar Jan 18 '26 09:01 mattroper

Same issue:

panic(thread 16352): integer does not fit in destination type

2026-01-18 13:12:28.237 [info] From claude: oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 
2026-01-18 13:12:28.238 [info] From claude: https://bun.report/1.3.5/e_11e86cebGugogCw+kiM65ioJgqpmMCYKERNEL32.DLLut0LCSntdll.dll4zijBA0eNoFwcENACAMAsBVWM1ENHyosXzc3js53LyYxYYrWApkTHbkEZWRd/gBNAAPKQ

Dovidc avatar Jan 18 '26 18:01 Dovidc

panic(thread 6124): integer does not fit in destination type oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team, please file a GitHub issue using the link below:

https://bun.report/1.3.5/e_11e86cebGugogCw+kiM65ioJgqpmMCYKERNEL32.DLLut0LCSntdll.dll4zijBA0eNoFwcENACAMAsBVWM1ENHyosXzc3js53LyYxYYrWApkTHbkEZWRd/gBNAAPKQ

HellCatVN avatar Jan 19 '26 02:01 HellCatVN

happened again to me out of the blue - had to use nuclear option again ... PITA

davistroy avatar Jan 19 '26 04:01 davistroy

I started getting this error too, WIndows 11 powershell, I can't use Claude Code at all

panic(thread 1441708): integer does not fit in destination type oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Zamaroht avatar Jan 21 '26 19:01 Zamaroht

New Claude Code released but still having this issue. Have been unable to use both CLI or VS Code Extension this for days. Please fix this soon 🙏 I have 64gb of system ram and working on a local D drive and still having this issue.

RobDavenport avatar Jan 21 '26 21:01 RobDavenport

I get the "integer does not fit in destination type" bun 1.3.5 variant as well. No workaround has fixed it. I am on Claude 2.1.14 on Windows, using Terminal, Powershell, and similar variations. All fail. The web interface is unavailable to me as an alternative due to our enterprise IT policy, sadly.

jon-tindel avatar Jan 21 '26 22:01 jon-tindel

Seeing this issue as well. Not sure if it's related to the Claude Code process exited with code 3 error in the VSCode extension which also started happening recently (link)

For now my workaround is to use wsl instead of powershell or the GUI

Zach-Kauffman avatar Jan 22 '26 06:01 Zach-Kauffman

Same issue. As summarized by Opus:

Updated Bug Report: Claude Code 2.1.15 crashes on startup with Bun panic on Windows

Summary

Claude Code CLI crashes immediately on startup with a Bun runtime panic (integer does not fit in destination type). Simple flags like --version and --help work, but launching the interactive CLI or any command that loads the full runtime fails.

Environment

Component Value
OS Windows 11 (Build 10.0.26100.7623)
Claude Code Version 2.1.15
Installation Method Native standalone (installMethod: "native")
Binary Location %USERPROFILE%\.local\bin\claude.exe
Binary Size 228,773,024 bytes (~218 MB)
Bundled Bun Version 1.3.6 (d530ed99)
System RAM 68.60 GB

CPU Features

CPU: sse42 avx avx2 avx512

Tested Behavior

Command Shell Result
claude --version PowerShell ✅ Returns 2.1.15 (Claude Code)
claude --help PowerShell ✅ Full help output displayed
claude PowerShell ❌ Bun panic crash
claude CMD ❌ Bun panic crash
claude (clean env) CMD ❌ Bun panic crash
claude (from %USERPROFILE%) PowerShell ❌ Bun panic crash

Environment Variables Checked

Only unrelated variable present:

CODEX_MANAGED_BY_NPM = 1

No BUN_*, NODE_*, or NPM_* variables set.

Error Output

============================================================
Bun v1.3.6 (d530ed99) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2 avx512
Args: "claude"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(20) jsc spawn(10) standalone_executable 
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:domain" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:path/posix" "node:path/win32" "node:perf_hooks" "node:process" "node:querystring" "node:stream" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "node:zlib" "node:worker_threads" "undici" "ws" "node-fetch" "node:inspector" "node:http2" "node:diagnostics_channel" 
Elapsed: 1340ms | User: 875ms | Sys: 1375ms
RSS: 2.93GB | Peak: 2.93GB | Commit: 3.05GB | Faults: 720259 | Machine: 68.60GB

panic(thread 36048): integer does not fit in destination type
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Bun Crash Report URL

https://bun.report/1.3.6/e_1d530ed9GugogCsulmM6/1qJg6pqMCYKERNEL32.DLLut0LCSntdll.dll4zijBA0eNoFwcENACAMAsBVWM1ENHyosXzc3js53LyYxYYrWApkTHbkEZWRd/gBNAAPKQ

Memory State at Crash (Consistent Across Tests)

Metric Range
RSS 2.88–2.93 GB
Peak 2.88–2.93 GB
Commit 2.96–3.05 GB
Page Faults 709,733–720,259

Key Observations

  1. Consistent crash: Every invocation that loads the full runtime crashes identically
  2. Same crash signature: Thread ID varies, but panic message and memory profile are consistent
  3. Pre-runtime crash: Occurs before any user code, project, or config is loaded
  4. Shell-independent: Crashes in both PowerShell and CMD
  5. Environment-independent: Clean environment makes no difference
  6. Directory-independent: Working directory doesn’t affect crash

Probable Cause

The panic integer does not fit in destination type combined with:

  • High memory consumption (~2.9 GB) before crash
  • Involvement of KERNEL32.DLL and ntdll.dll
  • AVX-512 capable CPU

…suggests an integer overflow in Bun 1.3.6’s memory allocation or SIMD code paths, possibly triggered by:

  • Windows 11 24H2 (Build 26100) memory management changes
  • AVX-512 specific code paths
  • Large standalone executable unpacking

Related Issues

  • Bun issue tracker should be checked for similar Bun 1.3.6 panics on Windows
  • This may be related to known Bun 1.3.x Windows regressions

Requested Actions

  1. Immediate: Provide a way to downgrade to a previous Claude Code version with working Bun runtime
  2. Short-term: Consider bundling Bun 1.2.x until 1.3.x Windows issues are resolved
  3. Investigation: Test Claude Code 2.1.15 on Windows 11 24H2 with AVX-512 CPUs

Workaround Requests

  • Is there an npm-based installation method that uses system Node.js instead of bundled Bun?
  • Can a previous version of Claude Code be manually installed?
  • Are there environment variables to force Bun to use different code paths (e.g., disable AVX-512)?

ryantuc avatar Jan 22 '26 06:01 ryantuc

Downgrade attempt summary

  • Tried installing Claude Code v2.0.76 to avoid Bun 1.3.x using:

    & ([scriptblock]::Create((irm https://claude.ai/install.ps1))) 2.0.76
    
  • Installer reported success, then crashed with a Bun panic:

    panic(thread ...): integer does not fit in destination type
    
  • Crash output indicates Bun v1.3.6 is running the installer binary with:

    Args: "C:\Users\ryant\.claude\downloads\claude-2.1.15-win32-x64.exe" "install" "2.0.76"
    
  • Result: The downgrade path still uses the Bun 1.3.6 installer (claude-2.1.15 .exe) and crashes the same way, so it doesn’t avoid the Bun 1.3.x crash.

ryantuc avatar Jan 22 '26 06:01 ryantuc

Also having the same problem, seems to be after a few windows updates that were rolled out on my machine yesterday afternoon

downingjt avatar Jan 22 '26 14:01 downingjt

Workaround: temporarily switch back to the npm installation of Claude Code

We're planning to update the included version of bun to include this fix ASAP, but need to address a few blockers first.

ant-kurt avatar Jan 22 '26 22:01 ant-kurt

Title: Bun panic on Windows: "integer does not fit in destination type" in
preadv

Body:

Environment

  • Bun version: 1.3.5
  • OS: Windows x86_64
  • Context: Running Claude Code (npm) which uses Bun internally

Error

panic: integer does not fit in destination type

  • sys_uv.zig:294: preadv
  • node_fs.zig:5168: readFileWithOptions
  • atomic.zig:50: fetchSub

Features: spawn, standalone_executable, process_dlopen, Bun.stderr, Bun.stdin,
Bun.stdout, fetch, jsc

Steps to Reproduce

  1. Install Claude Code via npm: npm install -g @anthropic-ai/claude-code
  2. Run claude in a project directory on Windows
  3. Crash occurs during file reading operations

Expected Behavior

File reading should complete without panic.

Notes

This appears to be an integer overflow in the preadv syscall wrapper on Windows.

ivan-ai-san avatar Jan 23 '26 01:01 ivan-ai-san

Well, present, one more on the list of those affected.

executorrr86 avatar Jan 23 '26 13:01 executorrr86

Same here. Waiting for a fix!

UPDATE (at least from my side): Fix confirmed for Windows 11 25H2

The crash is caused by Windows Update KB5074109 (Jan 14, 2026) breaking Bun v1.3.5.

My specs:

  • Windows 11 25H2
  • Claude Code Desktop App v2.1.15/v2.1.17
  • KB5074109 installed Jan 14, 2026

Solution: Install Microsoft's out-of-band update KB5077744

  1. Download from Microsoft Update Catalog
  2. Install via PowerShell (Admin):
    wusa.exe "path\to\windows11.0-kb5077744-x64_fb63f62e4846b81b064c3515d7aff46c9d6d50c8.msu" /quiet
    
  3. Restart
Windows Version Fix
25H2 / 24H2 KB5077744
23H2 KB5077797

D-Ac3 avatar Jan 23 '26 13:01 D-Ac3

Has anyone tried switching to the npm installation instead of the Native Installer? Claude suggests I try it, but that my expectations shouldn't be too high since it has the same dependency on bun.

jon-tindel avatar Jan 23 '26 14:01 jon-tindel