Guide

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

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.

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.

Which one should you use?

Swipe to compare →

TerminalAmphetamineOwl Mode
PriceFreeFree€5 once
Lid closed, no monitorYesWith EnhancerYes
Sleeps again when the work is doneNoWith triggersYes
Automatic for AI coding agentsNoNoYes
Battery guardNoYesYes
Heat guardNoNot listedYes

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?