Yes, but not with stock macOS: Apple's clamshell mode needs an external display. Without one you need a dummy plug, pmset, or an app like Clamshell.
Clamshell for Mac keeps the Mac awake with the lid closed while armed. No sudo, no monitor. Free for 7 days, then $9.99 once.
Download free trialYes, but not with stock macOS settings alone. Apple's clamshell mode only keeps a MacBook running with the lid closed while an external display is attached; without one, the Mac sleeps as soon as the lid shuts. To run with no monitor at all you need an HDMI dummy plug, sudo pmset -a disablesleep 1, or an app such as Clamshell for Mac, a menu bar app that keeps an Apple Silicon MacBook awake lid-closed with no display and no sudo. Here is every option and what each one costs.
What clamshell mode actually is
Clamshell mode is Apple's name for using a MacBook with the lid shut while an external display, keyboard, and mouse do the work. The display requirement is not physics, it is a policy: macOS keeps an internal switch that decides whether closing the lid puts the Mac to sleep, and it only leaves the Mac awake when it detects an external display. No display, no exception; the lid closes and the Mac sleeps within seconds, even mid-task.
- The lid closesmacOS checks whether an external display is attached.
- Display foundThe Mac stays awake and keeps working on that screen.
- No displayNo exception: the Mac sleeps within seconds, even mid-task.
Plenty of situations want the opposite: a long build or download, an AI coding agent working overnight, a Mac used headless over SSH or screen sharing, or just a laptop doing its job from a bag or a shelf. For those, closing the lid should mean "screen off", not "stop everything".
Your options, honestly compared
An external display or an HDMI dummy plug
The official route. A dummy plug (a small adapter that pretends to be a monitor) satisfies the display requirement for around ten dollars; stock macOS typically also wants the Mac on power with an external keyboard or mouse attached.
sudo pmset -a disablesleep 1
Built into macOS and free, this root-level command stops the lid from sleeping the Mac. It is also a blunt instrument: it disables every kind of sleep, system-wide, until you remember to run it again with 0.
A keep-awake app with a closed-display setting
Amphetamine, the best-known keep-awake app, can do closed-lid sessions after enabling its closed-display mode in settings, and its own documentation notes extra setup on Apple Silicon.
A purpose-built app
Clamshell for Mac does one thing: hold ⌥ Option, close the lid, and the Mac keeps running with the screen dark.
- External display or dummy plug. Downsides: it is hardware to buy, carry, and not lose; it occupies a port; and the phantom display it creates is real to macOS, so windows and dialogs can quietly open on a screen that does not exist.
- The pmset command. Leave it on and the Mac stays awake in your bag on battery until it runs flat. It needs admin rights every time, and nothing in the menu bar reminds you it is active.
- Keep-awake apps. Most other keep-awake tools, including
caffeinateand KeepingYouAwake, only prevent idle sleep and do not handle the lid at all. - Clamshell. Open the lid and that Option-close session ends: it is momentary, one lid-close at a time. Arming from the menu bar, the
clamshell://armURL, or Shortcuts instead stays on until you disarm.
Clamshell asks the power manager to skip lid-close sleep only, for the current session, through an unprivileged lid control plus an idle-sleep assertion: no sudo, no kernel extension, no privileged helper. Disarming or quitting retries the restore and warns if macOS refuses it; a restart always returns normal sleep behavior because the switch is never saved across restarts. An optional low-battery switch lets the Mac sleep if the charge drops below a level you choose.
Clamshell gives you clamshell mode with no display attached. Free for 7 days, then $9.99 once.
Download free trialFrequently asked questions
Can a MacBook run with the lid closed without an external monitor?
Yes. Stock macOS only allows it with an external display attached, but an HDMI dummy plug, sudo pmset -a disablesleep 1, or a lid-closed app such as Clamshell for Mac keeps it running with no monitor.
Is Clamshell for Mac the same as Apple's clamshell mode?
No. Apple's clamshell mode is the built-in behavior that needs an external display. Clamshell for Mac is a separate menu bar app that removes the display requirement. It is also unrelated to the App Store app with the same name.
Does the screen stay on under the lid?
No. The built-in display stays black while the lid is closed, which also removes most of the idle power draw. The Mac locks when you open the lid.
Will a MacBook overheat with the lid closed?
The machine draws only what the work demands, and macOS keeps managing thermals as usual. Under heavy sustained load a closed laptop can throttle a little sooner, most noticeably a fanless MacBook Air. Clamshell's thermal safety is always on: at serious or critical thermal pressure it disarms toward normal lid sleep and blocks arming until the Mac cools. Keep the Mac ventilated.
Does the network stay up with the lid closed?
Yes. Wi-Fi stays connected while the Mac is awake, so SSH, screen sharing, and syncs keep working.
Which Macs does Clamshell support?
Apple Silicon Mac laptops on macOS 14 or later. The Option-close gesture needs a lid angle sensor, found in the MacBook Air M2 (2022) or later and the 14-inch and 16-inch MacBook Pro (2021) or later; other Apple Silicon MacBooks arm from the menu bar.
Running AI agents overnight is the most common reason people end up here; that workflow has its own guides: keep Claude Code running with the lid closed, keep Codex running with the lid closed, and run AI agents overnight on a MacBook. Running unplugged? Read using a MacBook lid-closed on battery. If you are choosing a tool, use the direct Clamshell vs Amphetamine vs pmset comparison or the broader guide to keeping a MacBook awake with the lid closed.
Amphetamine, KeepingYouAwake, and other product names are trademarks of their respective owners; comparisons are based on each product's public documentation.