EN
Back to the archive

The archive · Developer & Business Tools · Product decision · 2026

Adrafinil keeps a Mac awake only while AI agents work — Show HN, 466 stars

macOS menu-bar utility that blocks lid-close sleep only while an AI coding agent has an active session — Show HN 124 points, 466 GitHub stars.

Adrafinil (kageroumado)

The betSleep control should be agent-activity-scoped: hold a closed-lid Mac awake only while an agent session lives, then clear — the opposite of always-on caffeinate.Live

What the business is

A free, MIT-licensed macOS menu-bar app whose privileged helper blocks system sleep only while an AI coding agent holds an active session, then returns the Mac to normal sleep behavior.

How it started

Built by the maker behind @kageroumado / kagerou.glass after the 3 a.m. case the README opens with: an agent is still mid-task in a session started hours earlier while the closed laptop lid has put the Mac to sleep. caffeinate and Amphetamine are 'stimulants' that keep the machine wired forever whether or not anyone is home, so Adrafinil was built as 'a eugeroic for machines' — named after the wakefulness-promoting prodrug — that does nothing until an agent acquires it and clears the moment the last session releases.

What happened

Adrafinil ships one-click hook installers for nine agents (Claude Code, Codex, Cursor, Gemini CLI, Aider, Hermes, OpenCode, Cline, Pi), a sub-50ms acquire/release CLI, a bundled MCP tool and time-boxed holds for long builds or deploys. A reference-counted daemon stacks overlapping sessions and force-releases on thermal cutout, idle timeouts or process death; a one-click installer registers a root helper via SMAppService, and distribution is a signed, notarized DMG plus the official Homebrew cask. It targets macOS 26.4+ ('Tahoe'), with a community backport fork covering macOS 15 Sequoia.

How it ended up

Still live as a single-developer open-source project as of 2026-09-05: 466 stars, 16 forks and 157 commits on GitHub, MIT-licensed; no company, funding round, price or revenue is disclosed in the material.

Background

Adrafinil is a macOS menu-bar app that prevents the system from sleeping — including clamshell, lid-closed sleep — exclusively while an AI coding agent has an active session, and leaves sleep behavior untouched when no agent is working. Its bet is that overnight agent runs are a real workflow, so the 'keep awake' category should be activity-scoped rather than always-on: the opposite of caffeinate or Amphetamine.

It works through three channels: automatic agent hooks that acquire on prompt submit and release on stop; an agent-driven time-boxed hold via a bundled MCP tool or the 'adrafinil hold' CLI for long builds and deploys; and a manual menu-bar Keep awake button. A reference-counted daemon stacks overlapping sessions, and safety nets — thermal cutout, idle release, dead-process sweeps — ensure a bag-bound Mac cannot cook itself while the lid is closed.

The architecture splits four products across three privilege tiers: the menu-bar app is a pure view, an unprivileged daemon holds all policy, and a tiny root helper is the only component that touches sleep-blocking APIs, exposing a single setSleepBlocked(Bool). The 2026-06-27 Show HN drew 124 points and 78 comments; by the 2026-09-05 fetch the MIT-licensed repo carried 466 stars, 16 forks and 157 commits, with a signed notarized DMG and an official Homebrew cask.

What has to be true

  • It inverted the existing category: caffeinate and Amphetamine keep the machine wired forever, while Adrafinil does nothing until an agent acquires it, making normal sleep the safe default.
  • It attached to agents' hook lifecycles — acquire and release keyed to session ids — so the right behavior happens automatically instead of depending on a user remembering a toggle.
  • It engineered for trust where it matters most — root sleep control — isolating it in an audited helper exposing only setSleepBlocked, with policy in an unprivileged daemon.
  • Thermal cutout, idle release and time-boxed holds turned an overnight closed-lid agent run from a fire hazard into a supported, defensible use case.

What can be applied

Don't out-feature general-purpose tools: find the lifecycle signal (here, the agent session) that makes a category behave correctly, and make the safe state the default.

Aftermath

As of 2026-09-05 Adrafinil is a live MIT-licensed open-source project: 466 stars, 16 forks and 157 commits on GitHub, installable from a signed notarized DMG or the official Homebrew cask, with hooks for nine agents, MCP support and a CLI. Development targets macOS 26.4+; a separate backport fork covers macOS 15 Sequoia. No company, funding, pricing or revenue is disclosed in the material.

Sources

spotted an error? The archive wants to know.

Your turn

You just read one. Describe what you are building, and see who is betting on the same thing.

Free account · 3 free questions · no card

Related cases