claude-code - 💡(How to fix) Fix [Bug] Background agent workers crash with "exit 1 before init" on spawn

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…

Error Message

the real error message is never visible.

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Every background-agent worker crashes exit 1 before init immediately on spawn — claude --bg, the Agents view, resuming bg chats, and even blank pre-warmed spares all fail. Interactive claude / claude -p work fine. 100% reproducible with claude --bg "anything".

Crash from ~/.claude/jobs/<id>/state.json: exit 1 before init — …at uSK (cli.js:9092:233) at async SKO (cli.js:19558:68) at async h4O (cli.js:19595:313) Bun v1.3.14 (macOS arm64)

Env: Claude Code 2.1.143 (also seen on 2.1.142), macOS arm64. Ruled out: not auth (separate auth_required issue fixed; fresh daemon authenticates, workers still crash), not a version regression (started on 2.1.142), not system Bun (updating it changed nothing). Also: the state.json crash detail is truncated (leading ) so the real error message is never visible.

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 2.1.143
  • Feedback ID: 765aa9e1-f193-4ba0-b828-64b8ad177503

Errors

[]

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

claude-code - 💡(How to fix) Fix [Bug] Background agent workers crash with "exit 1 before init" on spawn