覚醒
rx no.006· macOS· eugeroic

notes on adrafinil ・ rx no.006 ・ for macOS

You can close
your laptop now.

adrafinil keeps your Mac awake only while AI agents are working, lid fully closed. the instant the last session ends, it sleeps like it always did.

macOS · free · open source · MIT

01 ・ the ailment

Engineers are carrying laptops
half-open through airports.

you've seen the photos. lids held ajar like trays of water, through terminals and offices, because closing the MacBook kills the agent mid-task. someone sells a little silicone hand to prop the hinge. funny, until you see what it is: an unlocked machine, mid-session, in a public place.

Every wake utility you've tried is a stimulant. caffeinate, Amphetamine (named with refreshing honesty): always-on until you remember to switch them off, wired all night whether or not anyone's home.

adrafinil is the other thing. close the lid all the way: the screen locks, the machine becomes pocketable, and underneath, the work continues. the moment it finishes, real sleep. no toggle to forget.

02 ・ the eugeroic

Nothing happens
until an agent asks.

adrafinil, the drug, is a prodrug: inert until the body metabolizes it, wakefulness only when called for. the app holds to that at the API level. nothing happens until an agent acquires an assertion; sleep is blocked while ≥1 session holds one; the last release clears like a metabolite, and the Mac is asleep within moments.

One click wires it into the hook systems of Claude Code, Codex, Hermes, and the rest. a turn starting acquires; idle releases; overlapping sessions are refcounted, so sleep unblocks when the last one finishes. holds are scoped to activity, not to having a window open. an agent sitting at its prompt lets the Mac sleep normally. and the closed lid doesn't slow the work: foreground processes run at full speed under a hold, verified on-device.

03 ・ the label

A chime
in the dark.

close the lid on a working agent and a chime confirms the hold. the screen is already off, so it tells you the only way it can. open it in the morning and it tells you what happened while you slept.

服用注意 ・ side effects overriding clamshell sleep needs root, so it's kept in one tiny audited helper with a single switch: setSleepBlocked(Bool). all policy lives unprivileged, and the helper fits in one sitting of reading. while work is live, it uses pmset disablesleep, blunt by necessity: it also suppresses idle sleep while held. the helper resets it on respawn, so a crash can't leak a sleepless Mac; the manual escape hatch is sudo pmset -a disablesleep 0.

It sleeps when there's
nothing left undone.

macOS · free · open source · rx no.006

Download Adrafinil
assertions held: 0000000 ✚ 陽炎 webring ✚ ☾ ADRAFINIL ☽ it sleeps when there's nothing left to do ♡