SkillsReviewed · davidondrej

Anti-Sleep

Anti-Sleep is a skill for AI-assistant users who need to keep a Mac awake during long tasks, but it cannot prevent sleep when the laptop lid closes. It wraps macOS caffeinate in a one-shot user LaunchAgent and supports a timer or a running process ID.

Researched 15 Nov 2026

In short.

Anti-Sleep is a macOS skill for AI-assistant users running long tasks, but its keep-awake settings do not cover a closed laptop lid. It starts the built-in caffeinate utility through a one-shot user LaunchAgent, supports timed and process-bound sessions, and checks for a matching power assertion. Invocation must be explicit. Runtime reliability and assistant compatibility have not been tested.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage comprises skills/anti-sleep/SKILL.md, skills/anti-sleep/agents/openai.yaml and skills/anti-sleep/scripts/anti-sleep.sh at revision 021cbb6eeb86982553f4a2018ea28067606f2ff7, plus the repository-level LICENSE notice. Other repository skills, the linked closed-lid guide and external assistant documentation are excluded. Runtime behavior, assistant integration, macOS-version compatibility and energy impact were not tested.

The overview

Identity

Anti-Sleep lives in the skills/anti-sleep folder of davidondrej/skills. It consists of assistant instructions in SKILL.md, an invocation-policy file in agents/openai.yaml and a Bash launcher in scripts/anti-sleep.sh.

The source snapshot is available at [https://github.com/davidondrej/skills/tree/021cbb6eeb86982553f4a2018ea28067606f2ff7/skills/anti-sleep]. The instructions require explicit /anti-sleep invocation, and the YAML policy also disables implicit invocation.

Assessment

The implementation offers a focused way to request a bounded wake session from an assistant. Useful details include status and stop commands, detection of an existing managed session, and cleanup if startup cannot establish a visible power assertion.

Its suitability depends on keeping the Mac's lid open and having a working user LaunchAgent environment. These findings come from the supplied source; successful operation on a real Mac has not been established.

Users

The skill suits Mac users who ask an AI assistant to manage wake settings during lengthy work. A beginner can request a duration, while a developer who knows the process ID of a running task can tie the wake session to that process.

It is less suitable for unattended work that requires closing a laptop lid. The supplied files do not establish Windows, Linux or headless macOS support.

Capabilities

The launcher supports start SECONDS, start-pid PID, verify, status and stop. Timers must be at least five seconds. Process mode checks that the supplied PID exists before starting.

The default flags, -d -i, keep the display on and prevent idle system sleep. Using -i alone allows display sleep. The documented -d -i -s combination also requests prevention of system sleep while on AC power. Verification reports the caffeinate PID, command and assertion status, with a scheduled expiry for timers or a target PID for process-bound sessions.

Using it

Requirements

The script uses Bash and built-in macOS utilities, including caffeinate, launchctl and pmset. It targets the current user's gui/<uid> launchd domain and needs write access beneath ~/Library/Caches/com.davidondrej.anti-sleep.

Assistant use requires a host that can load the skill and execute local shell commands. Supported assistant versions, a minimum macOS version and host-specific installation locations are not supplied. No third-party runtime installation or network request appears in the launcher.

Mechanism

The launcher writes a property-list file describing a user LaunchAgent named com.davidondrej.anti-sleep. Its arguments invoke /usr/bin/caffeinate with either -t for a duration or -w for a target process. RunAtLoad is enabled and KeepAlive is disabled.

A separate state file records the mode, target, flags, caffeinate PID, start time and timer expiry. The cache directory receives mode 700 and the generated files mode 600. A directory lock coordinates launcher operations, and stop removes only the named LaunchAgent and its generated files.

Verification obtains the LaunchAgent's PID, checks that its command begins with /usr/bin/caffeinate and looks for that PID in pmset power assertions. This establishes the intended verification method, not an observed runtime result.

Setup

Obtain the full skill folder from the original repository and preserve the relative locations of SKILL.md, agents/openai.yaml and scripts/anti-sleep.sh. The instructions resolve the launcher relative to SKILL.md, so the assistant should not assume its current working directory contains the script. The supplied files do not describe installation into individual assistant products.

The documented operating sequence is to inspect status, stop an existing session when replacing it, start the requested session, then verify in a separate shell call. The assistant instructions require automatic replacement, while the script itself refuses to start over an active managed caffeinate process; the caller must perform the stop step.

Example

For a three-hour session that permits the display to sleep, the documented command is scripts/anti-sleep.sh start 10800 -i, after checking status and stopping any existing session. The path assumes the skill directory; an assistant must resolve it from the installed skill location.

A subsequent, separate call to scripts/anti-sleep.sh verify is required by the instructions. Success is defined as STATUS=running and ASSERTIONS=active, with the PID, flags and timer expiry reported. This is an illustrative sequence; nothing was executed.

Assessment & evidence

Limitations

The documentation explicitly says these settings do not prevent sleep when the lid closes and cannot keep the keyboard backlight on. Only one managed session is supported per user because the launcher uses a fixed service label and state location.

Verification looks for a caffeinate assertion associated with the managed PID; it does not separately validate every requested assertion type. Flags printed in the verification output come from saved state.

Code inspection also indicates a reporting edge case: after a process-bound session ends normally, retained state can produce STATUS=failed. Only timer mode has an explicit expired outcome. This behavior has not been exercised.

Reasoning

The central design choice is to let launchd supervise caffeinate independently of the assistant's temporary execution shell. This addresses the shell-lifetime problem described in SKILL.md. KeepAlive=false avoids configuring automatic restarts after the one-shot process exits.

Separate verification checks whether the process remains present after the start call returns. Exact-label shutdown also limits the stop operation to this skill's managed service. These choices support its narrow purpose, while actual reliability remains unverified.

Alternatives

The bundled launcher exposes a command-line interface that can be used without an assistant; the skill adds invocation controls and operating instructions.

If launchctl bootstrap fails, the documentation proposes using a visible persistent terminal or a cmux pane. It requires reading the separate cmux skill before interacting with cmux. That skill is outside the supplied evidence, so its setup and behavior were not assessed. Other keep-awake products were not assessed.

Evidence

The evidence contains the complete supplied skill folder: SKILL.md, agents/openai.yaml and scripts/anti-sleep.sh, together with the repository-level LICENSE. The instructions describe intended operation, the YAML establishes the implicit-invocation policy, and the script establishes the implemented commands and verification logic.

The launcher source is available at [https://raw.githubusercontent.com/davidondrej/skills/021cbb6eeb86982553f4a2018ea28067606f2ff7/skills/anti-sleep/scripts/anti-sleep.sh]. No execution results, compatibility matrix, reliability measurements or power-use measurements are supplied.

Access & freshness

Costs

The supplied files state no price, subscription terms or support fees. The launcher uses built-in macOS tools and contains no API billing or network-request code.

Any charges associated with the assistant used to invoke the skill are unknown. Energy consumption and battery impact are not quantified.

Rights

The repository LICENSE is the MIT License, with copyright attributed to David Ondrej in 2026. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.

The licence provides the software without warranty and disclaims liability. The original notice is available at [https://raw.githubusercontent.com/davidondrej/skills/021cbb6eeb86982553f4a2018ea28067606f2ff7/LICENSE].

Freshness

The supplied snapshot was captured at 2026-11-15T22:55:46.815Z and is pinned to Git revision 021cbb6eeb86982553f4a2018ea28067606f2ff7. These findings apply to that revision.

No release version or commit date is supplied. Changes on the repository's main branch after the captured revision are unknown.

Actions

Before relying on the skill for lengthy work, confirm that your assistant supports its installation format and that your Mac can load the user LaunchAgent. Choose whether the display should remain on; -i alone is the documented option when only idle system sleep needs preventing.

For an initial local check, use a short timer and follow the documented separate verification step. Confirm the managed PID and requested flags, then check stop behavior. For process-bound use, also check the status reported after the target exits. If verification fails, the instructions require stopping the session and treating wake protection as unavailable.

Evidence for this report

LICENSEnotice · checked 2026-11-15
skills/anti-sleep/SKILL.mdselected · checked 2026-11-15
skills/anti-sleep/agents/openai.yamlselected · checked 2026-11-15
skills/anti-sleep/scripts/anti-sleep.shselected · checked 2026-11-15