A Claude Code plugin that lets you close your MacBook lid while Claude works.
Claude Code already has built-in caffeinate -i support that prevents idle sleep during active work. But it doesn't prevent system sleep — so if you close your laptop lid, your Mac sleeps and Claude stops.
This plugin adds the -s flag, which prevents sleep even when the lid is closed (while on AC power). It's opt-in: run /caffeinate in your session when you want to walk away with the lid closed.
/caffeinate:caffeinate
That's it. Your Mac will stay awake — even with the lid closed — while Claude is actively working. The caffeinate process automatically expires 30 minutes after Claude's last tool use, so your Mac will sleep normally once Claude is done.
To disable mid-session:
rm /tmp/claude-caffeinate-enabled
/caffeinate creates a flag file at /tmp/claude-caffeinate-enabledPreToolUse hook checks for that flagcaffeinate -is -w <claude_pid> -t 1800/caffeinate-w <pid> — tied to the Claude Code process. If Claude crashes or is force-quit, caffeinate exits immediately. No orphans.-t 1800 — 30-minute deadman switch. If Claude stops calling tools, your Mac can sleep within 30 minutes.-is — prevents idle sleep + system sleep (lid close on AC power). Does not prevent sleep on battery.Add the marketplace, then install:
/plugin marketplace add jul-sh/claude-plugins
/plugin install caffeinate@jul-sh
Or add to your ~/.claude/settings.json:
{
"enabledPlugins": {
"caffeinate@jul-sh": true
},
"extraKnownMarketplaces": {
"jul-sh": {
"source": {
"source": "github",
"repo": "jul-sh/claude-plugins"
}
}
}
}
caffeinate command)-s flag only prevents lid-close sleep on AC)Matches all tools
Hooks run on every tool call, not just specific ones
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub jul-sh/claude-plugins --plugin caffeinateClaude plans, Claude implements, Claude reviews. One command.
Codex plans, Claude implements, Codex reviews. One command.
Prevents your computer from sleeping while Claude Code works hard
Manage macOS caffeinate to prevent system sleep
Autonomous task execution daemon that monitors Claude usage windows and executes predefined tasks automatically. Keep Claude working 24/7 on your projects.
macOS security hardening for Claude Code — PreToolUse/PostToolUse hooks that block secret exfiltration, prompt injection, persistence, and self-tampering.
Claude Code power utilities: auto-titling sessions and sound notifications
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.