[BUG] 2.1.143 background agents crash exit 1 before init on macOS arm64

Status Fixed / completed
Reported on v2.1.142
Maintainer reply ✓ Yes — bogini
Activity 4 comments · opened May 16, 2026 · closed May 27, 2026
💡 Likely answer: A maintainer (bogini, collaborator) responded on this thread — see the highlighted reply below.

Summary

After upgrading from 2.1.142 → 2.1.143 on macOS 26.4.1 (arm64, T6020), every background-spawned agent (both via the native daemon's agent view and via cmux) crashes within 60-200ms with exit 1 before init. Foreground sessions are completely unaffected. Rolling back the symlink to 2.1.142 restores normal behavior immediately without restarting the daemon.

Repro

# Symlink the bad version
ln -sfn ~/.local/share/claude/versions/2.1.143 ~/.local/bin/claude

# Spawn any background agent — instantly crashes
~/.local/bin/claude --print --agent claude "OK"
echo "exit=$?"   # → exit=1, ~60-200ms

The same command works when the symlink points to 2.1.142.

Crash detail (as surfaced by the daemon)

state: crashed
detail: exit 1 before init —
  …at uSK (/\$bunfs/root/src/entrypoints/cli.js:9092:233)
   at async SKO (/\$bunfs/root/src/entrypoints/cli.js:19558:68)
   at async h4O (/\$bunfs/root/src/entrypoints/cli.js:19595:313)
  Bun v1.3.14 (macOS arm64)
backend: daemon
respawnFlags: ["--agent","claude"]

The visible frames are all in the outer wrapper — the real throw is swallowed, so the trace alone can't identify the failing module. The crash happens before any init log line is emitted.

Environment

| Field | Value |
|---|---|
| Claude Code (broken) | 2.1.143 |
| Claude Code (works) | 2.1.142, 2.1.141 |
| Bun bundle | v1.3.14 |
| macOS | 26.4.1 (build 25E253) |
| Kernel | Darwin 25.4.0, xnu-12377.101.15~1/RELEASE_ARM64_T6020 |
| Arch | arm64 |
| Backend exhibiting crash | native daemon agent view, cmux agent view |
| Foreground REPL | works fine on 2.1.143 |

Workaround

rm ~/.local/bin/claude
ln -s ~/.local/share/claude/versions/2.1.142 ~/.local/bin/claude
# next bg-agent spawn picks up the new symlink — no daemon restart needed

Possibly related

  • #59561 — same 2.1.143 + Bun 1.3.14 bundle on Windows: Chrome native host crashes with ERR_INVALID_ARG_TYPE binding named pipe. Different platform, but both look like child-process / IPC channel init regressions in the same bundle.
  • #50267 — prior bg-subagent regression (2.1.114) shows this surface area has regressed before.

Happy to attach more raw daemon log lines or run \dtruss\ on a re-symlinked 2.1.143 if helpful.

View original on GitHub ↗

4 Comments

GabrielDarwish · 5 months ago

Confirming this reproduces on a different macOS / chip combo:

| Field | Value |
|---|---|
| Claude Code | 2.1.143 |
| macOS | 15.6 (build 24G84) |
| Kernel | Darwin 24.6.0, xnu-11417.140.69~1/RELEASE_ARM64_T8132 |
| Bun bundle | v1.3.14 |
| Install | npm via Homebrew (/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code) |
| Foreground REPL | works |
| Background fleet | every spawn crashes ~50–150ms after bg claimed-spare |

Drilling in: invoking claude.exe --bg-pty-host <ptysock> 200 50 -- /bin/echo hi directly (with stdio inherited so stderr is visible) reproduces the failure deterministically and prints error: An unknown error occurred (Unexpected) — a Bun-level error from inside the host's bootstrap, before any user JS runs. Same crash with a brand-new $HOME and empty CLAUDE_CONFIG_DIR, so it's not config-driven. --bg-spare alone (no pty-host wrapper) is fine.

So the regression isn't limited to macOS 26 / T6020 — --bg-pty-host startup is broken on at least macOS 15.6 / T8132 too.

Sami-Mannila · 5 months ago

Hit this today on 2.1.143 (macOS 15 arm64). Confirming a working
workaround for anyone blocked: downgrade the launcher symlink to the
previously installed version.

# kill the crashing agents view + its daemon first
pkill -f "claude agents"
pkill -f "claude daemon run"

# point the launcher at the prior version (assumes 2.1.142 is still on disk)
ln -sfn ~/.local/share/claude/versions/2.1.142 ~/.local/bin/claude

# verify
claude --version   # → 2.1.142 (Claude Code)

# relaunch
claude agents

After this, ~/.claude/daemon.log shows the supervisor settle cleanly
with no bg settled <id> (crashed) lines.

Note: Claude Code's auto-updater may re-point the symlink to the newest
version on next launch — re-swap if bg-spare crashes return.

bogini collaborator · 4 months ago

Addressed by a merged fix. Please reopen with a fresh repro if you still see this on a current version.

github-actions[bot] · 2 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.