No, it is not safe to leave on. sudo pmset -a disablesleep 1 is reversible with sudo pmset -a disablesleep 0, but it blocks every kind of system sleep system-wide, on battery too, with no timer, no menu bar indicator, and no heat cut-off until you remember to turn it off. Clamshell for Mac keeps a closed Apple Silicon MacBook awake only while armed, with no sudo, an always-on heat cut-off, and nothing to undo, for $9.99 once after a 7-day free trial (no card required).
Written by Matyas Rathonyi, the maker of Clamshell for Mac.
Quick answer
- What it does: sets macOS's system-wide
SleepDisabledflag to1, stopping all system sleep, including when you close a MacBook lid. - Is it safe? It is reversible, though it is undocumented, global, applies on battery, and has no timer or thermal cut-off. The main danger is forgetting it is enabled and placing a closed, running MacBook inside a bag.
- Undo it: run
sudo pmset -a disablesleep 0. - Check it: run
pmset -gand look forSleepDisabled 1under System-wide power settings.
The command and its inverse
sudo pmset -a disablesleep 1
# restore normal sleep behavior
sudo pmset -a disablesleep 0
pmset requires sudo because pmset(1) states it must be run as root to modify power settings. The -a flag targets all power sources (battery and charger). Unlike a temporary caffeinate process, disablesleep is not tied to one Terminal window or one job: closing Terminal leaves SleepDisabled at 1 until you explicitly run disablesleep 0.
-a, -b or -c?
Other pmset options accept per-source flags (-b for battery, -c for charger, -a for both). pmset -g reports SleepDisabled as a single value under System-wide power settings rather than per power source. Do not assume sudo pmset -c disablesleep 1 or sudo pmset -b disablesleep 1 restricts it to one power source; check pmset -g afterward and treat sleep as disabled everywhere while it reads 1.
Most lid-closed menu bar apps toggle this same pmset setting through a privileged helper or a sudoers rule. See how keep-awake apps work with the lid closed for which apps rely on it and what each leaves behind.
Why it needs extra care
- It is system-wide. You are turning off all system sleep on the machine, not keeping one build or agent running.
- It is easy to forget. There is no menu bar icon and no automatic end time.
- It stays active on battery. A closed MacBook can keep running unplugged until the battery drains to zero.
- It risks heat in a bag. A closed workload that normally pauses at lid close keeps generating heat with blocked airflow.
- It is undocumented. The macOS
pmset(1)manual does not listdisablesleep, and Apple can change undocumented settings without notice.
pmset -g again after any restart. Clamshell leaves nothing to remember and restores normal lid sleep when you disarm or quit.How to check whether it is enabled
- Check the setting. Run
pmset -gand inspectSleepDisabledunder system-wide power settings:pmset -g # enabled SleepDisabled 1 # normal sleep behavior SleepDisabled 0 - Undo it if it reads
1. Run the exact inverse command:sudo pmset -a disablesleep 0 - Confirm it returned to
0. Runpmset -gagain and verifySleepDisabledreads0. It can stay on after a restart, so checkpmset -gagain after rebooting before relying on normal sleep.
Note that pmset -g assertions checks temporary process assertions such as caffeinate, not SleepDisabled. Always check pmset -g for disablesleep.
Do not reach for restoredefaults first
sudo pmset restoredefaults resets every power management setting as a group, which can wipe intentional power preferences you wanted to keep. Use the targeted undo command first: sudo pmset -a disablesleep 0.
Safer choices for common jobs
If the lid stays open, run caffeinate -i your-command: it is free, needs no sudo, and ends automatically when your command finishes. If the lid must close, Apple's built-in setup requires an external display, power, and an external keyboard and mouse, and an HDMI dummy plug adds physical hardware and a phantom display.
That is where free commands stop working cleanly. What sudo pmset -a disablesleep 1 asks of you is typing sudo twice, remembering to undo an undocumented switch with no menu bar reminder, and giving up thermal and battery protection. Why pay $9.99 once for Clamshell? You skip admin passwords and manual undo while getting an always-on heat cut-off and a 20% low-battery stop out of the box.
- No sudo and nothing to undo. Clamshell keeps an Apple Silicon MacBook awake with the lid closed only while armed, with no admin password, no kernel extension, and no privileged helper. Disarming, quitting, or restarting returns normal lid sleep.
- Visible state in your menu bar. Always see at a glance whether Clamshell is armed. Option-close, both Option keys, and the menu bar menu arm for the next lid close only; right-clicking, Shortcuts, and the URL scheme stay armed until you disarm.
- Always-on heat protection and 20% battery floor. Serious or critical thermal pressure disarms toward normal lid sleep and blocks arming until the Mac cools. Low-battery disarm at 20% is on by default.
- Notarized and ready to install. Direct download, Homebrew (
brew install --cask clamshell), or Setapp for Apple Silicon Macs on macOS 14 or later.
Test it on your Mac before paying anything: Download free trial (free for 7 days, no card required; $9.99 once for 1 Mac or $19.99 for up to 3 Macs, with a 14-day money-back guarantee).
Choose by scope
A one-off open-lid process
Use caffeinate -i your-command. Its assertion ends automatically when your job exits, and it needs no sudo. See why caffeinate does not work with the lid closed for its flags.
A closed-lid Mac with no monitor
Use Clamshell for Mac when you want closed-lid awake control with a visible menu bar indicator, no admin password, and automatic heat and battery protection.
Not sure yet
Start with how to keep a MacBook awake with the lid closed to see every desk and mobile setup together, or try Clamshell free for 7 days with no card required.
The Mac will run unplugged
Avoid sudo pmset -a disablesleep 1 on battery, since it runs until the battery is empty. Clamshell works on battery and disarms automatically at 20% by default; see running a MacBook lid-closed on battery.
Already ran disablesleep 1 and stuck? Follow the step-by-step guide to undo sudo pmset disablesleep 1.
Clamshell and pmset side by side
Here is how pmset disablesleep and Clamshell compare on every practical trade-off:
| Clamshell | pmset disablesleep | |
|---|---|---|
| Admin step | None | sudo on and off |
| Menu bar status | Always visible | None |
| Heat cut-off | Always on | None |
| Battery floor | 20% default | No battery stop |
| After quit or restart | Normal sleep returns | Stays on until undone |
| Price | $9.99 once (7-day trial) | Free |
| Mac and macOS | Apple Silicon, macOS 14+ | Any Mac |
Verdict: Choose Clamshell if you run closed-lid jobs on an Apple Silicon MacBook (macOS 14+) and want no sudo, nothing to undo, and built-in heat and battery cut-offs; use pmset disablesleep only if you need a free one-off command or run an Intel Mac or macOS 13 and earlier.
pmset disablesleep
Free and built into macOS, though it stays active across every power source until you run sudo pmset -a disablesleep 0, can stay on after a restart, offers no menu bar state, no heat cut-off, and no low-battery floor, and requires sudo both ways.
Clamshell
$9.99 once after a 7-day free trial (no card required), with no sudo, no admin password, no kernel extension, and no privileged helper. Normal lid sleep returns automatically when you disarm, quit, or restart; thermal safety stays on at all times; and low-battery disarm stops at 20% by default.
When pmset or Apple's desk setup is the better pick:
- You run an Intel Mac or macOS 13 or earlier. Clamshell requires Apple Silicon and macOS 14 or later.
- You work at a desk with an external monitor, power, keyboard, and mouse. Apple's built-in clamshell mode handles that for free.
Frequently asked questions
Is sudo pmset disablesleep 1 safe?
It is reversible, though not safe to leave on: it is an undocumented global switch with no timer, no menu bar state, and no heat or battery cut-off. Check it with pmset -g and undo it with sudo pmset -a disablesleep 0. For closed-lid work with no sudo and built-in heat and battery safety, start Clamshell's 7-day free trial.
How do I turn pmset disablesleep off?
Run sudo pmset -a disablesleep 0, then run pmset -g and verify SleepDisabled reads 0. Skip sudo pmset restoredefaults unless you intend to wipe all custom power settings.
Does pmset disablesleep survive a restart?
Treat it as persistent. Unlike caffeinate, it is a system power setting, so closing Terminal or restarting does not guarantee it clears. Always verify SleepDisabled 0 in pmset -g after restarting, or switch to Clamshell so a restart always restores normal lid sleep.
Can I limit disablesleep to the charger with pmset -c?
Do not count on it. pmset -g reports SleepDisabled as one system-wide value rather than per power source, so treat it as active on battery too whenever it reads 1. If you need closed-lid control with a 20% battery stop, use Clamshell instead.
Does Clamshell for Mac need sudo or leave anything to undo?
No. Clamshell needs no sudo or admin password and leaves nothing behind to undo: normal lid sleep returns when you disarm or quit, and restarting always restores normal lid sleep.
Is there a safer way to keep a MacBook awake with the lid closed?
At a desk, Apple's supported setup uses an external monitor, power, keyboard, and mouse. Without a monitor, Clamshell for Mac gives you a visible menu bar indicator, automatic normal sleep on disarm or quit, an always-on heat cut-off, and a 20% low-battery stop, free to test for 7 days.
Why pay $9.99 for Clamshell when pmset disablesleep is free?
sudo pmset -a disablesleep 1 demands sudo twice, can stay on after a restart with no reminder, has no battery stop, and has no heat cut-off if you forget it in a bag. Clamshell costs $9.99 once (no subscription) so you skip admin passwords and manual cleanup while keeping always-on heat and battery protection. Try the 7-day free trial (no card required) first.
Related guides
- What is Clamshell for Mac?
- caffeinate and pmset command builder
- Clamshell vs Amphetamine vs pmset for a closed MacBook lid
- Amphetamine not working with the lid closed
- KeepingYouAwake with the lid closed: why it sleeps anyway
Try Clamshell free for 7 days
Keep your closed Apple Silicon MacBook awake with no sudo, nothing to undo, an always-on heat cut-off, and a 20% low-battery floor. Normal lid sleep returns when you disarm or quit.
$9.99 for 1 Mac, $19.99 for up to 3 Macs. 7-day free trial with no card required and a 14-day money-back guarantee. Apple Silicon, macOS 14 or later, notarized by Apple. Also available via Homebrew (brew install --cask clamshell) or Setapp.
Method: checked against the macOS pmset(1) manual and Apple Silicon macOS behavior on October 15, 2026. Because disablesleep is undocumented, treat it as an implementation detail rather than a stable Apple interface. Clamshell details from version 2.0.5 and published documentation.