Make Mac Better
Download
← Make Mac Better

Guides

How to keep a Mac awake with the lid closed

By default, a MacBook sleeps when you close the lid. That stops downloads, AI agents and remote sessions halfway. These are the ways to keep it running, and what each one needs.

Step by step

  1. Clamshell mode (Apple’s official way)

    Connect the charger, an external display and a keyboard and mouse. With those connected, you can close the lid and keep working on the external display. It does not help if you just want the Mac to keep working in your bag.

  2. The caffeinate command

    In Terminal, “caffeinate -i” stops the Mac from sleeping while it is running (Ctrl+C to stop). It is built in and free, but on its own it does not keep a MacBook awake once you close the lid.

  3. Amphetamine

    A free Mac App Store app with many options, including keeping the Mac awake with the lid closed. On some Macs that needs an extra step that the app explains.

  4. Make Mac Better

    In the menu bar choose how long and press “Keep awake”. The first time you use lid-closed mode, approve a small helper in System Settings; then wait for “Ready: you can close the lid”.

Is it safe to run a MacBook with the lid closed?

For a few hours with ventilation, yes; inside a closed bag it can get hot. That is why Make Mac Better limits lid-closed mode to 4 hours and stops if the Mac gets hot or if you unplug the charger (unless you allow battery). Normal sleep is always restored afterwards.

What is it useful for?

Letting AI agents like Codex, Claude Code or Cursor finish long tasks, keeping SSH or Screen Sharing sessions connected, and letting large downloads or exports complete.

Get Make Mac Better · €19.99See the feature →

Reviewed October 2026. Prices and features of other apps can change; check their websites.