I extended Claude Code Remote so it works even when my dev machine is asleep
retained text
**Claude Code Remote is great until your dev machine goes to sleep.** Connecting from my phone to Claude Code on my MacBook works beautifully, right up until the MacBook sleeps and the connection goes dark and it’s not good for the MacBook to keep it awake constantly. I guess maybe a lot of you might have already solved this but posting just in case it’s useful to anyone. My setup: a Mac Mini as an always-on home server (Cloudflare tunnel, MCP endpoints, other services), MacBook as the dev machine. **The fix: a wake button.** I described what I wanted as “a wake-up packet from the always-on machine” — and it turns out I’d reinvented Wake-on-LAN, which has existed for decades. So we built The Lantern: \- A page on a subdomain, served by the always-on Mini, behind Cloudflare Access so only I can press it \- Tap → the Mini broadcasts a WoL magic packet to the MacBook over the LAN, plus a TCP knock to trigger Apple’s Bonjour sleep proxy (Wi-Fi Macs often wake via that path) \- MacBook needs one toggle on: System Settings → Battery → “Wake for network access” \- A tiny launchd job on the MacBook checks every few minutes that the Claude app is running and reopens it if an update or crash closed it — so a woken machine always has someone home \- The page polls and the lantern icon lights up when the MacBook answers — then I connect with Claude Code Remote **Stack:** one zero-dependency Node server on the Mini (it crafts the magic packet itself — no Python, nothing to pip install), one HTML page, two small launchd plists. That’s it. **Why not just run Claude Code on the Mini?** Separation of concerns — the Mini is effectively production, running services 24/7. The dev environment lives on the MacBook. You don’t develop on your prod server. **The use case:** holiday soon. If inspiration strikes at the beach, I tap one button, wait for the glow, and I’m in a full session on my own machine from anywhere in the world — instead of leaving a laptop awake for two weeks.
document fetched 2026-09-07 00:36 · canonical https://reddit.com/r/ClaudeCode/comments/1w8zo58/i_extended_claude_code_remote_so_it_works_even