SKILL.md
Anti-Sleep (macOS caffeinate)
When to Use
- Use when the user wants the Mac to stay awake during a long supervised task.
- Use when a build, download, or automation run should not be interrupted by sleep.
Keep the Mac awake using the built-in caffeinate command. No install needed.
Quick start — the standard command
caffeinate -d -i -t 7200 # full power: screen stays on + no idle sleep, for 2 hours
Duration is -t <seconds>: 2h = 7200, 7h = 25200, overnight (9h) = 32400.
Aggressiveness levels
| Flags | Effect |
|---|---|
-i | prevents idle system sleep only (screen may still dim/lock) |
-d | prevents display sleep (screen stays on) |
-d -i | default choice — screen on + system awake |
-d -i -s | adds -s: prevents sleep even on AC power semantics; -s only works when plugged in |
-u -t 1 | simulates user activity — wakes the display right now |
Default to -d -i -t <seconds> unless the user says otherwise.
Tie to a process instead of a timer
caffeinate -d -i -w <PID> # stays awake until that process exits (great for builds)
caffeinate -i npm run build # wraps a command; exits when the command finishes
Run it in a visible terminal (cmux pane)
Prefer running it in the user's own terminal pane so it's visible and easy to Ctrl+C. In cmux (read the cmux skill first if interacting with panes):
cmux send --surface surface:<N> "caffeinate -d -i -t 25200\n"
Otherwise run it as a background Bash task. Never block your own foreground shell with it.
