Live data from Hacker News

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

github.com

1–10 of 98 posts

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

#1
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).

Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work
github.com

Re: Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

#3
What's old is new again, but I welcome this.

I used to do this 15 years ago to keep listening to music from my laptop (one of the white chiclet ones) in my backpack, can't remember the name of the app I used then.

One caveat, your laptop cannot cool inside a backpack, it will overheat and shut down anyway. This happened to me several times.

Re: Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

#5

What's old is new again, but I welcome this. I used to do this 15 years ago to keep listening to music from my laptop (one of the white chiclet ones) in my backpack, can't remember the name of the app I used then. One caveat, your laptop cannot cool inside a backpack, it will overheat and shut down anyway. This happened to me several times.

had a coworkers whose laptop keys melted into mush

Re: Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

#6

What's old is new again, but I welcome this. I used to do this 15 years ago to keep listening to music from my laptop (one of the white chiclet ones) in my backpack, can't remember the name of the app I used then. One caveat, your laptop cannot cool inside a backpack, it will overheat and shut down anyway. This happened to me several times.

that was true of intel but definitely not of arm macbooks.

Re: Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

#8
Um so it is

    sudo bash -c 'touch KEEP_RUNNING; pmset -b sleep 0; pmset -b disablesleep 1; while [ -e KEEP_RUNNING ]; do sleep 1; done; pmset -b sleep 5; pmset -b disablesleep 0'
and

    Agent, when you're done do `rm KEEP_RUNNING`, kthxbye.
?

(personally I have Ruby scripts that check activity on "tmux capture-output" for that)

Re: Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

#9
post #6

What's old is new again, but I welcome this. I used to do this 15 years ago to keep listening to music from my laptop (one of the white chiclet ones) in my backpack, can't remember the name of the app I used then. One caveat, your laptop cannot cool inside a backpack, it will overheat and shut down anyway. This happened to me several times.

that was true of intel but definitely not of arm macbooks.

Then why do they have fans?
Post reply on HN