A Show HN keeps your Mac awake while AI agents work. The thread: that's a built-in command and a 15k-line reinvention
Adrafinil keeps a lid-closed Mac awake only while your agents are running, then lets it sleep. The replies are a tidy parable of the AI tooling boom: macOS has shipped 'caffeinate' for years, Amphetamine does the triggers, and Codex already added the toggle.
Adrafinil, a Show HN named after a modafinil derivative, keeps a lid-closed Mac awake only while AI agents are working, then sleeps. Useful — until the thread points at the wheel it reinvents.
macOS ships 'caffeinate -dimsu.' Amphetamine has done conditional triggers for years. One commenter compressed the whole thing to a three-line shell loop; another asked why a sleep toggle needs 15,000 lines of code; a third noted the coding agent itself just shipped the feature.
What it does
Adrafinil is a Show HN with a clean pitch and a wink of a name — borrowed from a modafinil derivative — for the agent era: it keeps a lid-closed Mac awake only while your AI agents are running, then lets it sleep, so an overnight coding run doesn't require leaving the whole machine on. The premise is reasonable; the thread is a master class in HN's favorite response to a new tool, which is to point at the simpler thing it replaced.

The pile-on, in increasing severity
First, the built-in command that already does this:
"I have been using the builtin macOS
caffeinatecommand for this. For example:caffeinate -dimsu… You can also wrap your command as well." — a commenter pointing at the OS built-in
Then the existing app that already does the conditional version — the supposed novelty:
"But Amphetamine has an option to end when an app closes. I'm just so confused why everyone using ai is reinventing solutions that already exist." — a commenter with \~9.2k karma
Then the size complaint, which is its own punchline:
"15k loc for this? holy cow" — a commenter on the line count
One engineer even posted the three-line shell loop that captures the entire idea — touch a file, disable sleep, poll until the agent deletes it.
The part that's actually a story
The reflexive dunk is easy; the interesting bit is what it's a symptom of. A reader noted the coding agents themselves are absorbing the feature: "Codex recently built this in — 'Prevent sleep while running' toggle." That's the real arc. A whole micro-genre of "keep my machine awake for the agent" tools is being born and obsoleted in the same season, because the platforms and the agents are racing to ship the same checkbox. Adrafinil isn't bad software; it's a timestamp — a snapshot of the moment when "wrap a built-in command for AI workflows" briefly looked like a product, right before the built-ins grew the toggle themselves.
Get breakdowns like this every day
The top Hacker News stories, unpacked — by email, Telegram, or RSS.
A widget shows you the strangers reading the same page — no accounts, no history. The old web fans loved it; the veterans winced
Town Square drops live stick-figure visitors onto any website so they can see and message each other, then forget it all when they leave. It charmed the indie-web crowd — until people who ran communities started listing what 'no moderation, no permanence' actually costs.