# anti-sleep

> Claude/Codex skill by [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars · Updated 2026-11-01

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

## Install

```sh
git clone https://github.com/davidondrej/skills /tmp/skills && ln -s /tmp/skills/skills/ops-and-setup/anti-sleep ~/.claude/skills/anti-sleep
```

## From README

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: Inspect current state: If status reports an active session and the user requested a new duration, automatically stop the old session. Never ask for confirmation. Start the new timer for the requested duration: For a specific process, use start-pid. Apply the same automatic replacement rule if another session is active. In a separate tool/shell call after the start command has returned, verify: Only report success when verification returns STATUS=running and ASSERTIONS=active. Confirm the PID, flags, and wall-clock expiry.

## Links

- HTML page: https://omgskills.com/library/davidondrej/skills/anti-sleep/
- GitHub: https://github.com/davidondrej/skills
- Author: [@davidondrej](https://omgskills.com/library/davidondrej/index.md)

## More from this repo

- [adr-verbatim](https://omgskills.com/library/davidondrej/skills/skills/thinking-and-docs/adr-verbatim/index.md) — Record concise ADRs that preserve the user's decisions without conversational noise.
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
- [ask-then-build](https://omgskills.com/library/davidondrej/skills/skills/thinking-and-docs/ask-then-build/index.md) — Clarify a feature, change, or refactor through questions, then write a build prompt for another agent.
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
- [codex-subagent](https://omgskills.com/library/davidondrej/skills/codex-subagent/index.md) — Launch OpenAI Codex CLI as a subagent (ChatGPT subscription auth, no API key).
   - [@davidondrej](https://omgskills.com/library/davidondrej/index.md) · 4.2k stars
