Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
2 cautions to review before installing
A hook runs when Claude uses the Bash tool
A hook runs when Claude writes or edits files
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Keep your Mac awake while Claude Code is working. Fixes
API Error: Your computer went to sleep mid-response. The response above may be incomplete.
Claude Code already runs caffeinate on macOS, but as a relay: every 240 s it
kills the current caffeinate and spawns a new one. Between the two there is a
moment with no sleep assertion. While the display is on, powerd masks it. Once
the display is off, macOS idle-sleeps within seconds of the first rotation, and
the response in flight is lost. See
anthropics/claude-code#81832.
This plugin holds one caffeinate -i per session for the whole time Claude
is working and releases it as soon as Claude is idle.
Hooks drive a tiny shell script:
| Event | Action |
|---|---|
UserPromptSubmit | start a watchdog + caffeinate -i -w <watchdog>; set deadline +2 h |
PostToolUse | push the deadline forward (long tasks never expire) |
Stop | release; if background tasks are still running, extend instead |
Notification permission_prompt | release (Claude is waiting for you) |
SessionEnd | release |
The watchdog checks once a minute and exits (releasing caffeinate) when the
deadline passes, the Claude Code process is gone, or the Mac switches to
battery. Sessions are independent: each has its own watchdog; the Mac sleeps
when the last one releases.
Only idle sleep is prevented (-i). The display still turns off. Closing the
lid still sleeps the Mac. On battery the plugin does nothing.
/plugin marketplace add https://github.com/ctretyak/claude-code-plugins.git
/plugin install keep-awake@ctretyak
or from a shell:
claude plugin marketplace add https://github.com/ctretyak/claude-code-plugins.git --scope user
claude plugin install keep-awake@ctretyak --scope user
claude plugin enable keep-awake@ctretyak --scope user
The owner/repo shorthand also works, but it clones over SSH, so it needs a
GitHub SSH key set up. The HTTPS URL works everywhere.
While Claude is working:
pmset -g assertions | grep -A1 caffeinate
shows a caffeinate entry asserting on behalf of Process ID <watchdog>.
After the response ends it is gone. Activity log:
cat "${TMPDIR:-/tmp}/claude-keep-awake/log"
KEEP_AWAKE_TTL (seconds, default 7200): how long to keep holding after the
last hook event if Claude stops emitting events. Set it in the environment
Claude Code runs in.
MIT
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub ctretyak/claude-code-plugins --plugin keep-awakePlugins from other owners that cover similar ground