claude-code - 💡(How to fix) Fix Bun crashes with "Illegal instruction" during long sessions with context compression on Windows 11 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46867Fetched 2026-04-12 13:30:59
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×5commented ×1

Multiple Bun crashes during a single long session (~5 hours). The crashes occur specifically when context compression fires and Claude Code is rebuilding/propagating context -- not during normal tool use or computation.

This is notable because the same machine regularly runs calculation-heavy sessions (multi-agent parallel searches, 824-session backtests, large file reads, dozens of sequential tool calls) without any crashes. The differentiator appears to be context compression cycles, not computational load.

Root Cause

This is notable because the same machine regularly runs calculation-heavy sessions (multi-agent parallel searches, 824-session backtests, large file reads, dozens of sequential tool calls) without any crashes. The differentiator appears to be context compression cycles, not computational load.

Code Example

Bun v1.3.11 (a2743b6d) Windows x64 (baseline)
RSS: 1.69GB | Peak: 1.69GB | Commit: 4.94GB | Faults: 17723313
panic(main thread): Illegal instruction at address 0x7FF6382FD19A
RAW_BUFFERClick to expand / collapse

Environment

  • Claude Code v2.1.81, Bun v1.3.11
  • Windows 11 Pro 10.0.22000, x64 (SSE4.2 + AVX2)
  • CPU baseline features only (no AVX-512)
  • Model: claude-opus-4-6 (1M context)

Description

Multiple Bun crashes during a single long session (~5 hours). The crashes occur specifically when context compression fires and Claude Code is rebuilding/propagating context -- not during normal tool use or computation.

This is notable because the same machine regularly runs calculation-heavy sessions (multi-agent parallel searches, 824-session backtests, large file reads, dozens of sequential tool calls) without any crashes. The differentiator appears to be context compression cycles, not computational load.

Crash details

Bun v1.3.11 (a2743b6d) Windows x64 (baseline)
RSS: 1.69GB | Peak: 1.69GB | Commit: 4.94GB | Faults: 17723313
panic(main thread): Illegal instruction at address 0x7FF6382FD19A

Crash report: bun.report/1.3.11/e_1a2743b6mgkgEuhogC05onlDo2q01Dqt9gvDgt6slDi+6slD+xts4C6v+o4Cm/4o4Cmx4o4C2ilt6B657j5Bwt1p4By/yj5Bylyj5Bwg2rvB+5zl/B____A3s//B05o/l4B

Reproduction pattern

  1. Long conversation (4-5+ hours continuous use)
  2. Heavy tool use throughout (parallel agents, file reads, edits, bash commands)
  3. Context approaches compression threshold
  4. Crash occurs during or immediately after compression ("Propagating..." / "Churning..." status)
  5. Session restarts cleanly, same work resumes without issues until next compression cycle

Multiple crashes in the same session, all at the compression boundary. Never crashes during normal tool execution regardless of complexity.

What doesn't cause it

  • Parallel agent spawning (5+ concurrent agents)
  • Large file reads (100KB+ files)
  • Heavy bash execution (5+ minute Python runs)
  • Sequential tool chains (30+ tool calls in sequence)
  • Any of the above at normal context lengths

extent analysis

TL;DR

The most likely fix or workaround is to investigate and potentially optimize the context compression mechanism in Claude Code to prevent crashes during long sessions.

Guidance

  • Investigate the context compression algorithm and its interaction with Bun to identify potential issues, such as memory management or instruction compatibility problems.
  • Verify that the crash is indeed related to the compression threshold by monitoring system resources and compression cycles during long sessions.
  • Consider implementing a temporary workaround, such as increasing the compression threshold or reducing the frequency of compression cycles, to mitigate the crashes.
  • Review the crash report and Bun version to determine if there are any known issues or updates that may address the problem.

Example

No specific code snippet can be provided without more information on the context compression mechanism, but a potential area of investigation could be the memory management and allocation during compression cycles.

Notes

The crashes seem to be specific to the context compression mechanism and do not occur during normal tool execution, regardless of computational load. This suggests that the issue may be related to the compression algorithm or its interaction with the system resources.

Recommendation

Apply a workaround, such as adjusting the compression threshold or frequency, as the root cause of the issue is not immediately clear and may require further investigation. This can help mitigate the crashes during long sessions while a more permanent solution is developed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING