Check Mac sleep first, because one Terminal command proves in a minute whether macOS slept at the exact moment your session dropped. If the log shows sleep after you closed your MacBook lid, free idle tools like caffeinate cannot stop it; Clamshell for Mac keeps a closed Apple Silicon MacBook awake and online while armed, with no sudo, no external monitor, and nothing to undo, for $9.99 once after a 7-day free trial (no card required). If your Mac stayed awake through the drop, the cause is the claude process, your network, your login, another device, or an open Remote Control bug.
Written by Matyas Rathonyi, the maker of Clamshell for Mac.
From your phone, every Remote Control disconnect looks identical: the session goes quiet or says it cannot reach your machine. Below is the exact diagnosis order built from Anthropic's Remote Control documentation and the public GitHub issue tracker (checked October 11, 2026), followed by the right fix for whichever step matches your drop. For full closed-lid setup details, see Remote Control with the MacBook lid closed.
The order to check things in
Work from top to bottom. Each check takes less time than the one below it, and the first two take about a minute.
Step 1: read the reason Claude Code gives you
Before guessing, check the terminal on your Mac. Anthropic's docs state that when an interactive Remote Control connection fails, the indicator changes and "Claude Code shows the reason in a notification and adds it to the conversation." Scroll up in your session and look for a line beginning with Remote Control disconnected. If one is present, it names the cause so you can jump directly to the matching step below.
In server mode (claude remote-control), Anthropic's docs list --verbose for detailed connection and session logs and --debug-file <path> to save debug logs to a file. Enable them if disconnects repeat.
Do not take the phone's wording at face value. A commenter on GitHub issue #33041 reported the client displaying that the machine "may be asleep or offline" while both the Mac and the Remote Control process were still up. Treat the phone message as a guess and verify against the Mac's power log next.
"It may be asleep or offline. This session will reconnect when it's back."
The phone or web app shows Can't reach <your computer>. It may be asleep or offline. This session will reconnect when it's back. when it gets no answer from the Mac. A sleeping Mac is one cause, and Step 2 rules it in or out with one command. The message is the app's guess, though: GitHub issue #104917 (open, filed October 2026) reports it staying on screen after the computer was back online and the server had logged Connected. If the power log shows sleep at the drop time, the fix is to keep the Mac awake with the lid closed, which is what Clamshell for Mac does. If it shows no sleep, go to Step 3.
"Remote Control disconnected — Transport recovery exhausted (code 4094)"
This line appears in the terminal on the Mac. The wording says the reconnect attempts ran out. GitHub issue #108302 (open, filed November 2026) reports it on Claude Code 2.1.319 in a sandbox whose traffic to api.anthropic.com goes through a proxy. Check the power log for sleep at that time first (Step 2), then the network path (Step 4).
"Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')"
This one is not about sleep or your network. It was reported as a bug in the disconnect step of /remote-control (GitHub issues #81155, #82262 and #82702, all closed; #82702 names Claude Code 2.1.220 on macOS). Update Claude Code first. Keeping the Mac awake does not change it.
Step 2: rule sleep in or out
Note the approximate time the session dropped, open Terminal on your Mac, and run:
pmset -g log | grep -E "Entering Sleep|Wake from" | tail -40
The pmset(1) manual describes -g log as "a history of sleeps, wakes, and other power management events." It requires no sudo. On an Apple Silicon MacBook, matching lines look like this:
2026-10-11 14:43:28 +0200 Sleep Entering Sleep state due to 'Maintenance Sleep' ... Using Batt (Charge:65%)
2026-10-11 14:47:32 +0200 Wake Wake from Deep Idle [CDNVA] : due to ... lid ... HID Activity
How to read your output:
- The quoted reason names what triggered sleep. Closing the lid shows up as
'Clamshell Sleep'. - Ignore brief background wakes inside a sleep. Runs of
DarkWakefollowed by'Maintenance Sleep'are short wakes during one sleep span. Focus on the firstEntering Sleepline and theWake fromline that ends it. - Sleep drops recover on wake. Anthropic's docs state: "if your laptop sleeps or your network drops, Claude Code reconnects automatically when your machine comes back online." A drop at a Sleep line followed by automatic reconnection after Wake (with nothing done in between) confirms sleep caused it.
If the timestamps line up, pick the fix for how you use the laptop:
- Lid open, Mac idle (free). Claude Code runs
caffeinatewhile busy, though open GitHub issue #81832 reports a gap that lets an idle Mac sleep mid-task once the display turns off, and notes protection ends about 30 seconds after the session goes idle. Launch Claude Code ascaffeinate -i claudeto hold one assertion for the whole session, and on power turn on Prevent automatic sleeping on power adapter when the display is off under System Settings > Battery > Options. Both are free; see what Claude Code's keep-awake covers. - Lid closed. Neither
caffeinatenor Apple's Battery setting survives a closed lid, because caffeinate blocks idle sleep only. At a desk, Apple's closed-display mode needs an external monitor, power, keyboard, and mouse. Without a monitor, the free commandsudo pmset -a disablesleep 1needs admin rights both ways, stays active on battery with no cutoff, and has no menu bar indicator or heat stop until you remember to runsudo pmset -a disablesleep 0.
That is where Clamshell for Mac solves the disconnect: it keeps a closed Apple Silicon MacBook awake and on Wi-Fi while armed, with no monitor, no sudo, an always-on heat cut-off, and a 20% low-battery floor, and restores normal lid sleep when you disarm or quit. Test it on your Mac before paying anything: Download free trial (free for 7 days, no card required; $9.99 once for 1 Mac or $19.99 for up to 3 Macs, 14-day money-back guarantee).
To see what is preventing sleep right now, run pmset -g (check the sleep line) or pmset -g assertions. If your Mac stayed awake straight through the drop time, sleep did not cause it. Move to Step 3.
Step 3: check the process is still running
Remote Control depends on a live local process. Anthropic's docs state: "If you close the terminal, quit the Desktop app or VS Code, or otherwise stop the claude process, the session goes offline."
- The session is still open: run
/remote-controlinside it to reconnect. - Claude Code exited: resume with
claude --continueorclaude --resume. If you see "Couldn't reconnect to your Remote Control session", Anthropic's docs say to run/remote-controlto retry. - Running over SSH: start
claudeinsidetmuxorscreenso the process survives an SSH disconnect.
Step 4: network changes and outages
A Mac can stay awake and still lose contact with Anthropic's servers. Anthropic's docs describe four network cases:
| What happened | Claude Code behavior | What you see | Fix |
|---|---|---|---|
| VPN or proxy HTTP 403 | Retries up to 3 minutes | Reason naming edge, VPN, or proxy | Fix hop, run /remote-control |
| Long outage (interactive) | Keeps retrying until back | Auto-reconnects on recovery | None needed |
| Long outage (server mode) | Exits after about 10 minutes | Process no longer running | Run claude remote-control |
| Presence heartbeats fail | Disconnects interactive session | could not reach the Remote Control server for about 30 minutes | Run /remote-control |
Step 5: login, policy and other devices
- Expired login. Anthropic's error reference explains that Remote Control uses short-lived credentials refreshed from your saved claude.ai login. If refresh fails, your local session keeps running while Remote Control logs
Remote Control disconnectedandClaude.ai login expired. Run/login, then/remote-control. - Team and Enterprise checks. On organizations using Trusted Devices,
session expired for trusted-device checkmeans your sign-in is over 18 hours old; run/loginor confirm via Touch ID, Face ID, or a passkey. If an org admin disables Remote Control mid-session, Claude Code disconnects and does not auto-reconnect. - Changed on another device. Three reasons signal the session moved elsewhere: another connection took over, the session was ended or archived on another device, or the server no longer reports it. Run
/remote-controlonly if you want control back on this Mac. - Outdated Claude Code. "Remote Control got an unexpected server response" means your CLI could not parse the server's reply. Run
claude update, then/remote-control.
Step 6: the drops that are not your Mac
If your Mac stayed awake, claude stayed running, your network held, and your login was valid, you may be hitting a documented bug. Three threads in anthropics/claude-code (checked October 11, 2026) describe drops on awake Macs:
- #33041, "Remote Control (/remote-control) disconnects frequently" (Open, bug, 15 comments through September 27, 2026). The reporter disabled sleep, ran
caffeinate, and still saw disconnects every few minutes. One commenter saw two Macs on different networks drop within 45 seconds of each other; another on Claude Code 2.1.263 logged 1,343 reconnects in 38 hours on an awake Mac while a plain WebSocket stayed connected. Linux and Windows users report the same behavior. - #34500, "Remote Control disconnects during active use" (Closed March 18, 2026 as duplicate of #33041). Sleep was off and the terminal stayed alive; only the remote connection dropped mid-use.
- #50767, disconnects after roughly two hours (Closed May 26, 2026 as not planned for inactivity). Running
caffeinate -diswith continuous phone messages still lost the link around the two-hour mark at least ten times with no remote recovery.
None of those threads includes an official fix. Workarounds users report there:
- Reconnect manually by running
/remote-controlin the session. - Run inside
tmuxand resume withclaude --continueafter a drop. - Keep a backup path into the Mac (SSH into
tmuxor Screen Sharing) so you can run/remote-controlremotely. - Update Claude Code as a first check, though the threads do not confirm a fix in a specific release.
If your logs match, comment on #33041 with your Claude Code version and the pmset -g log output proving the Mac stayed awake.
When keeping the Mac awake is the fix
Keep-awake tools fix Remote Control disconnects whenever Step 2 shows a Sleep entry at the drop time. If your log shows the lid-close reason because you closed your MacBook lid without an external monitor, your choices are sudo pmset -a disablesleep 1 (admin password both ways, no timer, no menu bar state, no heat or battery cut-off) or a lid-closed app built for daily coding-agent runs.
Why pay $9.99 once for Clamshell? You stop the Remote Control drops that lid-close sleep causes, with no sudo, no external monitor, and nothing to undo, while getting an always-on heat cut-off and a 20% battery stop out of the box.
- Stops closed-lid drops with no admin rights. Keeps an Apple Silicon MacBook (macOS 14+) awake and on Wi-Fi with the lid closed, no
sudo, no kernel extension, and no privileged helper. Normal lid sleep returns automatically when you disarm, quit, or restart. - Always-on heat cut-off and 20% battery floor. Serious or critical thermal pressure disarms toward normal lid sleep; low-battery disarm at 20% is on by default.
- Built for Claude Code workflows. Arm via the menu bar, both Option keys, Option-close, Shortcuts, or
open "clamshell://arm"from Claude Code hooks. Optional v2 modules add Agent Status, Agent Notifications, and Finish Work, Then Sleep. - Works with or without a display. Stays armed on power or battery, with or without a monitor attached.
When you do not need Clamshell:
- Your MacBook lid stays open. Free
caffeinate -i claudeplus Apple's Battery sleep setting on power cover open-lid idle sleep at no cost. - Your
pmset -g logshows no Sleep entry at the drop time. Clamshell keeps your Mac awake; it does not reconnect Remote Control after a network change, expired login, or server-side drop in issue #33041.
Frequently asked questions
Why does Claude Code Remote Control keep disconnecting?
Six causes account for drops: Mac sleep (especially closing a MacBook lid), the claude process exiting, a network or VPN change, an expired claude.ai login, another device taking over or archiving the session, or an open connection bug tracked in GitHub issue #33041. Check pmset -g log first; if lid-close sleep matches your drops, arm Clamshell for Mac.
How do I tell if Mac sleep caused the disconnect?
Note the drop time and run pmset -g log | grep -E "Entering Sleep|Wake from" | tail -40 in Terminal. A Sleep entry at the drop time (with the lid-close reason from Step 2 after closing the lid) and a Wake entry when it returned confirms sleep caused it; arm Clamshell to prevent closed-lid sleep. If the Mac stayed awake across the drop, follow Steps 3 to 6.
Does caffeinate stop Remote Control from disconnecting?
Only when open-lid idle sleep caused the drop. caffeinate blocks idle sleep with the lid open, does not override lid-close sleep, and cannot prevent network, login, or server-side drops (issues #33041 and #50767 report drops with caffeinate active). When closing the lid triggers the drop, use Clamshell instead.
How do I reconnect Remote Control after it drops?
After sleep or a brief network drop, Anthropic's docs say Claude Code reconnects automatically once the Mac is awake and online. If it does not, run /remote-control inside the session, restart claude remote-control in server mode, or resume an exited session with claude --continue or claude --resume.
Can I reconnect from my phone without touching the Mac?
Not once the link fails on the Mac side: Anthropic's documented recovery is running /remote-control on the host machine. Commenters on issue #33041 work around this by keeping SSH into tmux or Screen Sharing available to reach the Mac remotely, which still requires the Mac to stay awake.
Will keeping the Mac awake fix every Remote Control disconnect?
No. Keeping the Mac awake eliminates every drop lined up with a Sleep entry in pmset -g log, including closed-lid drops when paired with Clamshell. It cannot prevent VPN HTTP 403 blocks, expired logins, or the server-side drops tracked in issue #33041.
Why pay $9.99 for Clamshell instead of using pmset disablesleep?
sudo pmset -a disablesleep 1 needs admin rights to enable and disable, applies on battery with no stop, and leaves no menu bar indicator or heat cut-off if you forget to undo it. Clamshell costs $9.99 once (no subscription) so you stop closed-lid Remote Control drops with no sudo, always-on thermal safety, and a 20% battery floor. Test the 7-day free trial (no card required) first.
Try Clamshell free for 7 days
Stop closed-lid Claude Code Remote Control disconnects on your Apple Silicon MacBook with no monitor, no sudo, an always-on heat cut-off, and a 20% battery floor. Normal lid sleep returns when you disarm or quit.
$9.99 for 1 Mac, $19.99 for up to 3 Macs. 7-day free trial with no card required and a 14-day money-back guarantee. Apple Silicon, macOS 14 or later, notarized by Apple. Also available via Homebrew (brew install --cask clamshell) or Setapp.
Related guides
- Arm Clamshell from Claude Code hooks
- Claude Code Remote Control with the MacBook lid closed
- What Claude Code's built-in keep-awake covers, and what it misses
- Keep Claude Code running with the lid closed
- How to keep a MacBook awake with the lid closed
- Claude Code cloud sessions vs running locally on your Mac
Sources checked October 11, 2026: Anthropic's Claude Code Remote Control docs and error reference, GitHub issues #33041, #34500, #50767, and #81832 in anthropics/claude-code, macOS pmset(1) and caffeinate(8) manuals, and Apple's sleep settings guide. Issue states and counts are as of that date; comments are user reports, not confirmed diagnoses. Clamshell details from version 2.0.5 and published documentation. Product names belong to their respective owners.