How to keep your MacBook awake with the lid closed
Close a MacBook and it goes to sleep, even halfway through a download or a render. Without an external monitor you have three ways around that: a Terminal command, the free app Amphetamine, or Owl Mode.
Updated
Why your Mac sleeps when you close it
Closing the lid is the strongest sleep signal a MacBook knows. macOS only ignores it in clamshell mode (Apple calls it closed-display mode), and that needs a power adapter, an external display and a keyboard or mouse. On the train or on the couch, none of that is there.
The usual tricks don't help here. caffeinate and the Energy setting “Prevent automatic sleeping on power adapter when the display is off” stop your Mac from dozing off when you leave it alone, but not from sleeping when you close the lid.
Option 1: the Terminal command (free)
macOS has a hidden switch that turns lid-closed sleep off completely:
sudo pmset -a disablesleep 1
And to turn normal sleep back on:
sudo pmset -a disablesleep 0
- Good: free and built in.
- Watch out: it stays on until you switch it back. Forget that once and your Mac keeps running in your bag all day, battery and all. It also asks for your password every time.
Option 2: Amphetamine (free)
Amphetamine is a long-standing free app in the Mac App Store with a lot of triggers: keep awake for a set time, while an app runs, while a file downloads. To stay awake with the lid closed and no external display, it needs a separate helper, Amphetamine Enhancer, which you download outside the App Store.
- Good: free, flexible, widely used.
- Watch out: many settings, and the lid-closed part takes an extra install.
Option 3: Owl Mode (€5, once)
Owl Mode does one thing: keep your MacBook running with the lid shut, and put it to sleep the moment the work is done. Click the owl in your menu bar, or let it switch on by itself while Claude Code, Codex, Cursor or Gemini CLI work.
- Good: sleeps right after the job ends, pauses when the battery is low or the Mac runs hot, and can text your phone when it's done.
- Watch out: it costs €5, and macOS asks you to confirm it the first time you open it.
Which one should you use?
Swipe to compare →
| Terminal | Amphetamine | Owl Mode | |
|---|---|---|---|
| Price | Free | Free | €5 once |
| Lid closed, no monitor | Yes | With Enhancer | Yes |
| Sleeps again when the work is done | No | With triggers | Yes |
| Automatic for AI coding agents | No | No | Yes |
| Battery guard | No | Yes | Yes |
| Heat guard | No | Not listed | Yes |
Need it once? Use the Terminal command and set a reminder to switch it back. Want lots of control for free? Take Amphetamine. Want it to just happen, and stop by itself? That's what Owl Mode is for.
Whichever you pick: let it breathe
A closed MacBook cools less well. A desk or an open bag is fine; a zipped sleeve during a long render is not. More in is it safe to run a MacBook with the lid closed?