agentleFS
aurthuraurthur/keep-awake/SKILL.md

keep-awake

Skill2 starsChanged 5 months agoMITView on GitHub

Keep macOS awake while AI agents / long tasks run — no display sleep, no system sleep, and optionally no sleep even with the lid closed (clamshell), external display unplugged, or on battery. Three modes: super (never sleep until stopped), flex (awake only while the agent works, auto-released when it stops), normal (display only — sleeps when lid closes). Use when the user wants to prevent the Mac from sleeping, keep the screen on, stay awake with the lid closed, or keep an agent running unattended. Triggers / 触发词: keep awake, prevent sleep, never sleep, stop mac sleeping, keep display on, stay awake with lid closed, clamshell, caffeinate, don't let my computer sleep, 防休眠, 防止系统休眠, 合盖不休眠, 保持唤醒, 让电脑不休眠, 挂机不休眠, 别息屏, 别休眠.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. lvndry/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default recommendation when intent is vague: flex (protects while working, saves power when idle).

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

keep-awake — keep a Mac awake while AI agents work (macOS only)

The script scripts/keep-awake.sh is the single entry point. State lives in ~/.keep-awake/.

Two levers (the whole mechanism)

  • caffeinate -dims — blocks display / idle / disk / system sleep. No privileges. Cannot block lid-close sleep.
  • pmset disablesleep — blocks all sleep incl. lid-close / on-battery. Needs root via a one-time passwordless sudoers rule.

Modes → run on user intent (don't re-ask if the intent is clear)

User wantsCommandBehaviorNeeds lid auth
Never sleep until I stop (lid/unplug/battery too)bash scripts/keep-awake.sh on superlevers 1+2 always onyes
Awake only while you work, sleep when idlebash scripts/keep-awake.sh on flexlevers 1+2 while working; auto-release on Stopyes
Just don't dim/sleep while I'm herebash scripts/keep-awake.sh on normallever 1 only; lid-close sleepsno
Stop / allow sleepbash scripts/keep-awake.sh offresets everything incl. disablesleep—

Default recommendation when intent is vague: flex (protects while working, saves power when idle).

Hard rules

  • ❌ Never fake "awake with lid closed" — if pmset disablesleep auth is missing, say so honestly and print the auth guide. on super / on flex already do this.
  • ❌ Never leave disablesleep stuck on — off and the flex Stop hook always reset it to 0.
  • ⚠️ Before super (or flex while working): tell the user closed-lid + no external display runs hot, and it never sleeps on battery — run off when done.
  • ⚠️ For normal mode with an external display + power: closing the lid enters macOS clamshell mode and stays awake — a hardware behavior, not controllable here.
  • arm / disarm are hook-internal; never call them manually.

Flex auto-cycle (optional, Claude Code only)

on flex safe-merges two hooks into ~/.claude/settings.json: UserPromptSubmit → keep-awake.sh arm (engage while working) and Stop → keep-awake.sh disarm (release when idle). This makes protection follow the agent's work automatically. off removes them.

Menu bar / status indicators (optional)

  • scripts/menubar.py (needs rumps) shows the mode in the macOS menu bar and lets the user switch/stop by click. Installed via install.sh (LaunchAgent com.keep-awake.menubar). Note: never use rumps.alert (modal) in it — it freezes the menu; surface hints in the dropdown detail row.
  • scripts/statusline.sh is an optional Claude Code statusLine provider.

Platform

macOS only (relies on caffeinate / pmset). Apple Silicon + Intel. The script exits with a clear message on non-Darwin systems.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.