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

  1. Open Zed IDE (or similar)
  2. Run claude in the integrated terminal
  3. Kill/close Zed
  4. 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)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗