Remote control: add keepalive/auto-reconnect for mobile sessions

Resolved 💬 2 comments Opened Mar 7, 2026 by stephenchen408 Closed Apr 5, 2026

Problem

When using /remote-control to connect from a mobile device (iPhone), the session drops frequently due to network instability. After disconnection, the user must manually:

  1. Go to the host terminal
  2. Disconnect remote control
  3. Reconnect remote control
  4. The new session on the phone has no context of what was displayed before

This makes mobile usage unreliable for longer conversations.

Proposed Solution

Add a keepalive/heartbeat mechanism to the remote control protocol so the connection stays alive, or auto-reconnects when it drops. Options:

  1. Server-side heartbeat — periodic ping to keep the WebSocket/connection alive
  2. Auto-reconnect — detect disconnection and automatically re-establish the session
  3. Session resumption — when reconnecting, replay the last N messages so the user has context on the new session

Workaround Attempted

Tried automating disconnect/reconnect from a separate terminal, but /remote-control is a slash command inside the Claude Code session, not an external CLI command, so it can't be scripted from outside.

Environment

  • Host: Windows 11
  • Client: iPhone (Claude iOS app / browser)
  • Claude Code CLI

View original on GitHub ↗

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