Adrafinil – keep a lid-closed Mac awake only while agents work

A month ago there was a wave of posts and tweets about engineers walking around cafes and parks with their MacBooks propped half-open, as fully closing the lid forces sleep that stops their AI agents. Some people made snarky comments about using tmux or Amphetamine, and some defended their choice with “but I only need it sometimes, and forgetting to disable Amphetamine and finding my laptop discharged in my bag is worse.”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).

Hacker NewsToolAISource
0Sign in to voteCopy link

FL score

65

out of 100

Verdict

VALIDATE

high confidence

Competition

No competitor data yet

Trend

No signal yet

A Mac app that keeps the laptop awake with the lid closed only when AI agents are actively running, preventing unwanted sleep and battery drain.

The pain

MacBooks sleep when the lid is closed, stopping AI agents from running, forcing users to keep the lid half-open or use clunky workarounds that can drain battery or require manual toggling.

The gap

Existing tools either keep the Mac awake all the time or require manual activation, leading to battery drain or user error. No current solution dynamically detects agent activity to manage sleep intelligently.

Build angle

Focus on seamless integration with popular AI agents, reliable detection of activity, and user trust through transparency and safety features like overheating protection and open source code.

Strengths

  • Solves a specific, real pain point for AI developers using MacBooks
  • Automates sleep management based on actual agent activity
  • Open source and notarized, increasing trust and security
  • Includes safety features like overheating detection
  • Integrates with popular AI agent frameworks

Risks

  • Niche user base limits market size
  • Technical complexity in reliably detecting agent activity across different AI tools
  • Potential macOS updates could break functionality or require constant maintenance
  • Users may prefer existing manual or simpler solutions
  • Root helper and system-level changes may raise security concerns

Questions about this idea?

FlyBot reads the scoring and gives you a second opinion on “Adrafinil – keep a lid-closed Mac awake only while agents work”.

Open FlyBot