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.
An animated MacBook rendering an image tile by tile, with a progress bar, the tile count and the time so far. The Option key is held and the lid closes: the display goes black, but the Mac stays awake, so a dimmed copy of the render keeps working above the closed laptop while its front edge fills with light. When the render is done, a pointer shows how to lift the lid. Opening it wakes the Mac to its lock screen, which unlocks to the finished image, saved to disk. The lid can then be opened and closed freely.
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.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. On your phone? Send the Mac download link to yourself.
Yes, 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.
Clamshell for Mac in three steps
- Install it and open it. Download the free trial from clamshell.dev, or run
brew install --cask clamshell, then open Clamshell once. It runs in the menu bar. - Arm it. Right-click the menu bar icon to arm until you turn it off. To arm for the next close only, press both Option keys, or hold ⌥ Option while you close the lid on a MacBook with a lid angle sensor. Check that the menu bar icon shows armed.
- Close the lid. The built-in display stays black and the Mac keeps running, on power or battery, with no external display and no sudo. Disarm from the menu bar or quit Clamshell when you are done, and normal lid sleep is back.
It needs an Apple Silicon MacBook on macOS 14 or later, and costs $9.99 once after a 7-day trial. It is not Apple's clamshell mode, which still needs an external display: Clamshell for Mac is a separate, closed-source app from clamshell.dev and Setapp, and the Mac App Store app called Clamshell is unrelated. The free routes, a dummy plug and pmset, are compared below with 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 Apple's rule, not a hardware limit: macOS keeps a closed MacBook awake only when it detects an external display. No display, no exception; the lid closes and the Mac sleeps within seconds, even mid-task.
Apple spells out the setup on its external display support page: with the lid closed, make sure the Mac is connected to power and using an external keyboard and mouse. So stock clamshell mode means four things together: the lid closed, an external display, power, and an external keyboard and mouse.
- 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".
Running a MacBook headless, with no display at all and reached over SSH or Screen Sharing, is exactly the case stock clamshell mode leaves out.
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 $3.50 to about $10; 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 menu also covers the next close only, while right-clicking the menu bar icon or arming from Shortcuts stays on across lid reopenings until you disarm.
A connected display does not pause Clamshell. It arms with or without one: if a TV, projector or AirPlay mirrors your screen, the picture stays there when the lid closes, and with a monitor connected the closed Mac stays awake, even on battery. Sidecar is the exception: macOS ends Sidecar when the lid closes, so Clamshell locks the Mac and turns its displays off.
Clamshell keeps the Mac awake through a lid close only while armed, with no sudo, no kernel extension and no privileged helper. Disarming or quitting returns normal lid sleep and warns if that does not complete; a restart always returns normal sleep behavior. A low-battery switch, on by default, lets the Mac sleep when the battery reaches 20%.
Clamshell gives you clamshell mode with no display attached. Free for 7 days, then $9.99 once.
Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. Also on Setapp.
Frequently asked questions
What is clamshell mode on a MacBook?
Clamshell mode is the common name for Apple's built-in way to use a MacBook with the lid closed. Apple's support page asks for three things besides the closed lid: an external display, a power connection, and an external keyboard and mouse. Without an external display the MacBook sleeps when the lid closes.
Can I run a MacBook headless, with no display at all?
Not with stock macOS settings: without an external display, closing the lid puts the MacBook to sleep. A headless MacBook needs an HDMI dummy plug, sudo pmset -a disablesleep 1, or a lid-closed app such as Clamshell for Mac, and then you reach it over SSH or Screen Sharing. See how to run a MacBook headless.
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. Unless the Agent Screen module (off by default) keeps it on for an agent, the display sleeps, which uses less battery. 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. The 14-inch and 16-inch MacBook Pro (2021 and later) and some newer MacBook Air models have one; the M1 MacBook Air and the 13-inch MacBook Pro don't. Any supported MacBook can arm by pressing both Option keys or 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. For a ranked list, see the best apps to keep a MacBook awake. Already tried another tool? Read why KeepingYouAwake sleeps when the lid closes, how to fix Amphetamine not working with the lid closed, or how to undo sudo pmset disablesleep 1. Clamshell is $9.99 once after a 7-day free trial; see pricing.
Amphetamine, KeepingYouAwake, and other product names are trademarks of their respective owners; comparisons are based on each product's public documentation.