Closing a MacBook lid triggers a different sleep path from ordinary idle sleep. These guides explain what macOS does, which workarounds actually affect the lid, and how to keep long-running work alive without pretending a monitor is attached. Clamshell, a Mac menu bar app, is one option: it keeps a MacBook awake with the lid closed, with no sudo and no external display.
Start here
How to keep a MacBook awake with the lid closed
Every method, with or without a monitor: Apple's setup, dummy plugs, caffeinate, pmset, Amphetamine, LidRun, and Clamshell.
Clamshell mode without an external display
The official setup, dummy plugs, software options, and honest trade-offs.
Coding agents and long runs
Keep coding agents running with the lid closed
Claude Code, Codex, Cursor, terminal jobs, builds, downloads, and SSH sessions.
MacBook の蓋を閉じたまま Claude Code を動かし続ける方法
日本語版
Keep Codex running with the lid closed
Codex CLI, the desktop app, and Codex cloud tasks: which ones need the Mac awake.
Use Codex from your phone with the lid closed
Codex in the ChatGPT phone app, SSH and tmux: what a closed MacBook lid breaks, and how to keep Codex reachable.
Keep a Cursor agent running with the lid closed
Cursor editor agents, the Cursor CLI, and Cloud Agents: why Cursor's wake lock is not enough.
Run AI coding agents overnight on a MacBook
What stops overnight runs, a pre-flight checklist, and how to check progress in the morning.
Lid closed on battery
How each option behaves on battery, low-battery cutoffs, and heat.
Codex "Keep this Mac awake" not working with the lid closed
Why the Codex setting stops at a closed lid, and how to keep Codex running anyway.
Does Claude Code prevent sleep with the lid closed?
What Claude Code's built-in caffeinate covers, and what closing the lid still stops.
Claude Code cloud vs local on your Mac
When cloud sessions win, when your own Mac wins, and how to run both.
Claude Code Remote Control with the lid closed
What happens to your phone session when the MacBook sleeps, and every way to keep it working.
Computer use and iOS Simulator with the lid closed
Let agents use the screen with the lid shut: dummy plugs, virtual displays and Clamshell compared.
Everyday uses with the lid closed
Play music with the MacBook lid closed
Spotify, Apple Music, AirPlay and speakers with the lid shut and no monitor.
Does a MacBook keep downloading with the lid closed?
What Power Nap covers, what it does not, and how to finish big downloads lid closed.
Use a MacBook as a home server with the lid closed
Plex, Jellyfin, SSH and screen sharing on a closed MacBook, plus power and battery care.
Is it safe to run a MacBook with the lid closed?
Heat and surfaces, thermal pressure, battery care on power, camera covers and a checklist for long runs.
Is it safe to keep a MacBook running in a bag?
Heat, airflow and what thermal protection can and cannot do.
Apps compared
Clamshell vs Amphetamine vs pmset
An honest comparison of setup, scope, recovery, price, and the built-in Apple route.
LidRun vs Amphetamine vs Clamshell
A fair three-way comparison of price, setup, safeguards, and agent features.
Hold My Lid vs Clamshell
Two paid lid-closed apps for coding agents: agent detection versus a no-admin switch.
Adrafinil vs Clamshell
Free and open source with a root helper, or paid with no admin rights and older macOS support.
Amphetamine alternatives for closed-lid use
Where Amphetamine is strong, and the alternatives on Apple Silicon.
What is Clamshell for Mac?
What the app does, what it is not, how it works, and what it costs.
Best apps to keep a MacBook awake, lid closed or open
15 keep-awake apps and commands, lid open or closed, checked in October 2026.
Keepresso vs Clamshell
Free, open source and agent-aware with an admin helper, or a no-admin paid switch.
Sleepless vs Clamshell
A free MIT pmset wrapper for macOS 26, or a no-sudo app for macOS 14 and later.
Helmlet vs Clamshell
Fan control and a privileged helper, or no admin rights and a 7-day trial.
Amphetamine not working with the lid closed
Step-by-step fixes for Closed-Display Mode, Power Protect and timed sessions.
KeepingYouAwake with the lid closed
Why it sleeps anyway when the lid closes, and which fixes work.
How macOS sleep works
How keep-awake apps work with the lid closed
Assertions, pmset disablesleep, closed-display mode and the IOKit lid control: admin rights, crash cleanup and which apps use which.
Why caffeinate does not keep a Mac awake with the lid closed
What each assertion flag does and why lid-close sleep is different.
What pmset disablesleep does on a Mac
How the undocumented switch behaves, how to inspect it, and how to undo it safely.
How to undo sudo pmset disablesleep 1
Check SleepDisabled, turn it off with one command, and confirm it stuck.