StayUp – keep a Mac awake (lid closed) while AI agents are working
Yet another lid-closed utility when Amphetamine and KeepingYouAwake already exist.
Keep your Mac awake only while AI coding agents are working
Finally solves the half-open laptop problem by detecting actual agent activity.
Developers running AI coding agents on MacBooks
Amphetamine · caffeinate · KeepingYouAwake
This is a solution to this problem. Unlike caffeinate, it will prevent your MacBook from sleeping even with the lid closed, with no external power or display, using pmset disablesleep 1. Unlike other sleep-preventing apps, Adrafinil only activates when there’s an agent actively doing something. It detects agent activity through hooks it installs into Claude Code, Codex, and others. To reassure you it’s working, the app shows the active status in the menu bar, and it plays a chime when you close the lid.
Once the agent is done, Adrafinil detects it and lets the laptop go to sleep by setting pmset disablesleep back to 0. It will also let it sleep in case of overheating. And if you want to manually toggle it, you can install an optional MCP and tell your agent to keep the MacBook awake for a specific time.
It has four binaries, one of which is a root helper exposing a single setSleepBlocked call. All the logic and policy live in the unprivileged parts. They’re all notarized, and the app is fully open source (MIT).
Yet another lid-closed utility when Amphetamine and KeepingYouAwake already exist.
Mac lid-closed awake toggle, but Amphetamine already does this better.
Yet another keep-awake app when Amphetamine and Caffeine already exist.
Useful for mobile agent work but macOS already has caffeinate and Amphetamine.
Agent-aware sleep prevention beats manual caffeine tools for long-running CLI tasks.
Terminal screensaver keeps Mac awake while cycling ASCII themes via a custom scene API.