Bug
When Deckard dies abnormally (killed / crash — anything that skips graceful teardown), all claude child processes survive as orphans (they ignore the PTY hangup), and on relaunch session restore spawns fresh claude --resume processes for the same session IDs. Result:
- Two live
claude processes resuming the same session, both appending to the same session .jsonl (observed: an orphan from a 2-day-old app death plus the current instance's resume of the same session — the session file's mtime moved with no visible new entries).
- The orphan fleet silently burns memory/CPU and holds MCP server connections (Slack/Notion etc. were still connected on 2-day-old orphans).
- Observed scale: 41 orphaned
claude processes (plus their MCP children) from a single abnormal exit, invisible to the user.
Repro
- Run Deckard with many Claude tabs.
kill -9 the Deckard process.
- Relaunch.
ps -axo pid,ppid,command | awk '$2==1' shows the old fleet still alive while the new instance resumes the same sessions.
Expected
At most one live claude per session; no invisible process fleet after an app death.
Proposed fix
Record spawned shell PIDs (with process start time to guard against PID reuse) in app support state. On launch, before restore: for each recorded PID that is still alive and now orphaned (ppid == 1, matching start time), kill it, then respawn. Optionally also warn when --resume targets a session that another live process already has open.
Bug
When Deckard dies abnormally (killed / crash — anything that skips graceful teardown), all
claudechild processes survive as orphans (they ignore the PTY hangup), and on relaunch session restore spawns freshclaude --resumeprocesses for the same session IDs. Result:claudeprocesses resuming the same session, both appending to the same session.jsonl(observed: an orphan from a 2-day-old app death plus the current instance's resume of the same session — the session file's mtime moved with no visible new entries).claudeprocesses (plus their MCP children) from a single abnormal exit, invisible to the user.Repro
kill -9the Deckard process.ps -axo pid,ppid,command | awk '$2==1'shows the old fleet still alive while the new instance resumes the same sessions.Expected
At most one live
claudeper session; no invisible process fleet after an app death.Proposed fix
Record spawned shell PIDs (with process start time to guard against PID reuse) in app support state. On launch, before restore: for each recorded PID that is still alive and now orphaned (ppid == 1, matching start time), kill it, then respawn. Optionally also warn when
--resumetargets a session that another live process already has open.