Cocaffeinate — Development skill for Claude Code
Keep your Mac (or PC) awake while Claude or Codex works, lid closed, without cooking it.
How to install Cocaffeinate
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open ericporres/cocaffeinate and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Cocaffeinate does
Keep your Mac (or PC) awake while Claude or Codex works, lid closed, without cooking it.
Alternatives in Development
- Cc Caffeine — ☕️ Prevents your computer from sleeping while Claude Code works hard 70 ★
- Code With Quran — Read the Qur'an while Claude Code works 48 ★
- Goguma — Wakes your Mac for scheduled jobs, holds it awake while long work finishes, and lets it sleep otherwise 29 ★
README
cocaffeinate
Keep your Mac awake while your coding agent is working — even with the lid closed — without cooking it.
`caffeinate` keeps a Mac from dozing, but the moment you close the lid it sleeps anyway, and your long-running agent task dies with it. `cocaffeinate` holds the machine open through a closed lid for exactly as long as **Claude or Codex** is actually running, then hands sleep back to the OS the instant the agent quits. It watches the battery and the temperature while it does, so a laptop left running in a bag puts itself to sleep instead of overheating.
The name is the joke: **co-** as in **Co**dex and **C**laude **Co**de, and as in *collaborator* — the machine stays awake for the agent you're working with, not forever.
Where this came from
A friend texted me a LinkedIn post: Huel has a "laptops closed" mandate so people stay present in meetings. The one exception that keeps coming up is their Finance Director, who told the room "I can't close my laptop — I've got Claude running a big task for me." The post's punchline was a photo of a 3D-printed plastic hand you wedge under the lid to prop it open, and a joke about buying everyone one.
A plastic hand is a hardware patch for a software problem. It props the lid open with zero awareness — it will happily let your MacBook bake in a backpack on battery. So: a script instead. One that knows *why* it's keeping the lid open, and stops the moment the reason goes away.
What it does
There are two macOS levers, and then there's what cocaffeinate decides to do with them.
The levers:
caffeinatecan block idle, disk, display, and system sleep. No admin. But it does not survive a physical lid close.pmset disablesleepsets the kernel flag that does survive a closed lid on battery with no external display. Needssudo. This is the part--lidturns on.
What cocaffeinate decides on top of them:
- System awake, screen asleep — it pulls
caffeinateso the system stays
Related Skills
Awake
Keep your Mac awake with the lid closed - safe by default, built for humans and agents
Clawake
Keep your Mac awake, even with the lid closed. Tiny native menu-bar app for long-running tasks: Claude Code, b
Agent Mode
Keep a MacBook awake for coding agents, lid open or closed, with automatic safety pauses
Caffeine
Keep your Mac awake while you work, then let it sleep when your coding agent waits for you.
Agents Sleep Preventer
Keep your Mac awake while Claude Code or Codex is working
Agent Caffeine
Keep macOS awake while a CLI coding agent works, and let it sleep when the network dies
Related Agents
macOS System Operator
Mac housekeeping and CLI operations — installing tools (brew/npm/curl installers), logins that open a browser,
Kit Recorder
Use when the main session must add observations to the ledger while a review batch is open and the ledger is c
Backlog
Use when work needs to be filed, found, claimed or closed in dirk's backlog — writing a cairn item, checking w