Keep your Mac awake while your coding agent is working
Caffeine keeps the one-click cup, then releases your Mac to sleep when Claude Code or Codex finishes a turn and waits for you.
macOS 14+ · MIT
How Caffeine stops your Mac sleeping during agent work
One click still does the job
Click the cup to keep the Mac awake. Click it again and macOS can return to its normal sleep settings.
Agent Watch follows the turn
Optional Claude Code and Codex hooks start a session with the work and release it when the agent finishes or needs input.
Protect the battery and display
Set timers, battery limits, display behaviour, and a best-effort closed-lid mode without rewriting system settings.
Control the same state from a CLI
Turn Caffeine on, start a timed session, switch it off, or read status as JSON from scripts and agents.
See what else is blocking sleep
The panel lists other processes holding power assertions, so you can tell who is really keeping the Mac up before blaming Caffeine.
No work data is uploaded
Prompts, process details, and hook payloads never leave the machine. Session markers are plain local files you can read yourself.
Native power control that stays on your Mac
- No administrator access
- The app uses normal macOS power assertions and does not install a privileged helper.
- Signed and notarised by Apple
- Public builds are signed with a Developer ID and notarised, so macOS can verify nothing changed since the build.
- Process watching is separate
- A fallback can watch several coding-agent processes, but it stays off until you choose the broader behaviour.
- Closed-lid mode is best effort
- Caffeine can request it, but macOS and the hardware make the final decision. System power settings are never rewritten.
Common questions about Caffeine
Which agents can Caffeine follow?
Does Caffeine change pmset?
Does anything leave my Mac?
Is this the original Caffeine app?
How do I prevent my Mac from sleeping?
Can Caffeine keep a Mac awake with the screen off?
Can Caffeine keep a Mac awake with the lid closed?
Will Caffeine stop when Codex or Claude Code finishes?
Let the Mac sleep when the agent has stopped doing useful work.
macOS 14+ · MIT