anti-sleep
Enables your agent to keep your Mac awake. Prevents the computer from sleeping during long tasks.
What it does
Prevents your Mac from automatically sleeping during long tasks like downloads or updates. It keeps the screen on and the system awake.
When to use it
- ✓During lengthy downloads or updates.
- ✓When running programs that take a long time.
- ✓When you don't want your Mac to sleep for a specific period.
Example of what to ask your AI
“Keep my Mac awake for 3 hours.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It uses a built-in Mac command called `caffeinate`. You specify how long to keep the Mac awake or until a specific task finishes.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill anti-sleepOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/anti-sleep/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
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.
Verify and monitor
pgrep -fl caffeinate # is it running? shows exact flags
ps -o etime= -p <PID> # how long it's been running
pmset -g assertions # inspect PreventUserIdleSystemSleep / PreventUserIdleDisplaySleep # confirm sleep assertions are active
Gotcha: caffeinate prints nothing and holds the prompt — it looks "stuck" or like Enter wasn't pressed. It isn't stuck. Verify with pgrep, not by looking at the terminal.
Expiry: with -t it exits silently when time runs out — no notification. If the user asks "is it still on?" after hours, check pgrep first; it may simply have expired.
Keyboard backlight
caffeinate cannot keep the keyboard backlight on — it has its own inactivity timer with no CLI/API on Apple Silicon (researched 2026-07). Fix is manual, one-time: System Settings > Keyboard > "Turn keyboard backlight off after inactivity" > Never.
Stop early
kill <recorded-caffeinate-PID> # or Ctrl+C in the pane running this task
Record the PID of the process started for this task; verify its command before stopping it. Do not stop unrelated caffeinate sessions by a broad pattern.
After starting: confirm to the user the PID, the flags, and the wall-clock time it will expire.
Limitations
- Adapted from
davidondrej/skills; verify local paths, tools, credentials, and agent features before acting. - For commands, remote access, scheduling, browser automation, or file-changing workflows, get explicit user approval and confirm the target environment first.
FAQ
How do I know if it's working?
You can check if the `caffeinate` command is running on your Mac. It doesn't show anything on the screen, so it might seem like it's not doing anything, but it is.
How do I stop it early?
If you started the command, it provides a number (PID). You can use this number to stop the process before the time runs out.
Does it keep the keyboard backlight on?
No, `caffeinate` does not control the keyboard backlight. You need to adjust your Mac's settings manually for that.
Details
Original description by the author
Keep a Mac awake with caffeinate during long builds, downloads, or supervised automation runs.
Popularity
- GitHub stars
- 48k
- Ranking position
- #2140
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
benchmark
Helps your agent measure code speed and performance. It's useful for ensuring things are fast and finding slowness issues.
affaan-m/ECC
content-hash-cache-pattern
Lets your agent use content hashes to cache file processing results. This avoids repeated processing and auto-invalidates the cache when content changes. Useful for speeding up slow tasks.
affaan-m/ECC
parallel-execution-optimizer
Makes your agent speed up complex tasks by breaking them into smaller parts and running them in parallel. It ensures everything is verified at the end.
affaan-m/ECC