Orphaned Claude processes when parent terminal is killed
Resolved 💬 3 comments Opened Jan 22, 2026 by AndrewTKent Closed Jan 26, 2026
Description
When Claude Code is running inside an IDE terminal (e.g., Zed) and the IDE is killed/closed, the Claude process becomes orphaned instead of exiting cleanly.
Reproduction
- Open Zed IDE (or similar)
- Run
claudein the integrated terminal - Kill/close Zed
- Claude process remains running, detached from any terminal
Observed behavior
$ ps -p <pid> -o pid,tty,state,command
PID TTY STAT COMMAND
4754 ?? S claude --dangerously-skip-permissions
The ?? TTY indicates the process is detached from any terminal. Multiple orphaned instances can accumulate over time, consuming significant memory (~100-200MB each).
Expected behavior
Claude should detect when its parent terminal/shell dies (via SIGHUP or polling ppid) and exit cleanly.
Environment
- macOS (Darwin 25.2.0)
- Claude Code CLI
- Zed IDE (but likely affects any IDE with integrated terminal)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗