Skip to content

[Bug] Background agent workers crash with "exit 1 before init" on spawn #59652

Description

@a4xrbj1

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//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

[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions