Anti Sleep

Keep a Mac awake for a set duration or while a process runs. Use only when the user explicitly invokes /anti-sleep.

4,336 stars 628 forksOther

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add davidondrej/skills --skill anti-sleep
Manual install
git clone --depth 1 https://github.com/davidondrej/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/anti-sleep ~/.claude/skills/anti-sleep

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Anti-Sleep (macOS caffeinate)

Use the bundled launcher from this skill directory. It creates a one-shot user LaunchAgent using only built-in macOS tools.

## Required workflow

Never launch `caffeinate` with raw `&`, `nohup`, `disown`, or `launchctl submit`. Temporary execution shells can kill their descendants, and `launchctl submit` can restart a timed job.

Resolve `scripts/anti-sleep.sh` relative to this `SKILL.md`; never assume the user's current directory. Run:

1. Inspect current state:

```bash
scripts/anti-sleep.sh status
```

2. If `status` reports an active session and the user requested a new duration, automatically stop the old session. **Never ask for confirmation.**

```bash
scripts/anti-sleep.sh stop
```

3. Start the new timer for the requested duration:

```bash
scripts/anti-sleep.sh start 10800    # 3 hours
```

For a specific process, use `start-pid`. Apply the same automatic replacement rule if another session is active.

```bash
scripts/anti-sleep.sh start-pid <PID>
```

4. In a **separate tool/shell call after the start command has returned**, verify:

```bash
scripts/anti-sleep.sh verify
```

Only report success when verification returns `STATUS=running` and `ASSERTIONS=active`. Confirm the PID, flags, and wall-clock expiry. If verification fails, run `stop` and do not claim the Mac is protected.

## Assertion flags

The default is `-d -i`: keep the display on and prevent idle system sleep. Pass explicit flags after the duration or PID when needed:
Read the full skill on GitHub

Details

Skill name
anti-sleep
Path
skills/anti-sleep/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the Anti Sleep skill do?

Keep a Mac awake for a set duration or while a process runs. Use only when the user explicitly invokes /anti-sleep.

How do I install the Anti Sleep skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add davidondrej/skills --skill anti-sleep. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Anti Sleep popular?

It lives in davidondrej/skills, which has 4,336 GitHub stars and 628 forks.

Related skills

Browse the most popular Claude skills, all other skills, or write your own with the skills generator.