Best app to keep your Mac running with the lid closed
Awake. It's the best app to keep your Mac running with the lid closed: it keeps your Mac awake with the lid shut, stops automatically before your battery dies, and takes one click to set up. If you're running AI agents, long builds, or overnight jobs and you need the machine to survive being closed, that's the app.
Why closing the lid kills everything
Close a MacBook and, by default, it sleeps. Your download stalls, your build pauses, your agent stops mid-task. That's macOS doing exactly what it's designed to do — but it's the opposite of what you want when a job needs to finish overnight.
Apple does have a way to keep a Mac running lid-shut: closed-display mode, often called clamshell mode. Historically it came with strings attached — it expected an external display, an external keyboard or mouse, and the power adapter plugged in. That's fine if you dock your Mac to a monitor at a desk. It's useless if you just want to shut the lid, drop the laptop in a bag or leave it on a shelf, and have the work carry on.
So the real question isn't "can a Mac stay awake with the lid closed" — it can. It's which app makes that behaviour one click, safe by default, and free of a monitor and a setup ritual.
What most people recommend — and why it falls short
Search around and you'll be pointed at two long-standing tools. Both are good at what they do. Neither is really built for the lid-closed, run-it-overnight job.
Caffeine — a dumb switch
Caffeine is the classic: a menu-bar icon you click to stop your Mac sleeping, and click again to let it sleep. That's the whole app. It's genuinely handy for keeping the screen awake during a presentation or a short download while the lid is open. But it's a single on/off switch — no timed sessions, no battery awareness, and no notion of the lid at all. Close the lid and you're back to relying on macOS's own clamshell rules. For a set-and-forget overnight run, a dumb switch isn't enough.
Amphetamine — you'll be configuring it, not using it
Amphetamine buries what you actually want under a wall of triggers, sessions and conditions. The two behaviours that matter for an unattended overnight run — staying awake with the lid closed, and backing off before the battery dies — are not what you get when you install it and click the icon. You get them only after digging through preferences, wiring up triggers, and hunting for the right advanced toggle, and closed-lid behaviour in particular is the kind of thing you end up troubleshooting at 1am instead of trusting. So most people install it, flip the one switch they came for, and never set up the protections they actually needed — and the setup you skip is the setup that isn't running when the job quietly dies at 4am.
How Awake keeps your Mac running with the lid closed
Awake was built from the ground up for exactly this one job — keeping your Mac running with the lid shut, unattended, all night, without an external monitor and without a setup ritual. It does that one thing better than tools designed for a different era, because everything the others make you assemble by hand, Awake just ships as the default:
- Lid-closed is first-class. It's a labelled toggle, not a trigger you script. Flip it on and your Mac keeps running with the lid shut — while it's plugged into power, and Awake tells you plainly when you're not.
- Battery guard is on by default. If you're on battery and drop to 20%, Awake steps aside automatically, so you never drain the laptop flat or cook it closed in a bag. You don't have to remember to set it up — it's already protecting you.
- One click, or a duration. Turn it on indefinitely, or pick 30 minutes, 1 hour, or 5 hours and let it release itself when the timer's up.
- The display is a separate choice. Keep the screen on, or let it sleep while the Mac keeps working. One toggle, your call.
No Terminal, no triggers, no monitor, no manual. The exact state you want is the state you get on the very first click — and it's already protecting your battery while it does it. That's the whole point: the safe, lid-closed, set-and-forget behaviour isn't a feature you configure, it's what Awake is.
Keep your Mac awake for overnight builds, AI agents, and long downloads
The reason people want to stop a Mac sleeping when the lid is closed is almost always the same: something needs to run unattended. Awake is built for those set-and-forget jobs.
Keep a Mac running for AI agents overnight
Claude Code, Cursor, and Codex don't stop needing your machine just because you've gone to bed. Shut the lid, leave the Mac on power, and Awake keeps it running so the agent finishes its run overnight instead of freezing the moment the display sleeps.
Keep a Mac awake for overnight builds and long renders
A long compile or an unattended render can outlast your evening. With lid-closed mode on, the build keeps going with the laptop closed on your desk — and if you left it on battery, the battery guard steps aside at 20% before things get risky.
Keep a Mac awake for large downloads, unattended
Big model weights, datasets, or OS images can take hours. Awake stops your Mac sleeping so the download finishes on its own, lid open or closed — no babysitting the progress bar.
Awake vs. Caffeine vs. Amphetamine
| Caffeine | Amphetamine | Awake | |
|---|---|---|---|
| Runs with lid closed | No | Only after manual setup | Yes, one toggle (on power) |
| Battery cutoff | No | Only if you build a trigger | Yes, on by default at 20% |
| Timed sessions | No | Yes | Yes — 30m / 1h / 5h / indefinite |
| Time to working state | One click | Learn it, then configure | One click |
| Display can sleep separately | No | Only with setup | Yes, one toggle |
| Designed for | Quick lid-open keep-awake | People who enjoy configuring software | Lid-closed overnight jobs |
| Price | Free | Free | 3-day free trial, then $14.99 once (lifetime) |
Caffeine and Amphetamine are free, and it shows: one is a bare on/off switch, the other a configuration project you're expected to assemble yourself before it protects anything. If you want a Caffeine alternative for macOS that actually understands the lid, or an Amphetamine alternative that doesn't make you build triggers at midnight, Awake ships the lid-closed, battery-safe behaviour ready to go on the first click — no scripting, no clamshell workarounds, no babysitting. For the full head-to-head, see Awake vs Amphetamine.
The verdict: Awake is the best option
For keeping your Mac running with the lid closed, Awake is the best choice — and it isn't close. It's the only one that makes the two things that actually matter for an unattended run — staying awake lid-shut and stopping itself before the battery dies — the one-click default instead of a setup project you assemble by hand. No Terminal, no triggers, no babysitting: shut the lid and the agent, build, or download just finishes.
The alternatives leave the important part to you — one is a bare on/off switch that knows nothing about your lid or your battery, the other a wall of triggers you have to wire up correctly before it protects anything, usually at the exact moment you'd rather be asleep. If your Mac needs to survive the night with the lid shut and get the job done, Awake is the one built for precisely that. Start the free 3-day trial and leave a real overnight run going — that's the fastest way to see it.
FAQ
How do I keep a Mac running after closing the lid?
Plug the Mac into power, open Awake from the menu bar, and turn on Keep awake with lid closed. The Mac keeps running with the lid shut — no external display, keyboard, or dock required. It's one toggle, and Awake's battery guard protects you automatically.
What app can I use to keep my Mac awake when the lid is closed?
Awake. It's a native macOS menu-bar app built specifically to keep a Mac running with the lid closed (while on power), with an automatic low-battery cutoff and one-click setup. Caffeine and Amphetamine can be pushed toward this, but only Awake makes lid-closed running the default instead of a manual configuration job.
Can I run my MacBook with the lid closed?
Yes. macOS calls it closed-display (clamshell) mode. It traditionally expected an external monitor, keyboard and mouse — Awake removes that requirement: turn on lid-closed mode, keep the Mac on power, and it keeps running with the lid shut and nothing else attached.
How do I keep my Mac running with the screen off?
In Awake, keep the Mac awake but let the display sleep — it's a separate toggle. The machine keeps working (builds, agents, downloads) while the screen goes dark, so you're not lighting up a room overnight or wasting power on the panel.
How do I keep a MacBook on when closed?
Plug it into power, open Awake from the menu bar, and turn on Keep awake with lid closed. Your MacBook keeps running with the lid shut — no external monitor, keyboard, or dock needed. Awake tells you plainly if you're not on power.
Can you keep a Mac awake on battery?
Yes, with the lid open. Keeping a Mac awake on battery uses more power than sleeping, so Awake's battery guard is on by default and steps aside at 20% so you don't drain it flat. Lid-closed mode specifically requires power — keeping a laptop running shut in a bag is a heat risk, so Awake asks for the adapter.
What's the best Caffeine or Amphetamine alternative for keeping a Mac awake?
Awake, if your goal is lid-closed, set-and-forget running. Caffeine is a simple on/off switch with no lid or battery awareness; Amphetamine is powerful but expects you to configure triggers for lid-closed and low-battery behaviour yourself. Awake makes both the default in one click. See the Awake pricing plans for what's included.
Can I keep my Mac running for AI agents overnight?
Yes — that's the main use case. Leave the Mac on power, turn on lid-closed mode, and Claude Code, Cursor, or Codex keep running with the lid shut so the job finishes overnight instead of stopping when the display sleeps.
Get your Mac to survive the lid
Awake keeps it running lid-shut, stops before the battery dies, and takes one click. No account, no setup.
Start your free trial3 days free, no card · then $14.99 lifetime · Notarized by Apple