June 27, 2026 · Updated September 9, 2026 · 8 min read
Caffeine vs Amphetamine vs Hold My Lid: Which Mac Keep-Awake App is Best?
There are three serious options for preventing your Mac from sleeping when you don't want it to. We built one of them, so here's an honest breakdown of all three — including where ours isn't the right choice.
TL;DR
- Caffeine — free, one-click toggle. Best for presentations / non-developer use. Doesn't reliably prevent sleep on lid close for Apple Silicon.
- Amphetamine — free, powerful scheduling and trigger rules. Best free option for general use. No awareness of whether your coding agents are actually working.
- Hold My Lid — $9.99 one-time, agent-aware. Keeps your Mac awake exactly as long as Claude Code, Codex, Cursor, or Gemini needs it. Auto-sleeps when they're done. Best app for developers running AI agents.
Caffeine
Pros
- ✅ Completely free
- ✅ Simplest possible UI — one icon, one click
- ✅ No account, no setup
- ✅ Open source
Cons
- ❌ Won't keep lid-closed Macs awake (Apple Silicon)
- ❌ Always manual — no automation
- ❌ No battery protection
- ❌ Largely unmaintained
Caffeine holds a PreventUserIdleDisplaySleep assertion — the lighter of the two main wake assertion types Apple documents in IOKit. This prevents the display from sleeping but, critically, does not use the system-level assertion that prevents lid-close sleep on Apple Silicon MacBooks.
For an Intel Mac with the lid open, or any Mac connected to an external display, Caffeine works perfectly well. For the increasingly common scenario of closing a MacBook Pro M-series lid and putting it in a bag while something finishes running — Caffeine is the wrong tool.
There's also the maintenance angle: the original Caffeine app hasn't seen meaningful updates in years. Third-party forks and successors exist (IntelliScape's Caffeine, Lungo, etc.) but the confusion around which version to use doesn't help.
Verdict: Caffeine is fine for keeping your screen from going dark during a presentation. If you need lid-closed wake lock or any kind of automation, look elsewhere.
Amphetamine
Pros
- ✅ Free from Mac App Store
- ✅ Uses the right assertion for lid-closed
- ✅ Scheduling (time-based sessions)
- ✅ Trigger rules (app running, USB mounted, etc.)
- ✅ Battery percentage cut-off
- ✅ Actively maintained
Cons
- ❌ No agent lifecycle awareness
- ❌ Can't distinguish "agent working" vs "agent idle"
- ❌ No finish notifications for agent tasks
- ❌ Trigger rules require manual setup per agent
- ❌ Will stay awake as long as a process runs, not as long as it works
Amphetamine is genuinely excellent software and the right answer for most people who need a free keep-awake app. Its trigger-based sessions are powerful: you can tell it "keep awake while Terminal is running" or "keep awake while this USB drive is mounted." For many workflows, that's enough.
The problem for developers running AI coding agents is that a trigger like "keep awake while Claude Code is running" doesn't reflect reality. Claude Code can be open in your terminal for hours while you're doing other things — writing docs, in meetings, eating lunch. The agent isn't doing anything. But Amphetamine doesn't know that, so your Mac never sleeps.
The flip side: if you close Claude Code when you're done, Amphetamine turns off correctly. But keeping track of when to close and reopen agents is exactly the kind of manual babysitting that defeats the purpose of having agents in the first place.
Verdict: Amphetamine is the best free option for general Mac keep-awake needs. For AI agent workflows, it's a square peg in a round hole — you'll either waste battery or add manual steps.
Hold My Lid
Pros
- ✅ Agent-aware: knows when your agents are working
- ✅ Auto-sleeps when agents go idle
- ✅ Claude Code & Codex lifecycle hooks (accurate state)
- ✅ Notifies you when agents finish
- ✅ Battery guardrails + "plugged in only" mode
- ✅ Display-off control to save even more battery
- ✅ One-time payment, works on 3 Macs
Cons
- ⚠️ $9.99 (not free)
- ⚠️ Overkill if you don't use AI agents
- ⚠️ Process detection (not hooks) for some agents
Hold My Lid was built from a specific frustration: closing the MacBook lid mid-Claude-Code-session and coming back to find it had gone to sleep and the task had been interrupted. The fix seemed obvious — hold a wake assertion while the agent works — but the missing piece was knowing when the agent is actually working vs. just sitting open.
Lifecycle hooks: why they matter
Claude Code, Codex, and OpenCode expose lifecycle hooks — shell scripts that get called when the agent starts a task, finishes a task, or switches to idle. Hold My Lid installs these hooks automatically and uses them to maintain accurate per-session state: each terminal window running an agent is tracked independently.
This means if you have three Claude Code sessions open — one working, one idle — Hold My Lid holds the wake assertion for the one that's working and releases it as soon as it finishes. Amphetamine would keep everything awake until you close all three.
Honest about limits (just like Amphetamine)
Both Hold My Lid and Amphetamine use the same documented macOS assertion types. Neither can override Apple's hardware lid sensor in all scenarios — macOS has become more aggressive about sleep in some edge cases. Hold My Lid documents this transparently rather than overselling.
Verdict: Hold My Lid is the best Mac keep-awake app for developers running AI coding agents. It's the only app that understands the difference between an agent that's working and one that's just open. If that distinction matters to you, it's worth the $9.99.
Full feature comparison
| Feature | Caffeine | Amphetamine | Hold My Lid |
|---|---|---|---|
| Price | Free | Free | $9.99 once |
| Lid-closed wake lock (Apple Silicon) | ⚠️ Partial | ✅ | ✅ |
| Knows when agent is WORKING vs. OPEN | ❌ | ❌ | ✅ |
| Auto-sleep when agents finish | ❌ | ❌ | ✅ |
| Claude Code hooks | ❌ | ❌ | ✅ |
| Codex / OpenCode hooks | ❌ | ❌ | ✅ |
| Cursor / Gemini / Aider detection | ❌ | Process-only | ✅ Process |
| Finish notifications | ❌ | ❌ | ✅ |
| Battery cut-off | ❌ | ✅ | ✅ |
| "Plugged in only" mode | ❌ | ✅ | ✅ |
| Display-off while agents run | ❌ | ✅ | ✅ |
| Active maintenance | ⚠️ Minimal | ✅ | ✅ |
Pick the right one for you
Choose Caffeine if:
You just need to prevent screen sleep during presentations, you have an external display, or you want the absolute simplest possible option with no setup.
Choose Amphetamine if:
You need scheduling, time-based sessions, or non-developer trigger rules (USB mount, specific app running) and free is a hard requirement.
Choose Hold My Lid if: (recommended for developers)
You use Claude Code, Codex, Cursor, Gemini CLI, or any AI coding agent and want your Mac to stay awake exactly as long as the agents are working — then sleep automatically when they're done. Hold My Lid is the best Mac app for this workflow, and the only one built specifically for it.
Sources
- Apple Developer: kIOPMAssertionTypePreventUserIdleDisplaySleep
- Apple Developer: kIOPMAssertionTypePreventUserIdleSystemSleep
- Caffeine for Mac on GitHub (IntelliScape fork)
- Lungo by Sindre Sorhus
- Amphetamine on the Mac App Store
- Claude Code documentation: Hooks
- OpenAI Codex documentation: Hooks
- OpenCode documentation: Plugins
Try Hold My Lid free
Download the free trial, see the hooks install in 30 seconds, close the lid, and watch it work. $9.99 one-time if you love it.