Background worker crash-loop on session start: "worker crashed (exit 1 — exit_with_message) — respawning…"
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.logshows only one daemon instance running at a time (no duplicate/stale daemon contention at the time of report) and noexit_with_messageor "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.
Showing cached comments. Read the full discussion on GitHub ↗
4 Comments
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:
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 openingHappening to me too on macOS Version 15.6 (24G84)
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, openclaude agentsto attach" message), with the cwd still present.From the binary,
exit_with_messageis 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.
Seeing this for basically every session older than an hour been happening since 199