[Bug]: After a restart, an old Claude process keeps running with parent PID 1 beside a new one resuming the same session #24222
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related, each a different case: #15542 (closed; database error leaves a Claude process unsupervised), #18646 (closed; Claude background subagents after a restart), #5241 (closed; OpenCode serve after a crash), #20717 (child processes of idle-reaped sessions), #21856 (second server sharing the T3 home).
Area#
apps/server
Steps to reproduce#
Seen once; we have not found a deterministic trigger.
- Run several Claude threads. T3 starts each as a
claudechild process of the server with--resume=<session id>or--session-id=<session id>. - Restart the T3 server (desktop app restart) while one of those sessions has a live process.
- After the restart, send a message to that thread, then list processes:
ps -eo pid,ppid,lstart,args | grep "[c]laude .*--resume".
Expected behavior#
After a restart, no provider process from the previous server keeps running unowned. Either the new server stops or adopts it, or it refuses to resume a native session ID that a live process still holds.
Actual behavior#
Two claude processes ran with the same --resume session ID:
- the old one, started about 80 minutes before the restart, now with parent PID 1 (no T3 server owns it);
- a new one started by the restarted server for the same thread.
The old process kept working beside the new one for about 90 minutes after the restart. It wrote to a file in the shared workspace 35 minutes after the restart, then exited on its own. We found it only by matching --resume IDs in ps by hand.
We do not know why the old process survived the restart.
Impact#
Minor bug or occasional failure
Version or commit#
T3 Code (Nightly) in use on 2026-10-22; exact build number not recorded
Environment#
macOS 26.6.2, Apple Silicon, desktop app; Claude Code provider
Logs or stack traces#
No response
Screenshots, recordings, or supporting files#
No response
Workaround#
After each restart, compare the --resume IDs of running claude processes with their parent PIDs, and treat any with parent PID 1 as orphaned.
juliusmarminge closed this
Sign in to join this conversation.
This is fixed on main by 5ffe045931 (https://git.cafe/pingdotgg/t3code/pulls/23389, merged 2026-10-22 08:16 UTC), which closed https://git.cafe/pingdotgg/t3code/issues/23370, the same report: after a desktop restart, a mid-turn Claude CLI is left with parent PID 1 next to a second
--resumeprocess. The CLI now starts under a small watcher in its process group. When the server that started it dies (crash, SIGKILL, update or relaunch), the watcher sends SIGTERM to the group, then SIGKILL 5 s later.The 2026-10-22 nightlies straddle that fix:
20261022.3512predates it, while.3526and.3541include it. The watcher only covers CLIs started by a build that has it. A process started before an update restart into a fixed build can still outlive that one restart.What I ran on main at 92e645032c (Linux dev server with systemd agent scopes off, so cleanup takes the same path as on macOS; Claude Haiku 5.5, a foreground
sleepBash turn):sleepwere gone. After the restart I sent to the same thread and found oneclaude --resume=<id>, whose parent was the new server.bash --posix, which is what macOS/bin/shruns.Transcript: issue-24222-repro-transcript.txt
Closing as fixed. If this happens again on
v0.1.2-nightly.20261022.3526or later, with the old process started after you updated, please reopen with the build number and theps -eo pid,ppid,pgid,lstart,argsoutput.