Skip to content
cccskills
FreePublished on GitHub

anti-sleep

Keep a Mac awake for a chosen duration or while a specified process runs. The skill uses built-in macOS tools to manage one session, verify that sleep prevention is active, and control whether the display stays on.

OriginalShow the original description

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

See how to install

Good for

  • Keep a Mac awake during a lengthy task
  • Prevent sleep while a specified process runs
  • Allow the display to dim while keeping the Mac awake
  • Check or stop an active sleep-prevention session

Files included (3)

  • SKILL.md2.7 KB
  • agents/openai.yaml43 B
  • scripts/anti-sleep.sh7.6 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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:
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.
scripts/anti-sleep.sh stop
  1. Start the new timer for the requested duration:
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.

scripts/anti-sleep.sh start-pid <PID>
  1. In a separate tool/shell call after the start command has returned, verify:
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

None of these stop sleep when the lid closes. For agent runs that must survive a closed lid, see Keep Claude Code running when your laptop is closed.

Example:

scripts/anti-sleep.sh start 10800 -i

Status and stop

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.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

4x4

FreeSummary

Work through sixteen open questions in four rounds to clarify major product decisions, risky changes, or large refactors. The agent adapts later questions to earlier answers, then turns your decisions into a step-by-step implementation plan.

  • Clarifying decisions before a major product change
  • Planning a large refactor
  • Deciding rollout order for a risky change
davidondrej/skills4.2KUpdated Oct 23, 2026

adr-verbatim

FreeSummary

Document approved decisions as concise ADRs, or architecture decision records. It preserves the user's meaning and conditions, removes conversational filler, follows the project's numbering, and presents the saved record for review.

  • Record a decision approved in conversation
  • Preserve the conditions and scope of a decision
  • Add a numbered ADR to existing records
davidondrej/skills4.2KUpdated Oct 23, 2026

ask-then-build

FreeSummary

Turn a feature or refactoring idea into a concise implementation prompt for another agent. It asks focused questions one at a time, records decisions, and includes development steps, validation, and working rules.

  • Clarify requirements for a new feature
  • Decide edge cases and failure behavior
  • Define the scope of a refactor
davidondrej/skills4.2KUpdated Oct 23, 2026

bb-cli

FreeSummary

Inspect and manage BB threads, environments, projects, and plugins through its command line interface. The skill guides agents to identify the correct targets, apply changes, and verify the resulting state.

  • Check BB projects and environment status
  • Manage skills and plugins
  • Create or operate threads
davidondrej/skills4.2KUpdated Oct 23, 2026

bb-plugins

FreeSummary

Create, install, and debug TypeScript plugins that extend bb with custom pages, sidebar panels, CLI commands, agent tools, themes, and other features. The skill also guides development reloads, log checks, and verification of installed plugins.

  • Add a custom page or sidebar panel to bb
  • Create a bb CLI command or agent tool
  • Investigate plugin errors through logs
davidondrej/skills4.2KUpdated Oct 23, 2026

before-building

FreeSummary

Identify one to three important decisions before starting a build. Based on the user's idea, this skill presents concise options and an initial recommendation for each, then waits for answers before work proceeds.

  • Clarifying important decisions before implementation
  • Deciding whether a solution needs to be reusable
  • Choosing between a short script and a separate module
davidondrej/skills4.2KUpdated Oct 23, 2026

See all skills by davidondrej

Report a problem with this skill