Is sudo pmset disablesleep 1 safe? What it does and how to undo it.

By Matyas Rathonyi. Updated November 23, 2026. Guides

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.

One switch, still on after you walk away.The flag is not tied to a job or a window. It keeps the Mac awake at the desk, then on battery, then in a bag, until you set it back to 0.

Quick answer

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

A flag you have to remember, or nothing to undo. SleepDisabled stays at 1 after the job ends until you set it back to 0, and you should check 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

  1. Check the setting. Run pmset -g and inspect SleepDisabled under system-wide power settings:
    pmset -g
    
    # enabled
    SleepDisabled        1
    
    # normal sleep behavior
    SleepDisabled        0
  2. Undo it if it reads 1. Run the exact inverse command:
    sudo pmset -a disablesleep 0
  3. Confirm it returned to 0. Run pmset -g again and verify SleepDisabled reads 0. It can stay on after a restart, so check pmset -g again 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.

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:

Clamshellpmset disablesleep
Admin stepNonesudo on and off
Menu bar statusAlways visibleNone
Heat cut-offAlways onNone
Battery floor20% defaultNo battery stop
After quit or restartNormal sleep returnsStays on until undone
Price$9.99 once (7-day trial)Free
Mac and macOSApple 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:

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

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.

Download free trial $9.99 once, no subscription

$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.