Skip to content
ReferenceUpdated 2026-06-04

macOS and Windows Power Management Explained

A practical reference for sleep, display sleep, hibernate, wake, power requests, caffeinate, PowerToys Awake, and long-running tasks on macOS and Windows.

Power management is not one switch. It is a set of policies: when the display turns off, when the CPU enters a low-power state, whether the network stays connected, which apps can prevent sleep, and what is allowed to wake the machine.

Core concepts

ConceptMeaningImpact on long tasks
Display sleepThe screen or backlight turns offUsually does not stop tasks
Idle sleepThe system sleeps after inactivityPauses local processes, network, and terminal work
HibernateMemory state is written to disk and power is removedTasks stop until resume
WakeThe machine returns from sleep or hibernateCan be triggered by input, network, or timers
Power request/assertionAn app temporarily asks the OS not to sleepUsed by caffeinate, PowerToys Awake, and Lidless

macOS power management

macOS has three practical layers:

  1. System Settings: Battery, Lock Screen, and Energy Saver.
  2. Command-line tools: pmset for settings and diagnostics, caffeinate for temporary assertions.
  3. App assertions: apps can request that macOS avoid sleep for a specific reason.

The key distinction is display sleep versus system sleep. Apple provides a setting that prevents automatic sleep while on power adapter when the display is off. That lets the screen go dark while the Mac keeps working.

Useful commands:

# Show current sleep-prevention assertions
pmset -g assertions
 
# Show power settings
pmset -g
 
# Turn the display off now
pmset displaysleepnow

caffeinate is the built-in temporary keep-awake tool. It can prevent idle sleep, prevent display sleep, run for a fixed number of seconds, or attach to a process ID.

Windows power management

Windows also has three practical layers:

  1. Settings: power mode, energy saver, screen/sleep/hibernate timeouts.
  2. Power plans: advanced power settings and powercfg.
  3. Power Requests: apps and drivers can temporarily request that the system stay awake.

In Windows 11, start with Settings -> System -> Power & battery. Microsoft documents power mode, energy saver, and screen/sleep/hibernate timeouts as the main controls.

Useful commands:

# Show apps and drivers preventing sleep
powercfg /requests
 
# Show supported sleep states
powercfg /a
 
# Show what last woke the PC
powercfg /lastwake
 
# Generate an energy report
powercfg /energy
 
# Generate a battery report
powercfg /batteryreport

PowerToys Awake temporarily keeps Windows awake without permanently changing the power plan. It is best for short sessions while you are present. For locked-screen unattended work, configure the power plan directly.

macOS vs Windows

AreamacOSWindows
Temporary keep-awakecaffeinatePowerToys Awake or app power requests
Sleep diagnosticspmset -g assertionspowercfg /requests
Main UI settingsBattery/Energy Saver, Lock ScreenPower & battery, screen/sleep/hibernate timeouts
Locked-screen workDepends on assertions and system policyUser tools may not apply; power plan is more reliable
Lid behaviorMacBook lid close is stricter than lock screenLid action is configurable in power plans

Developer workstation

  • Prevent system sleep while plugged in.
  • Let the display turn off after 5 to 15 minutes.
  • Use Lidless or caffeinate for task-level keep-awake.
  • Keep logs, commits, or patches so long work is recoverable.

Home server or Mac mini

  • Disable automatic system sleep.
  • Allow display sleep.
  • Enable only the remote access or network wake features you need.
  • Monitor temperature, disk health, and logs.

Laptop on battery

  • Avoid disabling sleep for long periods.
  • Use time-limited keep-awake only for clear tasks.
  • Let low battery restore normal power-saving behavior.

AI coding agents

  • Keep the system awake.
  • Restrict the agent's working directory and permissions.
  • Preserve a recovery path with resume, continue, logs, or a task state file.
  • Do not use a lit display as a substitute for proper system keep-awake.

Troubleshooting path

  1. Decide whether only the display turned off, or the whole system slept.
  2. Check active power requests or assertions.
  3. Compare plugged-in and battery policies.
  4. Check lock screen, lid close, remote desktop, VPN, and external drive behavior.
  5. Keep only the necessary task awake, then return to normal power policy.

References