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 splits automation into two layers:

What it can watch:

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

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 keep-awake mode

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

In most cases Prevent Sleep is enough: with the screen off the CPU keeps running, your tasks continue, and you save power. “Off” is not a third mode — it just stops keeping awake. Manual and scenes are exclusive: starting manually closes the current scene, and stopping does not restore it.

Quick start

  1. Launch HeyWakeup — a laptop icon appears in the menu bar;
  2. Click it and choose Prevent Sleep or Awake When Closed, or open More › for every scene;
  3. For automation: Preferences → Scene → Automation, and select a scene or add a condition.

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.

Related reading

2026-10-18