How the command is built
On a Mac the builder uses caffeinate, which comes with macOS. The -i flag creates an assertion that stops idle sleep. The -s flag creates one that stops system sleep, and the manual says it's valid only while the Mac runs on AC power, so the builder adds it only when you say you're plugged in. Sources: caffeinate(8) manual.
When caffeinate wraps a command, it holds its assertions for as long as the command runs. The manual says the -t timeout isn't used in that form. So for a fixed number of hours, the builder gives you a separate caffeinate -t command for its own terminal tab, with the hours converted to seconds. Sources: caffeinate(8) manual.
The manual doesn't promise that caffeinate keeps a closed MacBook awake. Apple documents using a MacBook with the lid closed when an external display is connected, with power connected and an external keyboard and mouse or trackpad. So the builder treats a closed lid as something caffeinate alone doesn't cover. Sources: Apple Support: dual monitors with a MacBook Air or MacBook Pro with M3 chip, MacBook Pro User Guide: connect an external display.
pmset is how you check, and how you make a setting stick. pmset -g assertions lists the assertions caffeinate takes. pmset -g custom shows your current settings, and setting sleep to 0 turns the system sleep timer off until you change it back. It's a saved setting, and it won't fix a closed lid. Sources: pmset(1) manual.
On Linux the builder uses systemd-inhibit. Its --what option takes a colon-separated list. That list includes sleep, which blocks suspend and hibernate, and handle-lid-switch, which blocks the lid switch handling. The lock is held while the command it runs is alive, and --list shows the active locks. The builder adds handle-lid-switch only when you say the lid will be closed. For a permanent change, the HandleLidSwitch setting in logind.conf controls what a closed lid does. Sources: systemd-inhibit(1) manual, logind.conf(5) manual.
How this was tested: the builder only prints commands and runs nothing on your machine. We checked the caffeinate timeout and the assertion names by running caffeinate -is -t on a MacBook on AC power with macOS 26.6.2 on 2026-09-30, then reading the assertions back with pmset -g assertions. We built the Linux commands from the manual and haven't run them for this page.
Last checked September 2026.
Worked examples
Hivra is independent and is not affiliated with Anthropic, OpenAI or Apple.