hraness

Amphetamine vs caffeinate for keeping a Mac awake

Amphetamine is the Mac keep-awake tool I use for laptops running coding agents because its menu-bar state is visible and easy to change when I move the machine. The built-in command is caffeinate, not “caffeine,” and it is excellent for process-scoped terminal work. Amphetamine wins when staying awake is an ongoing machine state I want to inspect without remembering which shell owns it.

Why I moved beyond a terminal command

I initially used caffeinate. It ships with macOS and can hold sleep assertions for a command, a process, a duration, or until I stop it. For a build or script with a clear lifetime, caffeinate -i command is close to ideal: the idle-sleep assertion ends when the child process exits.

My coding agents do not always fit one command lifetime. Several sessions may run across terminals, and the practical state is “this laptop is acting as a host.” Amphetamine puts that state in the menu bar. I can start or end a session, see that it is active, and change it before I close the lid or take the laptop with me.

That visibility matters in the same setup where I reach the Macs through Duet Display. Remote access fails for a very boring reason if the host went to sleep. A persistent icon is a small piece of operational evidence that the machine is intended to remain available.

Amphetamine vs caffeinate

Both create macOS power assertions; the useful difference is how the lifetime is controlled.
OptionBest atFailure mode
AmphetamineVisible menu-bar sessions, timers, triggers, and changing state by handA broad session can outlive the work if I forget to turn it off
caffeinateScripts, one command, one PID, a fixed timeout, and automationA detached shell or forgotten assertion is less obvious than a menu-bar state
macOS sleep settingsStable machine-wide behavior configured without another appA permanent policy is blunt when only some work sessions need it

Amphetamine also supports richer triggers, such as keeping the Mac awake while an app is running or while other conditions hold. I do not need every trigger to justify it. The menu-bar affordance alone makes the active session easier to reason about than a command hidden in terminal history.

Use the narrowest assertion that matches the work

  • Wrap a finite build or script with caffeinate so the assertion dies with the work.
  • Use a timed Amphetamine session when the laptop should remain awake for a known window.
  • Use a visible indefinite session only when the whole machine is deliberately acting as a host, then end it before travel or battery use.

Neither tool makes closed-lid operation, power loss, network reachability, or a crashed process magically reliable. It only controls sleep assertions. For me that is exactly the right scope: Amphetamine keeps a simple host state visible, and the rest of the remote workflow remains testable on its own terms.

Sources and currency

Product details were checked against the following first-party pages on August 28, 2026. My workflow judgments are based on the experience described above.