Adrafinil keeps MacBooks awake with lid closed only while AI agents are running
A developer has released Adrafinil, a free open-source macOS utility designed to prevent MacBooks from sleeping when the lid is closed, but only while an AI coding agent is actively running. The tool was built in response to a common workaround where engineers kept their laptop lids partially open in public spaces to avoid sleep interrupting long-running AI agent tasks. Unlike always-on tools such as Amphetamine, Adrafinil uses hooks into tools like Claude Code and Codex to detect agent activity and automatically re-enables sleep once the agent finishes. It uses the macOS pmset command to toggle sleep blocking and includes safety measures such as allowing sleep if the device overheats. The app is fully notarized, MIT-licensed, and displays its active status in the menu bar.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in