Adrafinil is an open-source macOS utility that prevents a Mac from sleeping while AI coding agents are actively working. It automatically detects agent activity through integrations with Claude Code, Codex, Cursor, Gemini CLI, and other development assistants. A privileged helper enables continued operation when a MacBook lid is closed. Each agent session receives an independent sleep-prevention hold that ends when its work finishes. Overlapping sessions keep the computer awake until all active holds are released. Thermal protection prevents excessive heat during unattended operations. Abandoned session detection automatically removes unnecessary holds. Users can configure manual or timed controls through the menu bar, command-line interface, and MCP integrations. Optional activity summaries provide information about recent agent operation.
Features
- Automatic Mac sleep prevention during active AI coding agent sessions
- Closed-lid operation through a privileged macOS sleep management helper
- Claude Code, Codex, Cursor, Gemini CLI, and other coding agent integrations
- Independent session tracking with automatic release after all agents finish
- Thermal safety cutoff with abandoned session detection and cleanup
- Manual sleep controls, timed holds, and command-line or MCP automation