Mac keepawake
Codex skill for keeping macOS awake while locked Terminal agent sessions keep running
npx -y skills add cskwork/mac-keepawake-codex-skill --skill mac-keepawakeAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Keep macOS awake so locked-screen Terminal work keeps running. Use when a user wants Claude Code, Codex, shell jobs, dev servers, tmux/screen sessions, or other local agent processes to survive Mac screen lock, display sleep, or idle periods by using caffeinate, pmset checks, and a LaunchAgent.
SKILL.md
2.8 KB, 601 tokens by cl100k_base, as published. Nobody here has run it
Mac Keepawake
Outcome
Keep the Mac awake while allowing the screen to lock or turn off. The process target is Terminal work such as Claude Code, Codex, dev servers, or long-running shell jobs.
Mental Model
Screen lock is fine. System sleep is the problem: it pauses local processes, network I/O, and Terminal jobs. Prevent idle system sleep; do not disable security lock unless the user explicitly asks.
Workflow
- Restate the goal: keep processes running after lock, not bypass lock.
- Inspect current state before changing anything:
pmset -g custom
pmset -g assertions
launchctl print "gui/$(id -u)/com.codex.mac-keepawake" 2>/dev/null || true
- Prefer the bundled script for persistent setup:
python3 path/to/mac-keepawake/scripts/mac_keepawake.py install
python3 path/to/mac-keepawake/scripts/mac_keepawake.py status
- Report exact evidence from
launchctl printandpmset -g assertions.
Choosing a Mode
- Persistent login session: install the LaunchAgent. This survives new Terminal windows and restarts at login.
- Temporary command session: run
caffeinate -i -s <command>when the user wants only one command protected. - Battery-sensitive work: warn that
-sonly asserts full system sleep prevention on AC power; battery behavior may depend on macOS power policy.
Persistent Setup
The script creates this user LaunchAgent:
- Label:
com.codex.mac-keepawake - Plist:
~/Library/LaunchAgents/com.codex.mac-keepawake.plist - Command:
/usr/bin/caffeinate -i -s
Use install to write and bootstrap the agent, status to inspect assertions, and uninstall only when the user asks to remove it.
Validation
Claim success only when these checks are true:
launchctl print gui/$(id -u)/com.codex.mac-keepawakeshowsstate = runningorjob state = running.pmset -g assertionslistscaffeinatewithPreventUserIdleSystemSleep.- If on AC power,
pmset -g assertionsshould also listPreventSystemSleep.
Safety Notes
- Do not change lock-screen, password, FileVault, firewall, or remote-login settings for this task.
- Do not kill unrelated
caffeinateor Amphetamine processes. - Do not use destructive cleanup commands. The only removal path should be the script's own
uninstallcommand for the matching label and plist. - Explain that logout, reboot, shutdown, or a kernel panic will still stop ordinary Terminal processes. Recommend
tmuxorscreenfor session reattachment when relevant.
What ships with it: 2 files
2.8 KB alongside SKILL.md, 1 of them executable
agents/
- openai.yaml199 B
scripts/
- mac_keepawake.pyruns2.6 KB