JTBack to home
4 min read

Running Claude Code Remote Control with the lid closed

Claude Code Remote Control runs on my own Mac, so closing the lid used to end the session. Amphetamine keeps the MacBook awake with the lid shut, for free. Here is the setup and the honest caveats.

Key takeaways

  • Remote Control connects the Claude web or mobile app to a Claude Code session still running locally on your own Mac, not the cloud.
  • Requires Claude Code version 2.1.51 or later, a claude.ai login, and a paid plan such as Pro, Max, Team or Enterprise.
  • Closing a MacBook lid triggers full system sleep by default, which pauses the local session until the lid reopens.
  • Amphetamine, a free menu bar app, uses a public macOS API to keep the Mac awake lid-closed with no external display or power needed.
  • Caveats: heat builds up near the hinge, the trick is an unofficial use of the API, and the session still needs to stay online.

I just set up Claude Code's Remote Control on my M5 MacBook Pro, so I can start a session at home and keep driving it from my phone on the way out the door. The one thing standing between me and that was the laptop lid: close it, and by default the whole session goes to sleep with the machine. The fix turned out to be one free menu bar app and one checkbox, so here is the setup, and the parts of it worth being honest about.

What Remote Control actually is

Remote Control is not the same thing as Claude Code on the web, which runs your session inside Anthropic's own cloud infrastructure. Remote Control instead connects the Claude web app at claude.ai/code, or the Claude mobile app, to a Claude Code session that keeps running on your own machine. The compute, the filesystem, the MCP servers, the tools: all of it stays local. The browser tab or the phone screen is just a window into that local session.

You start it three ways: /remote-control from inside an existing session, claude --remote-control (or the shorter claude --rc), or claude remote-control as a standalone server if you want to expose more than one session at once. It needs Claude Code v2.1.51 or later, a claude.ai login, and a paid plan: Pro, Max, Team, or Enterprise, per the Remote Control docs. Worth being precise about this, since it is easy to blur the line: Remote Control itself is not free, it rides on a paid Claude plan. The free part of this post is further down.

Because the whole thing hinges on a local process, the docs are blunt about what keeps it alive: the local process must keep running. It tolerates a brief laptop sleep or a dropped network connection and reconnects once the machine is back. But if the Mac stays awake and offline for more than about ten minutes, the session times out and exits.

The lid problem

On a MacBook, closing the lid triggers full system sleep by default. That suspends every running process, including the terminal and the claude process underneath it, so a Remote Control session just pauses until you physically open the laptop again. Not useful if the whole point is to leave the thing shut in a bag or on a shelf and drive it from a phone.

Apple does support running a MacBook lid-closed, in clamshell mode, but only under a specific combination: an external display, an external keyboard and mouse, and the machine on AC power, all three at once. That is built for a desk setup with a docked laptop, not for a closed laptop quietly keeping a background session alive on its own.

The free fix: Amphetamine

The tool that closes the gap is Amphetamine, a free, ad-free menu bar utility on the Mac App Store. Its Closed-Display Mode uses a public macOS API to keep the Mac awake with the lid closed, without needing an external display, keyboard, mouse, or power adapter. It will run on battery with nothing plugged in and no monitor attached. On Apple Silicon, folding the lid shut still puts the internal display to sleep, to avoid burn-in, but the CPU and background processes keep running underneath it.

The setting that matters is called Allow system sleep when display is closed. Unchecking it is what turns Closed-Display Mode on, and you can set it in three places: for the session that is currently running, from the menu bar icon under Current Session Details; as the default for any new manual session, in Preferences under the Sessions tab, Non-Trigger Sessions; or inside a specific Trigger, in Preferences under the Triggers tab, so a session with Closed-Display Mode starts automatically, for example whenever AC power connects. Once it is unchecked and a session is running, close the lid.

That is the whole setup. Nothing else to install for the basic behavior; it is built into the App Store app. If you want to go further, Amphetamine's GitHub has two optional extras: Power Protect, which fixes an Apple Silicon quirk where plugging or unplugging AC mid-session can end a closed-display session, and Amphetamine Enhancer, which adds a fail-safe on top. Neither is required to get this working.

The honest caveats

Running a laptop lid-closed sidesteps Apple's own safeguards on purpose, and the vents on a MacBook sit right near the hinge, so heat can build up faster than you would expect. I keep mine on an open, ventilated surface, plugged in for anything longer than a short session, and never inside a bag or a closed drawer.

It is also an unofficial way to run the machine. Apple's documented clamshell mode still assumes an external display and a power connection; Closed-Display Mode is a public API used in a way Apple does not officially sanction for this, even though it is widely used. And keeping the Mac awake does not solve everything on its own: the Remote Control network timeout is still in effect, so the machine also has to stay actually online, not just powered on.

Closing the lid, for real

With Amphetamine running, the lid on my MacBook is just a lid again. The only piece that was strictly required to get here, on top of Remote Control's own paid plan, was a free menu bar app and one checkbox.