08 / POWER · 5 min read

How to Stop Your Mac From Going to Sleep

macOS puts your screen and system to sleep to conserve battery. Here is how to keep your Mac awake using built-in settings, the Terminal caffeinate command, and keep-awake apps.

To stop your Mac from sleeping, adjust the energy settings in macOS System Settings, run the built-in Terminal command caffeinate for temporary tasks, or use a dedicated keep-awake app such as Amphetamine. Tegaro does not keep your Mac awake, but its Power tool shows battery health and charging wattage while long tasks run.

When macOS goes to sleep unexpectedly, large file downloads pause, video renders fail, local development servers shut down, and remote SSH connections drop. While macOS energy saver settings are designed to stretch battery life, demanding workflows frequently require keeping the system awake.

Method 1: Change Energy Saver Settings in System Settings

The standard way to modify sleep behavior on macOS Ventura, Sonoma, and Sequoia is through System Settings:

  1. Open Apple menu () → System Settings.
  2. Scroll down in the sidebar and select Lock Screen.
  3. Locate the setting Turn display off on battery when inactive and set it to Never (or a longer duration).
  4. Locate Turn display off on power adapter when inactive and set it to Never.
  5. Next, select Displays → Advanced… and toggle on Prevent automatic sleeping on power adapter when the display is off.
Note on Apple Silicon MacBooks

On M1, M2, M3, and M4 MacBooks, macOS no longer provides a separate "Computer Sleep" slider. Display sleep and system sleep are closely linked, meaning turning off display sleep also prevents the SoC from entering deep sleep.

Method 2: Use the Native Terminal Caffeinate Command

macOS includes a powerful built-in command-line tool called caffeinate that prevents idle sleep for a designated period or for the duration of a background command:

  • Keep Mac awake indefinitely: Open Terminal and run caffeinate. As long as Terminal remains open and running the process, your Mac will not sleep. Press Control + C to cancel.
  • Keep Mac awake for a specific duration: Run caffeinate -i -t 3600 (where 3600 represents seconds, keeping the Mac awake for exactly one hour).
  • Keep awake while a command runs: Prefix any terminal command, for example: caffeinate ./export_video.sh. Once the script finishes, sleep assertions are immediately released.

Method 3: Keeping a MacBook Awake With the Lid Closed

To use your MacBook in "clamshell mode" (lid closed while operating an external monitor):

  1. Connect your MacBook to AC power using MagSafe or a high-wattage USB-C charger.
  2. Connect an external display via HDMI, DisplayPort, or Thunderbolt.
  3. Connect an external keyboard and mouse or trackpad.
  4. Close the MacBook lid. The external display will flicker briefly and become your primary desktop.

The Hidden Risk: Battery Heat and 100% Float Wear

Keeping a MacBook permanently awake on AC power creates an unintended side effect: lithium-ion cells remain pinned at 100% capacity and maximum voltage while generating continuous heat. This accelerated chemical degradation can cause permanent battery health loss in as little as 6 to 12 months.

Watching Battery Health While Your Mac Stays Awake

macOS can hold the charge for you: turn on Optimized Battery Charging in System Settings → Battery → Battery Health, and the Mac learns your routine and delays charging past 80% when it expects to stay plugged in. Tegaro Power does not keep the Mac awake and does not cap charging; it shows what is happening while caffeinate or a keep-awake app does its job:

  • Charge and Time to Full: Battery percentage and the estimated time until the battery is full.
  • Real-Time Wattage & Temperature: Monitor live charging wattage, battery temperature, cycle counts, and CPU load at a glance.
  • Battery Health: Current maximum capacity against design capacity, so you can see wear over months of plugged-in use.
Local-First Performance

Tegaro reads battery data through standard macOS IOKit interfaces, with zero background daemon overhead and zero cloud tracking.

Frequently Asked Questions

How do I stop my Mac from sleeping with a keyboard shortcut?

macOS has no built-in shortcut to toggle sleep prevention. Keep-awake apps such as Amphetamine offer a menu bar toggle; in Terminal, caffeinate starts it and Control-C stops it. Tegaro does not include a keep-awake toggle.

Does closing the MacBook lid always put it to sleep?

By default, yes, unless the MacBook is connected to both an AC power adapter and an active external display (clamshell mode).

Will keeping my Mac awake damage the screen?

Modern OLED and mini-LED displays should not be left static at maximum brightness for days. Use a screen saver or allow display sleep while keeping system processes awake using caffeinate -i.

Power / Tegaro

Experience Native On-Device macOS Productivity

Tegaro combines Power, Clipboard, Displays, Power telemetry, and Typing into one menu-bar icon. All eight tools free for 14 days; then Critter, Power and AI limits stay free, and one Pro license covers the rest.