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
- lvndry/skillstheir own version, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 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
- Distinctive: line 32
Default recommendation when intent is vague: flex (protects while working, saves power when idle).
≈ “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.
Files
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 passwordlesssudoersrule.
Modes → run on user intent (don't re-ask if the intent is clear)
| User wants | Command | Behavior | Needs lid auth |
| Never sleep until I stop (lid/unplug/battery too) | bash scripts/keep-awake.sh on super | levers 1+2 always on | yes |
| Awake only while you work, sleep when idle | bash scripts/keep-awake.sh on flex | levers 1+2 while working; auto-release on Stop | yes |
| Just don't dim/sleep while I'm here | bash scripts/keep-awake.sh on normal | lever 1 only; lid-close sleeps | no |
| Stop / allow sleep | bash scripts/keep-awake.sh off | resets 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 disablesleepauth is missing, say so honestly and print the auth guide.on super/on flexalready do this. - ❌ Never leave
disablesleepstuck on —offand 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
offwhen 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/disarmare 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(needsrumps) shows the mode in the macOS menu bar and lets the user switch/stop by click. Installed viainstall.sh(LaunchAgentcom.keep-awake.menubar). Note: never userumps.alert(modal) in it — it freezes the menu; surface hints in the dropdown detail row.scripts/statusline.shis an optional Claude CodestatusLineprovider.
Platform
macOS only (relies on caffeinate / pmset). Apple Silicon + Intel. The script exits with a clear message on non-Darwin systems.
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
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.

