Keep your Mac awake with the lid closed (no password) — for Claude Code, Cursor, Ollama, and music

Close the lid on a MacBook and your running task — or your music — stops. The reason is that macOS has a separate lid-closed sleep path, distinct from idle sleep. This post explains it and a way to keep going that needs no password.

Why the built-in settings can't do it

The "never sleep" option in Energy Saver only affects idle sleep: the screen can turn off while the system stays awake. Lid-closed sleep is a different kernel path, and ordinary power assertions (the equivalent of the built-in caffeinate) can't block it. So you get:

The classic workaround is sudo pmset -a disablesleep 1, which needs an admin password, writes a persistent system setting, and is easy to forget — leaving the Mac running hot in a bag.

The no-password way: session-level lid-closed control

macOS's power manager (IOPMrootDomain) exposes an interface that can temporarily "skip lid-closed sleep" with no root and no permission prompt. Two properties matter:

  1. Session-level: valid only while the app runs, and released on quit / crash / restart — no persistent change is left behind;
  2. No authorization: no admin password, and no system setting is modified.

HeyWakeup's Awake When Closed is built on exactly this. First use requires zero authorization, and your task keeps running with the lid shut.

Start and stop by scenario, not always-on

Staying awake forever works, but doing it on demand is much friendlier. HeyWakeup ships 9 triggers: any one satisfied turns it on, and when none are, it turns off:

You can also switch instantly with the Scene presets: Demo · Download · Agent · Meeting · Music · Remote · Closed-Lid Server.

Safety nets: safe to leave in a bag

Keeping a Mac awake with the lid closed draws more power and runs hotter. HeyWakeup turns on several guards by default:

Pick the right mode first

ModeWhat it doesBest for
Prevent SleepScreen may turn off; the system stays awakeDownloads, builds, backups — the most power-efficient default
Awake When ClosedStays awake even with the lid closedRunning in a bag, as a server or a player
OffNormal sleepDone for the day

In most cases Prevent Sleep is enough: with the screen off the CPU keeps running, your tasks continue, and you save power.

Quick start

  1. Launch HeyWakeup — the "MoMo" icon appears in the menu bar;
  2. Click it and choose Prevent Sleep or Awake When Closed, or pick a preset from Scene;
  3. For automation: Preferences → Triggers and add a rule.

Supports macOS 12 and later, universal (Intel + Apple Silicon), with no Accessibility permission and no kernel extension.

Download HeyWakeup, or see pricing and the FAQ.

2026-10-18