[BUG] Claude Code Desktop "auto connect" fails until ~/.claude/remote/run/* is wiped

Open 💬 1 comment Opened Jun 21, 2026 by TRedd37

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?

Summary
After a laptop suspend/resume cycle (or sometimes just leaving the machine idle and coming back), Claude Code Desktop reports "auto connect failed" and won't recover on its own. The only reliable fix is to rm -rf ~/.claude/remote/run/* — after which the running session recovers immediately, no relaunch needed. Stale state in the run directory appears to wedge the live session.

Environment
Claude Code: 2.1.185
OS: Ubuntu 22.04.5 LTS (kernel 6.8.0-94-generic)
Desktop app on Linux

Observed state when it's broken
~/.claude/remote/run/<id>/ contains a stale rpc.sock and remote-server.log, and ps aux typically shows multiple lingering claude/remote/srv/.../server --serve --socket <same-socket> processes from prior sessions, all attached to the same socket path.

$ ps aux | grep 'claude/remote/srv' | grep -v grep

several server --serve and server --bridge processes from old sessions

What I think is happening
The desktop app does not reliably tear down its server --serve / server --bridge / ccd-cli processes when a session ends, when the app exits, or when the machine suspends.
After suspend/resume the running session's view of the run/<id>/ dir goes stale (socket file? token file? something cached), and auto-connect wedges.
Wiping run/* works without a relaunch, which means the running session can recover — it's just not invalidating its own stale state on its own. Something cached in the run dir keeps the live process in a failed state until the dir is forcibly cleared.

What Should Happen?

Expected behavior
On exit (graceful or otherwise), the desktop app should reap its server

Error Messages/Logs

Steps to Reproduce

Reproduction
Run Claude Code Desktop using an ssh (instead of local), use it normally.
Walk away — suspend the laptop, or just let it sit idle for a while.
Come back, the app is in an "auto connect failed" state.
Auto-connect does not recover on its own; new sessions in the app stay broken.
rm -rf ~/.claude/remote/run/* → auto-connect recovers immediately, no relaunch needed.

Claude Model

Not sure / Multiple models

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.185 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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