Background worker crash-loop on session start: "worker crashed (exit 1 — exit_with_message) — respawning…"

Status Fixed / completed
Reported on v2.1.201
Maintainer reply None cached
Activity 5 comments · opened Jul 4, 2026 · closed Aug 20, 2026

Environment:

  • Claude Code version: 2.1.201
  • OS: Ubuntu 26.04 LTS, Linux 7.0.0-27-generic x86_64
  • Install path: ~/.local/bin/claude / ~/.local/share/claude/versions/

Description:
Every new Claude Code session prints a daemon supervisor message to the terminal:

worker crashed (exit 1 — exit_with_message) — respawning…

This appears alongside garbled/mid-render background-agent status text (e.g. a background session ID banner printing with stray escape sequences and line breaks mid-word).

What I checked:

  • ~/.claude/daemon.log shows only one daemon instance running at a time (no duplicate/stale daemon contention at the time of report) and no exit_with_message or "worker crashed" string anywhere in that log — the crash detail is not persisted to disk.
  • The log does show frequent background "spare" worker churn (bg spare spawned, claimed-spare, settled) — 72 such lines in one day — and one recent binary auto-upgrade (2.1.200 → 2.1.201) that triggered a supervisor self-restart.
  • No custom hooks or settings.json entries correlate with the crash (checked ~/.claude/settings.json, ~/.claude/settings.local.json).

Impact: Message appears on every new session start; sessions still seem to function (daemon respawns the worker automatically), but the crash-loop text and garbled banner are alarming/noisy and there's no way to see the actual underlying error since it isn't logged.

Ask: Please log the actual crash payload/stack for exit_with_message failures (currently silent), and fix the truncated/garbled background-agent status banner rendering.

View original on GitHub ↗

4 Comments

georgysavva · 1 month ago

It's the same for me. Any existing session gives me an error like this when I open it for the first time after it's got idle:

[[ISession af23e825-990c-4e8d-ae3d-cd81db21cedb is currently running as a background agent (bg). Use `claude agents` to find and attach to it, or add --fork-session to branch off a copy.

  [worker crashed (exit 1 — exit_with_message) — respawning…]

I tried doing claude daemon stop --any. It didn't help. It just made all my sessions idle and all of them would give me the error above on opening

Danm72 · 1 month ago

Happening to me too on macOS Version 15.6 (24G84)

TwoToneBytes · 1 month ago

Seeing this same worker crashed (exit 1 — exit_with_message) — respawning… on macOS (2.1.201, Apple Silicon), but not the deleted-cwd case from #74085. It happened while attaching to a session already running as a bg agent (the "still running as a background agent, open claude agents to attach" message), with the cwd still present.

From the binary, exit_with_message is just the label set whenever a worker exits nonzero after printing a message (if (exitCode !== 0) setBgExitCause("exit_with_message")), so it looks like it covers a few different causes. Here it seems to be the attach hitting an already-owned session and the intentional exit getting surfaced as a "crash" + respawn rather than a clean handoff.

Might be the same root as the Linux session-start case, or a separate attach-collision path, not sure. Happy to grab a debug log if it'd help narrow it.

chrisjenx · 1 month ago

Seeing this for basically every session older than an hour been happening since 199

Showing cached comments. Read the full discussion on GitHub ↗