[BUG] Claude Desktop macOS leaves orphaned `claude` CLI processes after quitting

Resolved 💬 3 comments Opened Jan 19, 2026 by yepzdk Closed Feb 18, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using Claude Code features within Claude Desktop on macOS, the spawned claude CLI process is not terminated when the Desktop app is closed. The orphaned process persists indefinitely (observed running for 3+ days) and consumes system resources.

Example:

$ ps ax -o pid,comm,lstart | grep claude
62019 claude           Fri Jan 16 13:35:22 2026   # 3 days old, still running after Desktop closed
45595 claude           Mon Jan 19 07:42:22 2026   # Current terminal session

What Should Happen?

When Claude Desktop is closed (via Cmd+Q or Dock → Quit), all spawned child processes including claude CLI processes should be terminated gracefully.

Error Messages/Logs

No error messages. The process simply continues running silently after Desktop closes.


# Orphaned process detected 3 days after Desktop was closed:
$ ps ax -o pid,comm,lstart | grep claude
62019 claude           Fri Jan 16 13:35:22 2026

# Process must be manually killed:
$ kill 62019

Steps to Reproduce

  1. Launch Claude Desktop on macOS
  2. Start a Claude Code session within Desktop (open any project folder)
  3. Perform some Claude Code actions (file edits, bash commands, etc.)
  4. Close Claude Desktop using Cmd+Q or Dock right-click → Quit
  5. Verify the claude process is still running:

``bash
ps ax -o pid,comm,lstart | grep claude
``

  1. The process from step 2-3 will still be running with the old start time

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

Related Issues

  • #14951 - Claude Desktop macOS zombie state (closed - about app lifecycle, not child processes)
  • #1935 - MCP servers not terminated (open - similar pattern but for MCP processes)
  • #15423 - Windows orphaned renderer processes (related pattern on Windows)

Root Cause Hypothesis

Claude Desktop spawns claude CLI processes to handle Claude Code functionality. These child processes are not being tracked/terminated during the app shutdown sequence. Unlike MCP server orphaning (#1935), these are the main Claude Code execution processes.

Workaround

Manually identify and kill orphaned processes:

# Find old claude processes
ps ax -o pid,comm,lstart | grep claude

# Kill orphaned process
kill <PID>

More context

I was building this tool: https://github.com/yepzdk/claude-sessions-monitor to help me keep track of all the Claudes i was running in different tabs, and could not find out why one was stale in the list. Claude helped me debug this, and we ended up seeing this behaviour, where a session from the Desktop app was orphaned.
The tool now includes a --kill-ghosts command that detects and terminates these orphaned processes, which can serve as a workaround.

View original on GitHub ↗

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