Keep a MacBook awake with the lid closed on battery.

By Matyas Rathonyi. Updated October 21, 2026. Guides

Yes. Clamshell for Mac, a menu bar app, keeps an Apple Silicon MacBook awake with the lid closed on battery, with no sudo, no external display and a low-battery cutoff at 20%. Apple's closed-display mode needs power, and the free pmset disablesleep works on battery but has no battery or thermal cutoff.

Apple's modeNeeds power, a display, keyboard and mouse
On batteryClamshell keeps a closed Mac awake
Plug or unplugStays armed through every change
Cutoff20% on battery, on by default

An animated MacBook with a coding agent deploying a website from its terminal. The Option key is held and the lid closes: the display goes black, but the Mac stays awake, so a dimmed copy of the terminal keeps working above the closed laptop while its front edge fills with light. When the deploy is done, a pointer shows how to lift the lid. Opening it wakes the Mac to its lock screen, which unlocks to the finished run: deployed, with the live address. The lid can then be opened and closed freely.

Clamshell for Mac keeps the Mac awake with the lid closed while armed. No sudo, no monitor. Free for 7 days, then $9.99 once.

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. On your phone? Send the Mac download link to yourself.

Awake on battery, with a floor at 20%.Clamshell keeps the closed Mac working unplugged. Its low-battery cutoff, on by default, lets the Mac sleep before the battery runs flat.

Apple's closed-display mode is not a battery option: Apple's instructions for a closed laptop say it must be connected to power and to an external keyboard and mouse, with an external display. To keep a MacBook awake with the lid closed on battery, you need something that overrides lid sleep. Clamshell for Mac is a menu bar app that does this on battery or power, stays armed when you plug in or unplug, and lets the Mac sleep when the battery reaches 20%. pmset disablesleep and Amphetamine are the main alternatives.

Quick answer

Apple's clamshell mode

Requires power, an external display, keyboard and mouse. Not for battery use.

Clamshell

Works on battery and power, stays armed through every plug or unplug, Disarm on low battery (on by default), thermal safety always on. No sudo.

sudo pmset -a disablesleep 1

Works on battery because -a covers every power source, but has no low-battery or heat cutoff and stays on until you undo it.

Amphetamine

Free, with a Closed-Display Mode, low-battery session end, and battery and power-adapter triggers. On Apple Silicon, its developer recommends an optional Power Protect install for power-source changes.

Why Apple's clamshell mode does not help on battery

macOS supports running a MacBook with the lid closed as a desktop: connect a display, keyboard, mouse and power, and approve the accessories if your Mac asks. Apple's display troubleshooting says a closed-lid laptop must be connected to power and using an external keyboard and mouse. Without that setup, closing the lid starts lid sleep. caffeinate and most keep-awake apps block idle sleep only, so they do not change this on battery or on power. See why caffeinate does not work with the lid closed.

How each option behaves on battery

MethodOn batteryPlug or unplugBattery cutoffAdmin
Apple's closed-display mode No, needs power Unplugging leaves the supported setup Not applicable No
pmset -a disablesleep 1 Yes Stays set. Global flag None built in Yes, sudo
Amphetamine Closed-Display Mode Listed feature; check on your Mac Extra install recommended on Apple Silicon: the optional Power Protect Can end the session on low battery Add-on only. App: no. Power Protect install: Touch ID or admin password once
Clamshell Yes Stays armed automatically 20%, on by default None

pmset disablesleep on battery

-a applies a setting to all power sources, so sudo pmset -a disablesleep 1 keeps a closed Mac awake on battery too. That is the problem as much as the feature: nothing turns it off when the charge runs low or the Mac gets warm, and it remains set until you run sudo pmset -a disablesleep 0. Full pmset guide.

Amphetamine on battery

Amphetamine is free and mature. Its App Store listing includes keeping a MacBook awake with the display closed, ending a session when the battery is low, and triggers based on battery level or whether the power adapter is connected. Its developer notes that on Apple Silicon laptops Closed-Display Mode may not work as expected after connecting or disconnecting power, and offers Power Protect: a separate installer that adds a script and a configuration file under /private/etc/sudoers.d/, authorized once with Touch ID or an administrator password. If you already use Amphetamine and are comfortable with that install, it is a reasonable choice, and its trigger system is more flexible than Clamshell's.

Clamshell on battery

Clamshell keeps the closed Mac awake only while armed, and it stays armed through every plug or unplug. Nothing extra to install and no admin prompt. A restart always brings back normal lid sleep.

Clamshell for Mac keeps a closed MacBook awake on battery or power, with a low-battery cutoff at 20%. Free for 7 days, then $9.99 once for one Mac.

Apple Silicon, macOS 14+. Notarized by Apple. 3.6 MB. Or install with Homebrew: brew install --cask clamshell. Also on Setapp.

The low-battery cutoff

Disarm on low battery in Clamshell's General settings is on by default and acts at 20%. While armed on battery, if the charge falls through 20%, Clamshell disarms and posts a notification, so normal lid sleep applies and the Mac can sleep instead of running flat.

  1. Armed on batteryThe closed Mac keeps working as the charge falls.
  2. The charge falls through 20%Clamshell disarms and posts a notification.
  3. Normal lid sleep appliesThe Mac sleeps instead of running flat.

Whatever tool you use, a cutoff turns a flat battery into a paused job. Your work stops either way; with a cutoff, the Mac and its open files are still there when you get back.

A floor for unplugged runs. With Disarm on low battery on, Clamshell disarms and posts a notification when the charge falls through 20%, so normal lid sleep applies instead of the battery running flat. It is on by default.

What drains the battery with the lid closed

No tool makes closed-lid work free. With Clamshell the built-in display stays black while the lid is closed, and unless the Agent Screen module (off by default) keeps it on for an agent, the display sleeps for less battery use. The work itself still draws what it always draws.

For anything longer than a short trip between outlets, plugging in is still the answer. Clamshell keeps working when you do.

Heat: never in a bag

A closed MacBook doing real work in a bag, a sleeve or under a blanket has little airflow, and the heat builds. Keep it on a hard surface with the vents clear. Clamshell's thermal safety is always on: at serious or critical thermal pressure, it disarms toward normal lid sleep and refuses to arm again until the Mac cools. It is a backstop, not a substitute for airflow.

Before you pack the Mac away, disarm it and check the menu bar shows it inactive; right-click and Shortcuts arming stay on across lid reopenings until you disarm, while an Option-close or menu-armed session ends when you open the lid.

Requirements

Clamshell runs on Apple Silicon MacBooks with macOS 14 or later. The Option-close gesture needs a lid angle sensor, which the 14-inch and 16-inch MacBook Pro (2021 and later) and some newer MacBook Air models have; the M1 MacBook Air and the 13-inch MacBook Pro don't. Any supported MacBook can arm by pressing both Option keys or from the menu bar. It also arms with an external display connected, and keeps the closed Mac awake on battery there too. Clamshell for Mac is available only from clamshell.dev, on Setapp and through Homebrew. It is not on the Mac App Store; App Store apps named Clamshell are from other developers.

Frequently asked questions

Does Apple's clamshell mode work on battery?

No. Apple's guidance for a closed-lid laptop with an external display says the Mac must be connected to power and using an external keyboard and mouse. On battery with the lid closed, macOS starts lid sleep unless another tool overrides it.

Is there a Mac app that prevents sleep with the lid closed on battery?

Yes. Clamshell keeps an Apple Silicon MacBook awake with the lid closed on battery or power, without sudo, and stays armed when you plug in or unplug. Amphetamine offers a Closed-Display Mode with low-battery session end, and recommends an optional Power Protect install on Apple Silicon for power changes.

Does pmset disablesleep work on battery?

Yes. sudo pmset -a disablesleep 1 applies to all power sources, including battery. It has no low-battery or thermal cutoff and stays on until you run sudo pmset -a disablesleep 0.

Will a closed MacBook drain its battery overnight?

It depends on the work. With the lid closed the built-in display stays dark, but heavy builds or local AI models draw as much as they do with the lid open. For overnight runs, plug in, or set a low-battery cutoff so the Mac sleeps before the battery runs flat.

What happens if I unplug while Clamshell is armed?

Clamshell stays armed and keeps the closed Mac awake after the power change. If Disarm on low battery is on (the default) and the charge is already at or below 20% when you unplug, it disarms so the Mac can sleep normally.

Is it safe to keep a MacBook running in a bag with the lid closed?

No. A bag traps heat. Keep a working MacBook on a hard, ventilated surface, and disarm Clamshell before packing the Mac away. Clamshell disarms on serious or critical thermal pressure, but that is a backstop, not a substitute for airflow.

Related guides

Sources checked September 29, 2026: Apple's external display guidance for a closed laptop, closed-lid accessory guidance and Power Modes article, the Amphetamine App Store listing, the Amphetamine Power Protect page, and the macOS pmset(1) manual. Clamshell behavior is described from its app source and FAQ. No battery life figures are given because none were measured for this page. Clamshell is the publisher of this guide. Product names belong to their respective owners. Rechecked October 15, 2026: the Amphetamine Power Protect page and App Store listing.