Clamshell for Mac keeps a closed Apple Silicon MacBook awake with the IOKit lid sleep-state control, which needs no admin rights, helper or sudo. 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, Amphetamine's Closed-Display Mode by user reports); or Apple's closed-display mode with an external display.
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.
Download free trialApple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or buy now, $9.99
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. The macOS power manager publishes the second one as a registry value: AppleClamshellCausesSleep, which Apple's IOPM.h header describes as true when the system will sleep on lid close and false when it will not, "typically external display mode". 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 file in/private/etc/sudoers.d/, with Touch ID or an admin password once.
Our roundup of 15 keep-awake apps found the same pattern in Keepresso (an 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. When those are attached, macOS sets AppleClamshellCausesSleep to false on its own. 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. The IOKit lid sleep-state control: Clamshell
The power manager in macOS, IOPMrootDomain, accepts a call that sets whether closing the lid causes sleep. Its selector, kPMSetClamshellSleepState, is defined in the public macOS SDK header IOPMLibDefs.h, and a normal user process can make the call. Apple does not document its behavior beyond that definition, so treat it as an unsupported interface, the same way you would treat the undocumented disablesleep setting.
Clamshell for Mac uses this control while armed, together with a PreventUserIdleSystemSleep assertion so idle sleep does not interrupt work. That combination is why it needs no sudo, admin password, kernel extension, driver or privileged helper, and why it never touches SleepDisabled. Two details follow from the mechanism:
- macOS can clear it. Power and wake transitions can reset the lid policy, so Clamshell re-applies itself on every plug and unplug rather than assuming it stuck.
- It is not tied to the process. Like the pmset flag, the lid setting stays until it is reset, which is why Clamshell restores it on disarm and quit, retries if needed, warns you if macOS refuses, and has crash recovery.
- It is not saved across a restart. Restarting always brings back normal lid-close sleep.
Clamshell also pauses instead of arming while an external display is connected, because Apple's closed-display mode already covers that case. 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. Its lid change is never saved across a restart.
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.
Download free trialKeep-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 | IOKit lid sleep-state control plus an idle-sleep assertion | None | Restores normal lid sleep on disarm or quit. Direct edition relaunches after a crash when permitted and restores lid sleep on startup | Never saved | Always on: disarms at serious or critical |
| LidRun Pro | pmset disablesleep |
Privileged helper approved once, or an 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 | Closed-Display Mode, not documented; a user report logs SleepDisabled at 1 |
App: none. Power Protect add-on: sudoers file, admin once | Not stated | Not stated | Not stated |
| Sleepless | pmset disablesleep |
Scoped sudoers rule for two pmset commands | Off by switch, timer or battery floor; quit and crash not stated | README: reboot resets it | No limit stated |
pmset by hand |
sudo pmset -a disablesleep 1 |
sudo | Stays on until you set it to 0 | Check pmset -g |
None |
| Closed-display mode | macOS, with display, power, keyboard and mouse attached | None | Nothing to crash; ends when the display is gone | Nothing saved | macOS only |
| caffeinate | Idle-sleep assertion; the lid still sleeps | None | Released with the process | Nothing saved | Lid open use |
| KeepingYouAwake | Wraps caffeinate; the lid still sleeps | 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
Three 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. - Check the lid policy.
ioreg -r -k AppleClamshellCausesSleep -d 1prints"AppleClamshellCausesSleep" = Yeson a laptop that will sleep on lid close, andNoin closed-display mode. Clamshell's own state is its menu bar icon, or the Clamshell Status action in Shortcuts.
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: the IOKit lid control, no helper, never saved across a restart, 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 uses the IOKit lid sleep-state control, which 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 sudoers file (Amphetamine's Power Protect add-on). Clamshell for Mac does not use that flag and 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 its lid change is never saved across a restart.
How can I tell what is keeping my Mac awake?
Run pmset -g assertions in Terminal to list processes holding power assertions, pmset -g | grep SleepDisabled to see whether the pmset flag is on, and ioreg -r -k AppleClamshellCausesSleep -d 1 to see whether macOS reports that closing the lid causes sleep, which reads No in closed-display mode.
Does Clamshell use pmset disablesleep?
No. Clamshell for Mac never changes SleepDisabled. While armed it uses the unprivileged IOKit lid sleep-state control on IOPMrootDomain plus a PreventUserIdleSystemSleep assertion, with no sudo, admin password, kernel extension or privileged helper.
Related guides
- 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, IOPM.h and IOPMLibDefs.h headers 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.