Orphaned interactive session with no visible window keeps receiving cross-session messages as held-for-approval

Status Open
Maintainer reply None cached
Activity 1 comment · opened Aug 18, 2026

Environment

  • macOS (Darwin 25.5.0), Claude Code CLI
  • Multi-session setup: several interactive claude -w <worktree> sessions plus one background job session, communicating via cross-session SendMessage (unix sockets in /tmp/cc-socks/)

What happened

An interactive session started with claude -w <worktree-name> was abandoned days ago — the user reports no terminal window exists for it anymore — but its process keeps running (parented, in our case, to the launcher rather than a live terminal) and it remains registered as a reachable peer in ListAgents, named <worktree-name>-19.

Consequences over several days:

  1. Message black hole. Other sessions resolving a recipient by name repeatedly picked this stale session (its name matches the worktree of the active session doing the actual work). Their messages were queued as "held pending approval from that session's user" — but no window exists in which anyone could ever approve them. Three different agent sessions independently lost messages this way; each reported the silence as "recipient not answering".
  2. No user-side visibility or remedy. The user cannot see the session (no window), cannot find it in any UI, and the receiving-side approval gate cannot be satisfied. The only discovery path was ps aux | grep claude and matching socket mtimes in /tmp/cc-socks/.
  3. Agent-side remedy also blocked. The active session (running in auto mode) tried to kill <pid> the orphan at the user's explicit request; the permission classifier denied it (reasonably), leaving no supported way for either the user or an agent to close a session that has no window.
  4. Stale sockets accumulate. /tmp/cc-socks/ also contains at least one .sock file whose owning process no longer exists.

Expected

  • A session whose controlling terminal is gone should deregister from the peer list (or be marked unreachable) rather than accept and hold messages indefinitely.
  • Some supported way to enumerate and close sessions without a window (e.g. claude sessions list / claude sessions kill <ref>), so users are not reduced to ps + kill.
  • Name resolution for SendMessage could prefer the most recently active session on a name collision, or error on ambiguity instead of silently delivering to an idle/orphaned one.

Repro sketch

  1. Start claude -w foo in a terminal; close/lose the terminal without ending the session process.
  2. Start other sessions; from one, SendMessage to the stale session's listed name.
  3. Message is held for approval forever; sender sees success; no user surface exists to approve or to close the session.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗