Use a cloud session when the task only needs your GitHub repo: it keeps running after you close the laptop. Stay local when the work needs this Mac: its files, Xcode and the iOS Simulator, local models, or keys on disk. To keep local work running with the lid shut and no monitor, arm Clamshell for Mac.
Clamshell for Mac keeps the Mac awake with the lid closed while armed, so local Claude Code sessions keep working. Free for 7 days.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
Searches like "Claude Code web vs CLI" and "run Claude Code without keeping laptop open" usually hide one question: does this job need my Mac, or just my code? Anthropic made the cloud answer much easier this autumn. This page compares the two honestly, including the cases where you do not need Clamshell at all.
What changed: cloud sessions are generally available
On September 23, 2026, Anthropic updated its announcement: cloud sessions, previously called Claude Code on the web, are now generally available for Pro, Max and Team users, and for Enterprise users with eligible seats. Its cloud docs say a session "keeps running after you close your laptop". You can start one at claude.ai/code, from the Code tab in the Claude mobile app, by choosing Cloud in the desktop app, or with claude --cloud "task" in a terminal.
Claude Code web vs CLI: where the work actually runs
"Web" and "CLI" describe where you type, not where the work happens. The CLI and the desktop app can run sessions locally or in the cloud, and claude.ai/code can steer a local session through Remote Control. The difference that matters is the machine, as of October 2026:
| Question | Cloud session | Local session on your Mac |
|---|---|---|
| Where it runs | A fresh Ubuntu 24.04 x86_64 VM per session | macOS on your Apple Silicon Mac |
| Lid closed | Keeps running | Only if the Mac stays awake |
| Code access | Clones from GitHub, or uploads a git bundle under 100 MB without untracked files | Any folder, tracked or not |
| Tools | Common runtimes, Docker, PostgreSQL and Redis preinstalled, plus your setup script | Whatever you installed, including Xcode and macOS apps |
| iOS Simulator | No | Yes |
| Network | Limited by default to an allowlist you can change | Your network, VPN and local services |
| Usage | Shares your plan's rate limits, no separate VM charge | Shares your plan's rate limits, runs on hardware you own |
The cloud details come from Anthropic's cloud environments docs and the cloud sessions docs, including their limitations section.
When a cloud session is the better choice
- The task lives entirely in a GitHub repo. Bug fixes, refactors, docs, test repair: if everything Claude needs is pushed, the cloud is simpler than keeping a laptop awake.
- You want several tasks at once. Each
claude --cloudcall starts its own session, and they run in parallel without fighting over your laptop's CPU. - Your Mac will be off, or in a bag. A cloud session does not care. A local session needs a Mac that is awake and cool.
- You want PR babysitting. Auto-fix watches a pull request and responds to CI failures and review comments from the cloud.
If that describes your job, you do not need a lid-closed tool for it. Close the laptop and go.
When running locally on your Mac wins
- macOS-only tools. Xcode, the iOS Simulator and Mac apps exist only on the Mac. Anthropic's iOS Simulator docs say the simulator pane works in local sessions only, because a cloud machine cannot reach the simulators on your Mac. Computer use in the CLI also controls your own Mac's screen.
- Files that are not in git. Cloud bundles leave out untracked files and, on macOS, uncommitted changes to files named like
.envor keys. Large datasets, local databases and scratch folders stay behind. - Private keys and credentials on the device. SSH keys, signing certificates in your Keychain and VPN access to internal services do not travel to the VM. For some teams that is the point.
- Local models and services. A model served by Ollama or LM Studio on your Mac, or a dev server on
localhost, is reachable only from the Mac. - Repos outside GitHub. Cloud sessions can take a GitLab or Bitbucket repo as an uploaded bundle, but per Anthropic's docs they cannot push results back to that remote.
- Long idle waits. Cloud sessions stop after a period of inactivity, and background work running at that moment is not restored. A local session waits as long as the Mac stays up.
Decide in two questions
Does not need your Mac
Cloud session. Push first: the VM clones your GitHub remote at your current branch, not your local checkout.
Needs your Mac, lid can stay open
Local session on power. Claude Code's built-in keep-awake covers idle sleep; caffeinate -i claude closes its known gaps. See what the built-in keep-awake covers.
Needs your Mac, lid has to close
Local session with Clamshell armed. The Mac stays awake and online with the lid shut and the built-in display black, with no monitor, sudo or admin rights.
Run Claude Code locally without keeping the laptop open
- Install Clamshell and open it once. It runs from the menu bar on Apple Silicon MacBooks with macOS 14 or later.
- Start your local session. Run
/remote-controlif you want to steer it from your phone. Anthropic's docs say Remote Control needs the computer to stay on and theclaudeprocess to keep running. - Arm and close. The menu bar menu arms for the next close only; holding Option while closing works on a MacBook Air M2 (2022) or later or a 14-inch or 16-inch MacBook Pro (2021) or later. Disconnect external displays first, since Clamshell pauses while one is connected.
Heat and power stay on your side of the trade: Clamshell disarms toward normal lid sleep at serious or critical thermal pressure, and an optional Disarm on low battery setting is off by default. It does not detect Claude Code or end the session when a task finishes. The Claude Code lid-closed guide walks through a full phone session.
Clamshell keeps your Mac awake with the lid closed. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.
Download free trialMove work between cloud and local
- Local to cloud:
claude --cloud "task"starts a new cloud session for the current repo. Per Anthropic, the CLI cannot push an existing terminal session to the cloud; the desktop app can, from its Open in menu. - Cloud to local:
claude --teleportpulls a cloud session and its branch into your terminal, which needs a clean working tree and a checkout of the same repo. - A practical split: plan locally, push the plan, run the long execution in the cloud, then teleport back for anything that needs Xcode or local services.
Other ways to keep a local session going lid-closed
External display
Apple's closed-display mode needs power, a display, and an external keyboard and mouse. The better fit at a desk with that hardware.
An always-on Mac
A Mac mini or other desktop Mac that never closes avoids the lid problem altogether, if you have one.
sudo pmset -a disablesleep 1
Free and works lid-closed, but it is a persistent system-wide admin switch. See how to undo it.
Frequently asked questions
Can I run Claude Code without keeping my laptop open?
Yes, in two ways. A Claude Code cloud session runs on Anthropic's infrastructure and keeps running after you close your laptop. A local session keeps running with the lid closed only if something keeps the Mac awake, such as an external display setup, sudo pmset -a disablesleep 1, or a lid-sleep app like Clamshell for Mac.
Do Claude Code cloud sessions cost extra?
As of October 2026, Anthropic's docs say cloud sessions share rate limits with the rest of your Claude and Claude Code usage and that there is no separate compute charge for the cloud VM. They are available on Pro, Max and Team plans, and for Enterprise users with eligible seats.
Can a Claude Code cloud session use my local files or the iOS Simulator?
No. A cloud session runs in an Ubuntu Linux VM that clones your GitHub repository or receives an uploaded bundle of a git repository. Untracked files are not included, and Anthropic's docs say the iOS Simulator pane works in local sessions only because a cloud machine cannot reach the simulators on your Mac.
What is the difference between Claude Code Remote Control and a cloud session?
Remote Control lets you steer a session that runs on your own machine from a phone or browser, so the machine has to stay awake. A cloud session runs on Anthropic's infrastructure, so it keeps going when your computer is closed or off, but it cannot reach your local files, apps or keys.
Can I move a Claude Code session between local and cloud?
Partly. From the CLI you can start a new cloud session with claude --cloud and pull a cloud session into your terminal with claude --teleport, but you cannot push an existing terminal session to the cloud. The desktop app can send a local session to the cloud from its Open in menu.
Related guides
- Does Claude Code keep your Mac awake with the lid closed?
- Let agents use the screen with the MacBook lid closed
- Keep Claude Code running with the lid closed
- Run AI coding agents overnight on a MacBook
- Keep Codex running when you close your MacBook lid
- Codex Keep this Mac awake not working with the lid closed
Sources checked October 5, 2026: Anthropic's Claude Code on the web announcement and its September 23, 2026 update, and the Claude Code docs for cloud sessions, cloud environments, Remote Control, the iOS Simulator pane and computer use; Apple's closed-display guidance. Clamshell behavior is described from its changelog and FAQ. Clamshell is an independent app, not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.