August 25, 20265 min read

Claude Code Remote Control Not Working: Fix /rc Disconnects & Sleep Bugs

One of the most powerful workflows introduced with Claude Code is remote control: starting a complex refactoring or testing session on your Mac, stepping away from your desk, and monitoring or approving tasks from your iPhone or laptop.

However, many developers find that their Claude Code remote sessions silently stop working. The iOS web interface shows “Disconnected” or “Waiting for host”, active sessions fail to appear in the dashboard, or commands freeze mid-execution when your laptop lid closes.

If your Claude Code remote control is failing, here is a complete diagnostic breakdown of why it breaks, how to fix each root cause, and how to set up a resilient terminal connection that never drops.

SymptomRoot CauseQuick Fix
No session in mobile web appRemote control disabled by default in recent updatesRun /rc or set in config
Handshake hangs indefinitelyCustom ANTHROPIC_BASE_URL or telemetry disabledUnset proxy environment variables
Session drops after 2 minutesMacBook sleep and macOS display pipeline teardownUse native PTY remote host (Macky)
Disconnected after 60 minutesAnthropic cloud gateway inactivity timeoutUse direct peer-to-peer WebRTC connection

Fix 1: Remote Control Turned Off by Default in Recent Updates

In earlier releases of Claude Code, remote control was often enabled automatically upon launching a session. Recent releases changed this behavior to save cloud relay resources and improve local startup speed.

If your phone or web dashboard cannot find your terminal session, remote control is likely not active in that specific shell.

How to enable it manually:

In your active Claude Code session, enter:

/rc

or the full command:

/remote-control

Claude will output a confirmation URL and QR code. As long as your mobile browser or Claude app is logged into the exact same Anthropic account, the active session will appear in your session list.

How to re-enable auto remote control globally:

In Claude Desktop, navigate to Settings > Claude Code and enable Remote Control by Default. Alternatively, inside your terminal session, run:

/config set autoRemoteControl true

Fix 2: Environment Variables Breaking the Cloud Relay

Many developers use tools like Headroom, LiteLLM, or custom proxies to route Anthropic API requests through internal endpoints or caching proxies. These tools routinely export:

export ANTHROPIC_BASE_URL="http://localhost:8000/v1"

The Claude Code remote control protocol relies on Anthropic's production WebSocket gateway (wss://*.anthropic.com). When ANTHROPIC_BASE_URL is defined, Claude Code attempts to establish its remote control handshake against your proxy endpoint instead of Anthropic's relay servers, causing the connection to fail silently.

How to test and fix:

Check if any override variables exist in your current shell:

env | grep -i anthropic

If present, unset it for your Claude session:

unset ANTHROPIC_BASE_URL claude

Fix 3: The MacBook Lid-Close and Sleep Disconnect Bug

When you close your MacBook lid, macOS enters clamshell sleep unless an external display and power adapter are connected. Even when background processes are kept alive with caffeinate -i, macOS suspends Wi-Fi sleep-proxy sockets to preserve battery. This severs the persistent WebSocket heartbeat between Claude Code and Anthropic servers within 90 seconds.

The Permanent Solution: Native Mac PTY via Macky

Instead of relying on a fragile third-party cloud relay, Macky connects your iPhone or iPad directly to your Mac's native pseudo-terminal (PTY) over encrypted, peer-to-peer WebRTC.

FeatureClaude Code Cloud Relay (/rc)Macky P2P Native Terminal
ArchitectureAnthropic cloud gateway proxyDirect peer-to-peer WebRTC
Network ResilienceDrops on Wi-Fi/cellular handoverInstant ICE auto-reconnect
Lid-Closed SupportDrops when MacBook sleepsKeeps host PTY alive in clamshell mode
Inactivity Limit60-minute cloud timeoutNo time limits (persistent local process)
Prompt ControlsWeb app buttons (can miss raw prompts)Full touch keyboard accessories (Tab, y, Enter, Ctrl+C)

How to Run Claude Code Remotely with Macky

  1. Install Macky on your Mac: Launch Macky on your macOS host. It exposes your login shell (Zsh/Bash) with zero configuration.
  2. Pair with your iPhone: Scan the QR code once with Macky on iOS.
  3. Launch Claude Code in your persistent shell: Run claude.
  4. Walk away with full confidence: Put your phone in your pocket or switch networks. The Mac PTY stays active, and your session resumes instantly whenever you open Macky.

Try Macky

Connect to your Mac terminal from your iPhone. Free to start, no configuration required.