Clamshell for Mac keeps a closed Apple Silicon MacBook awake while armed with no admin rights, helper or sudo, and normal lid sleep returns when you disarm or quit. Every other tool uses one of three routes: an idle-sleep power assertion (caffeinate, KeepingYouAwake), which cannot stop lid sleep; the root-only pmset disablesleep flag (LidRun, Sleepless, and Amphetamine's Closed-Display Mode according to a user report, since its developer does not document the mechanism); or Apple's closed-display mode with an external display.
An animated MacBook with a coding agent deploying a website from its terminal. The Option key is held and the lid closes: the display goes black, but the Mac stays awake, so a dimmed copy of the terminal keeps working above the closed laptop while its front edge fills with light. When the deploy is done, a pointer shows how to lift the lid. Opening it wakes the Mac to its lock screen, which unlocks to the finished run: deployed, with the live address. The lid can then be opened and closed freely.
Clamshell for Mac keeps a MacBook awake with the lid closed while armed, with no helper, no sudo and no external display. Free for 7 days.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell.
Search for a way to keep a MacBook awake with the lid closed and you get a long list of menu bar apps that look interchangeable. Under the hood there are only four mechanisms, and the one an app uses decides almost everything that matters: whether it works with the lid shut, whether it asks for an administrator password, what stays switched on if the app quits or crashes, and whether a restart clears it. This guide explains each mechanism from Apple's own headers and manuals, says which apps use which according to their developers, and shows the Terminal commands that tell you what is holding your Mac awake right now.
Idle sleep and lid sleep are different
macOS has two separate reasons to put a MacBook to sleep. Idle sleep happens when nobody touches the Mac for the time set in System Settings. Lid sleep happens when you close the lid with no external display attached. Every keep-awake mechanism stops idle sleep. Only some of them stop lid sleep.
1. Power assertions: caffeinate, KeepingYouAwake
A power assertion is a request a process makes to the power manager: do not idle sleep while I hold this. caffeinate is Apple's command-line front end for it. caffeinate -i make, an example from its manual, holds an assertion that prevents idle sleep as long as make runs. KeepingYouAwake describes itself as a small wrapper around caffeinate, and Claude Code runs caffeinate during a session for the same reason.
The limit is written into Apple's own header. The documentation for kIOPMAssertPreventUserIdleSystemSleep in IOPMLib.h says the system may not idle sleep while it is held, but "may still sleep for lid close, Apple menu, low battery, or other sleep reasons." That is why caffeinate and the apps built on it stop working the moment you close the lid. KeepingYouAwake's README says so plainly: it only prevents sleep on desktop Macs and laptops with an open lid. The caffeinate guide covers each flag.
The upside is cleanup. An assertion belongs to the process that created it. We started caffeinate -i, confirmed its assertion in pmset -g assertions, killed it with kill -9, and the assertion was gone a second later. Nothing is left behind, so these tools are a safe choice whenever the lid stays open.
2. The pmset disablesleep flag: LidRun, Sleepless, Amphetamine
sudo pmset -a disablesleep 1 sets a system-wide value that pmset -g reports as SleepDisabled 1. While it is on, the Mac does not enter system sleep at all, lid close included, on battery too. It is the most common lid-closed mechanism, and it has three properties to understand:
- It needs root.
pmsetonly changes power settings for an administrator, so any app that uses it has to get root somehow. - It is not tied to a process. Unlike an assertion, the flag stays at 1 after the app or Terminal window that set it goes away, until something sets it back to 0.
- It is undocumented. The
pmset(1)manual on macOS lists the supported power settings and does not listdisablesleep. The pmset guide covers what that means.
Apps handle the root requirement in different ways, according to their own pages:
- LidRun. Its help center says Closed-Lid Mode, a Pro feature, runs
pmset disablesleep, and that macOS asks for an administrator password each time unless you approve its privileged helper. Its own blog post says it sets the flag back to 0 when the mode turns off or the app quits, and the help center says the helper restores normal sleep if LidRun quits unexpectedly. Without the helper, the reset after a crash happens on the next launch. - Sleepless. Its README says it toggles
pmset disablesleepand that its installer adds a sudoers rule for exactly two commands,pmset -a disablesleep 0and1. It turns the flag off with its switch, a timer or a battery floor, and needs macOS 26. - Amphetamine. The developer does not document how Closed-Display Mode works. A user report on Amphetamine's GitHub (issue #19, August 2026) logs
SleepDisabledat 1 during Closed-Display Mode sessions. On Apple Silicon laptops, the developer's Power Protect add-on fixes problems after connecting or disconnecting power; it installs a script and a configuration file in/private/etc/sudoers.d/, authorized once with Touch ID or an admin password.
Our roundup of 20 keep-awake tools found the same pattern in Keepresso (a password once per app run, or an optional admin helper approved once) and Adrafinil (a small root helper).
3. Apple's closed-display mode
Apple's own way to use a MacBook with the lid closed is closed-display mode, often called clamshell mode. Apple's support pages say the Mac needs to be connected to power and using an external display, keyboard and mouse. Nothing is installed and no admin rights are needed, but the Mac goes back to normal lid sleep once the display is gone. An HDMI dummy plug imitates a display to get the same result. The clamshell mode guide compares the workarounds.
4. An app with no admin step: Clamshell
Clamshell for Mac keeps a closed MacBook awake only while you have it armed, and stops idle sleep from interrupting work in the same session. It needs no sudo, admin password, kernel extension, driver or privileged helper. Three behaviors matter in practice:
- Power changes are handled. Clamshell stays armed through every plug and unplug and through wake.
- It cleans up after itself. Clamshell restores normal lid sleep on disarm and quit, warns you if that does not complete, and has crash recovery.
- Restarts are covered too. Restarting always brings back normal lid-close sleep.
Clamshell also arms with an external display connected, so a closed MacBook at a desk stays awake on battery too, without the power, keyboard and mouse Apple's closed-display mode asks for. The what is Clamshell guide covers the rest.
What is left behind after a quit or crash?
This is where the mechanisms differ most, and where most reviews say nothing. A forgotten sleep switch is how a MacBook ends up hot in a backpack.
- Assertions end with the process. Quit, crash or
kill -9all release them. - The pmset flag stays at 1 until something resets it. Whether a restart clears it is disputed: Sleepless's README says a reboot resets it, while Apple documents nothing, so our advice is to check
pmset -gafter a restart rather than assume. Apps add their own cleanup, such as LidRun's helper. - Clamshell restores normal lid sleep on disarm and quit. After an unexpected exit, the direct edition relaunches when its crash-recovery agent is permitted, and its startup restores normal lid sleep before anything else. A restart does the same.
Clamshell keeps a closed MacBook awake with no helper and nothing left switched on, with thermal safety always on. Free for 7 days, then $9.99 once for one Mac. 14-day money-back guarantee.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. Also on Setapp.
Keep-awake tools by mechanism (October 2026)
Each cell comes from the tool's own website, README, help center or manual, checked October 8, 2026. Where a developer does not say, the cell says so.
| Tool | Mechanism | Admin or helper | After quit or crash | Restart | Thermal |
|---|---|---|---|---|---|
| Clamshell | Only while armed. Ends on disarm or quit | None | Restores normal lid sleep on disarm or quit. Direct edition relaunches after a crash when permitted and restores lid sleep on startup | Restores normal lid sleep | Always on: disarms at serious or critical |
| LidRun Pro | System-wide. pmset disablesleep |
Needs root. A privileged helper you approve once, or your admin password each time | Sets it back to 0 on quit; helper restores sleep after an unexpected quit; without it, reset on next launch | Not stated | Can step back at serious or critical |
| Amphetamine | Not documented. Closed-Display Mode; a user report logs SleepDisabled at 1 |
Add-on only. App: none. Power Protect add-on: a script plus a configuration file in /private/etc/sudoers.d/, Touch ID or admin password once |
Not stated | Not stated | Not stated |
| Sleepless | System-wide. pmset disablesleep |
sudoers rule, scoped to two pmset commands | Off by switch, timer or battery floor; quit and crash not stated | README: reboot resets it | Not stated |
pmset by hand |
System-wide. sudo pmset -a disablesleep 1 |
Needs sudo | Stays on until you set it to 0 | Check pmset -g |
None |
| Closed-display mode | Extra hardware. macOS, with display, power, keyboard and mouse attached | None | Nothing to crash; ends when the display is gone | Nothing saved | macOS only |
| caffeinate | Lid sleeps. Idle-sleep assertion only | None | Released with the process | Nothing saved | Lid open use |
| KeepingYouAwake | Lid sleeps. Wraps caffeinate | None | Released with caffeinate | Nothing saved | Lid open use |
Where the others are better: LidRun adds process auto-detection and supports Intel Macs, Sleepless is free and fits in one auditable file, Amphetamine is free with many triggers, and caffeinate and KeepingYouAwake are free and leave nothing behind when the lid stays open. Clamshell needs Apple Silicon and macOS 14 or later, and costs $9.99 once after the trial.
How to check what is keeping your Mac awake
Two read-only Terminal commands show which mechanism is active, whatever app you use:
- List assertions.
pmset -g assertionsshows every process holding a power assertion, including caffeinate and keep-awake apps. These only block idle sleep. - Check the pmset flag.
pmset -g | grep SleepDisabledprintsSleepDisabled 1while the flag is on. If nothing should be running,sudo pmset -a disablesleep 0turns it off; the undo guide has the full check.
Which mechanism fits your job?
The lid stays open
Use an assertion: caffeinate, KeepingYouAwake or Amphetamine. Free, nothing left behind.
A monitor is on your desk
Apple's closed-display mode. Nothing to install.
Lid closed, no monitor, no admin
Clamshell for Mac: no admin rights, no helper, a restart restores normal lid sleep, thermal safety always on.
Try Clamshell freeYou want pmset, deliberately
Use an app with its own cleanup, or run it by hand and check SleepDisabled before the Mac goes in a bag.
Frequently asked questions
How do keep-awake apps keep a Mac awake with the lid closed?
They use one of three routes. Most switch the system-wide SleepDisabled flag that sudo pmset disablesleep 1 sets, which needs root, so the app adds a privileged helper or a sudo rule. Apple's closed-display mode keeps the Mac awake while an external display, power, keyboard and mouse are attached. Clamshell for Mac keeps the Mac awake with the lid closed while armed and needs no admin rights. Idle-sleep power assertions, which caffeinate creates, do not stop lid sleep.
Why does caffeinate not work with the lid closed?
caffeinate creates power assertions. Apple's IOKit header says the PreventUserIdleSystemSleep assertion stops idle sleep, but the system may still sleep for lid close, the Apple menu, low battery or other reasons. Closing the lid is a separate sleep path that an assertion does not block.
Why do some keep-awake apps ask for an admin password or install a helper?
Changing the SleepDisabled flag with pmset disablesleep needs root. Apps that use it either ask for an administrator password each time, install a privileged helper once (LidRun), add a scoped sudoers rule (Sleepless), or install a script plus a sudoers file, authorized once with Touch ID or an admin password (Amphetamine's Power Protect add-on). Clamshell for Mac needs no admin rights.
What happens if a keep-awake app crashes?
It depends on the mechanism. A power assertion is released when its process exits. The pmset SleepDisabled flag stays on until something sets it back to 0, so apps that use it need their own cleanup: LidRun says its helper restores sleep if the app quits unexpectedly. Clamshell's direct edition relaunches after an unexpected exit when its crash-recovery agent is permitted and restores normal lid sleep on startup, and a restart does the same.
How can I tell what is keeping my Mac awake?
Run pmset -g assertions in Terminal to list processes holding power assertions and pmset -g | grep SleepDisabled to see whether the pmset flag is on.
Does Clamshell need sudo or leave anything to undo?
No. Clamshell for Mac needs no sudo, admin password, kernel extension or privileged helper, and there is nothing to undo: normal lid sleep returns when you disarm or quit, and a restart does the same.
Related guides
- Clamshell vs Macchiato
- How to keep a MacBook awake with the lid closed
- Is it safe to run a MacBook with the lid closed?
- Best apps to keep a MacBook awake (2026)
- Why caffeinate does not work with the lid closed
- What sudo pmset disablesleep 1 does
- How to undo pmset disablesleep
- LidRun vs Amphetamine vs Clamshell
- KeepingYouAwake with the lid closed
- What is Clamshell for Mac?
Sources checked October 8, 2026: Apple's IOPMLib.h header in the macOS SDK; the caffeinate(8) and pmset(1) manuals; Apple's support pages on a closed laptop with an external display and accessories with the lid closed; KeepingYouAwake's README; LidRun's help center and its pmset alternative post; Sleepless's README; Amphetamine's Power Protect page and GitHub issue #19. The assertion cleanup test was run on an Apple Silicon MacBook on October 8, 2026. Clamshell behavior is described from its changelog and FAQ. Clamshell is the publisher of this guide and an independent app, not affiliated with or endorsed by Apple. Product names belong to their respective owners. Rechecked October 15, 2026: Keepresso's README, the Amphetamine Power Protect page and App Store listing and Amphetamine issue #19 (a user report).