[BUG] Bun 1.4.0 segfault under ~25 concurrent background subagents (fetch/spawn churn, not OOM) — CLI 2.1.202, Windows 11

Open 💬 1 comment Opened Jul 8, 2026 by knacrafton

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?

The Claude Code CLI process (2.1.202, bundled Bun v1.4.0, Windows x64) died with a native
segfault — panic(main thread): Segmentation fault at address 0x2CA00000050, exit code 3 —
while ~25 background subagents were concurrently live.

Context: ~98 min into an interactive session (desktop app host, model claude-opus-4-8),
the model launched 35 background subagents via the Agent tool (general-purpose,
run_in_background), in two tool messages (10, then 25). Each subagent did several file
Reads, spawned pwsh (which spawned curl), made several WebSearch/WebFetch calls, and
wrote one file. 10 subagents completed; with 25 still live and streaming, the host
process segfaulted.

This is NOT resource exhaustion:

  • RSS peak 0.55 GB / commit 0.96 GB on a 33.65 GB machine (~1.6% utilization)
  • No Windows Application Error / WER report, no Resource-Exhaustion-Detector (2004)

event — only Bun's own panic handler fired

  • Bun's counters at death (fetch(945), spawn(134)) point at concurrent async-I/O +

child-process churn as the trigger surface

Impact: all 27 unfinished background tasks orphaned ("no completion record" on restart);
all connected MCP servers dropped (collateral of process death).

Related: likely same root-cause family as #69862 (Bun 1.4.0 fetch-path segfault,
Windows) and #68168 (same panic signature); this report adds a concurrency-load trigger
and memory-pressure counter-evidence.

What Should Happen?

The host process should survive N concurrent background subagents doing web fetches and
child-process spawns (or fail gracefully by throttling/erroring individual tasks), rather
than a native runtime segfault that kills the entire session and orphans all in-flight
background task state.

Error Messages/Logs

CLI stderr at death, captured by the desktop app in %APPDATA%\Claude\logs\main.log
(2026-07-07 18:08:52 PDT):

============================================================
Bun v1.4.0 (63bb0ca0d) Windows x64 (baseline)
Windows v10.26200
CPU: sse42 avx avx2
Args: "<home>\AppData\Roaming\Claude\claude-code\2.1.202\claude.exe" "--output-format"
"stream-json" "--verbose" "--input-format" "stream-json" "--effort" "high" "--model"
"claude-opus-4-8" "--permission-prompt-tool" "stdio" "--all"...
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(14) fetch(945) jsc
spawn(134) standalone_executable yaml_parse(44) claude_code
Elapsed: 5878776ms | User: 85046ms | Sys: 15625ms
RSS: 0.55 GB | Peak: 0.55 GB | Commit: 0.96 GB | Faults: 738246 | Machine: 33.65 GB
panic(main thread): Segmentation fault at address 0x2CA00000050
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Parent (desktop app) log at the same timestamp:
[error] Session ... query error: Claude Code process exited with code 3
[info] [CCD] Session ... torn down with 27 live background task(s) — settling as
stopped (exited)

Per-subagent transcript JSONLs bracket the death to the second: 10 completed agents'
files stop 18:06:11–18:07:49; all 25 victims' files were actively being appended
18:08:05–18:08:51 (crash at 18:08:52). Full logs and session id available on request.

Steps to Reproduce

Probabilistic, not deterministic — the shape that triggered it:

  1. Windows 11, Claude Code 2.1.202 (Bun 1.4.0), interactive session hosted by the

desktop app, model claude-opus-4-8.

  1. Run the session ~1.5h (945 fetches / 134 spawns accumulated on Bun's counters).
  2. Have the model launch 35 background subagents via the Agent tool

(subagent_type: general-purpose, run_in_background: true), 10 in one tool message
then 25 in the next, so >25 are live concurrently.

  1. Each subagent: several file Reads → spawn pwsh -> curl → several WebSearch/WebFetch

→ one file Write (each self-reports ~100K+ tokens, 12–17 tool calls, 143–277s).

  1. Crash occurred while 25 were live and mid-tool.

Counter-datapoint for triage: the identical workload re-run on the same machine in
drained batches of 8 concurrent subagents (3 batches) completed without incident.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.202 (app-managed CLI at %APPDATA%\Claude\claude-code\2.1.202\claude.exe; bundled Bun v1.4.0 63bb0ca0d, Windows x64 baseline build)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

This was the first run of this workload shape (35-way concurrent background subagent fan-out) on any version, so I can't compare against a prior version. The Bun-segfault issue family spans Bun 1.3.14 (#57853, #60215) and 1.4.0 (#69862, #73196), which suggests a long-standing crash class rather than a recent regression.

2.1.202 (app-managed CLI at %APPDATA%\Claude\claude-code\2.1.202\claude.exe; bundled Bun v1.4.0 63bb0ca0d, Windows x64 baseline build)

Windows 11 Pro 10.0.26200, x64 — running inside the Claude for Windows desktop app v1.19367.0 (1a5be1), which hosts the CLI as a child process over stream-json stdio

None — desktop app host, not a terminal (CLI launched with --input-format/--output-format stream-json, --permission-prompt-tool stdio). Subagent tool calls used PowerShell 7 and Git-Bash.

  • Session id: c4390640-4933-4a11-ab36-7c9e2a531e6c (happy to provide full logs privately)
  • CPU flags per Bun banner: sse42 avx avx2; machine RAM 33.65 GB
  • Attached: (1) sanitized main.log excerpt covering the crash window incl. the full Bun

panic block and the app's "torn down with 27 live background task(s)" teardown;
(2) per-subagent transcript last-write timestamps showing 10 agents finished
18:06:11–18:07:49 and all 25 others actively streaming 18:08:05–18:08:51, one second
before the 18:08:52 panic. Transcript contents withheld (personal data) but available
to Anthropic on request.

mainlog_crash_excerpt.txt
subagent_timestamps.txt

-- Filed per request of Fable 5; all details provided are from it. Happy to answer additional questions, I can always return to that session (though context loss on re-instantiation may muck up details). --krc

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗