Agent skill

Anti Sleep

by davidondrej in davidondrej/skills

Keep a Mac awake for a set duration or while a process runs.

MITAuto-check: warnings

Install Anti Sleep

The automated check flagged lines worth reading first. See the safety section below.

skills CLI
$ npx skills add davidondrej/skills --skill anti-sleep -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install davidondrej/skills anti-sleep --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/davidondrej/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/ops-and-setup/anti-sleep .claude/skills/anti-sleep && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anti-sleep
GitHub stars
4.1k
Token cost
~640 tokens
SKILL.md length
289 words
Files
3 (incl. scripts)
Skills in repo
51
Repo updated
First seen
Licence
MIT

At a glance

Keep a Mac awake for a set duration or while a process runs.

  • Works in 3 steps: Inspect current state → If status reports an active session and… → Start the new timer for the requested…
  • Explicitly invokes /anti-sleep
  • SKILL.md covers Required workflow, Assertion flags, Status and stop and Fallback
  • Runs Shell scripts from its folder

What it does

Anti Sleep is an agent skill from davidondrej/skills. Keep a Mac awake for a set duration or while a process runs. Use only when the user explicitly invokes /anti-sleep.

Its SKILL.md is about 640 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `agents/openai.yaml` and `scripts/anti-sleep.sh`).

The repository describes itself as: access to david ondrej's personal agent skills. The licence is MIT.

When your agent uses it

  • Explicitly invokes /anti-sleep

Example prompts

  • “/anti-sleep”

Requirements

  • A Bash shell

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Inspect current state
  2. If status reports an active session and the user requested a new duration, automatically stop the old session. Never ask for confirmation.
  3. Start the new timer for the requested duration

What it can do on your machine

Read from SKILL.md and the folder at commit 387c2b8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Anti Sleep loads about 640 tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 289 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~640

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: warnings

The automated check found patterns that need a careful read before installing.

  • WarningTells the agent its actions are pre-authorized / not to stop for confirmationSKILL.md:23
    , automatically stop the old session. **Never ask for confirmation.**

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from davidondrej/skills at commit 387c2b8, republished under its MIT licence (© davidondrej). 289 words, ~640 tokens.

Download SKILL.mdSave it as .claude/skills/anti-sleep/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
anti-sleep
description
Keep a Mac awake for a set duration or while a process runs. Use only when the user explicitly invokes /anti-sleep.
disable-model-invocation
true

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
  1. 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
  1. 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>
  1. 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:

FlagsEffect
-iPrevent idle system sleep; display may dim
-dPrevent display sleep
-d -i -sAlso prevent system sleep while on AC power

Example:

bash
scripts/anti-sleep.sh start 10800 -i

Status and stop

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

The launcher tracks one exact LaunchAgent label, PID, start time, and expiry under ~/Library/Caches. It never uses broad pkill.

Fallback

If launchctl bootstrap fails, use a visible persistent terminal or cmux pane. Read the cmux skill before interacting with cmux. If no persistent surface is available, tell the user instead of starting an unreliable background job.

caffeinate cannot keep the keyboard backlight on. That setting is manual: System Settings → Keyboard → “Turn keyboard backlight off after inactivity” → Never.

© davidondrej, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (scripts) in skills/ops-and-setup/anti-sleep of davidondrej/skills.

  • SKILL.md
  • agents/openai.yaml
  • scripts/anti-sleep.sh

Open the folder on GitHubat commit 387c2b8

Compare with similar skills

Anti Sleep next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anti Sleep compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anti Sleep this skilldavidondrej/skills4.1k—~640Automated safety check: WarnMIT
Anti Sleepsickn33/agentic-awesome-skills47k1 repos~851Automated safety check: PassMIT
Remote Macsteipete/agent-scripts7.3k—~3.1kAutomated safety check: PassMIT
Skillopt Sleepalirezarezvani/claude-skills28k—~1.8kAutomated safety check: PassMIT
Release Openclaw Macopenclaw/openclaw392k—~2kAutomated safety check: PassMIT
Anti Reversing Techniqueswshobson/agents40k—~980Automated safety check: PassMIT

Similar skills

  • Anti Sleep

    sickn33/agentic-awesome-skills

    Keep a Mac awake with caffeinate during long builds, downloads, or supervised automation runs.

    47k GitHub starsUsed in 1 repo~851 tokens
    Auto-check passed
  • Remote Mac

    steipete/agent-scripts

    Remote Macs: MacBooks, Mac Studios, hosted claw Macs, Tailscale, SSH, and OpenClaw.

    7.3k GitHub stars~3.1k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Skillopt Sleep

    alirezarezvani/claude-skills

    A skill your agent uses when the user wants their Claude agent to self-improve from past usage, asks about a nightly/offline 'sleep' or 'dream' cycle, memory/skill consolidation, or says things like…

    28k GitHub stars~1.8k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Release Openclaw Mac

    openclaw/openclaw

    Run or recover OpenClaw macOS release signing, notarization, appcast, and asset promotion.

    392k GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Understand anti-reversing, obfuscation, and protection techniques encountered during software analysis.

    40k GitHub stars~980 tokensUpdated 6 days ago
    SecurityAuto-check passed
  • Python Anti Patterns

    wshobson/agents

    A skill your agent uses when reviewing Python code for common anti-patterns to avoid.

    40k GitHub stars~2k tokensUpdated 6 days ago
    DevelopmentAuto-check passed

More from davidondrej/skills

All 51 skills in this repo
  • Nagent

    davidondrej/skills

    Launch a new bb worker thread with the right project, model, worktree, and task brief.

    4.1k GitHub stars~1.7k tokensUpdated today
    Auto-check: notes
  • Browser Harness

    davidondrej/skills

    Direct browser control via CDP. An agent skill from davidondrej/skills.

    4.1k GitHub starsUsed in 2 repos~3k tokens
    Auto-check passed
  • Persistent Localhost

    davidondrej/skills

    Manage persistent dev servers, APIs, and other local processes on a port using macOS LaunchAgents.

    4.1k GitHub stars~618 tokensUpdated today
    Auto-check passed
  • Reset Cursor Acp

    davidondrej/skills

    Reset a stuck Cursor ACP thread in <chat-system and reload its configuration.

    4.1k GitHub stars~728 tokensUpdated today
    Auto-check passed
  • Bb CLI

    davidondrej/skills

    Use this when controlling bb. An agent skill from davidondrej/skills.

    4.1k GitHub stars~823 tokensUpdated today
    Auto-check passed
  • Boat

    davidondrej/skills

    Manage Boat (boat.dev, formerly Box by Ascii) cloud sandboxes via API, CLI, and SSH.

    4.1k GitHub stars~2k tokensUpdated today
    Auto-check: notes

Questions about Anti Sleep

What does Anti Sleep do?

Keep a Mac awake for a set duration or while a process runs. Anti Sleep is an agent skill from davidondrej/skills. Keep a Mac awake for a set duration or while a process runs.

When should I use Anti Sleep?

Anti Sleep fits situations like: explicitly invokes /anti-sleep.

How do I install Anti Sleep in Claude Code?

Run `npx skills add davidondrej/skills --skill anti-sleep -a claude-code`. Or copy the skill folder (skills/ops-and-setup/anti-sleep in davidondrej/skills) into .claude/skills/anti-sleep in your project. Claude Code loads it when a task matches its description.

How do I install Anti Sleep in Codex?

Run `npx skills add davidondrej/skills --skill anti-sleep -a codex`. Or copy the skill folder (skills/ops-and-setup/anti-sleep in davidondrej/skills) into .agents/skills/anti-sleep in your project. Codex loads it when a task matches its description.

Can I use Anti Sleep in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add davidondrej/skills --skill anti-sleep -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anti-sleep, .gemini/skills/anti-sleep, .github/skills/anti-sleep and .opencode/skills/anti-sleep in your project.

What does Anti Sleep need to run?

Going by SKILL.md and its folder, Anti Sleep needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Anti Sleep access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Anti Sleep safe to install?

Our automated static check of SKILL.md flagged 1 warning(s): tells the agent its actions are pre-authorized / not to stop for confirmation. Read the flagged lines before installing; the check is not a guarantee either way. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Anti Sleep use?

Anti Sleep is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anti Sleep use?

About 640 tokens (SKILL.md is roughly 2.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Anti Sleep?

Skills that share tags, products or a category with Anti Sleep: Anti Sleep (sickn33/agentic-awesome-skills, 47k stars), Remote Mac (steipete/agent-scripts, 7.3k stars), Skillopt Sleep (alirezarezvani/claude-skills, 28k stars) and Release Openclaw Mac (openclaw/openclaw, 392k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anti Sleep?

davidondrej (a GitHub user) maintains it in davidondrej/skills, which has 4,112 GitHub stars. The repository holds 51 skills in this directory. The repository was last updated on October 10, 2026.

Source: davidondrej/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.