Adrafinil
keep a lid-closed Mac awake only while agents work
Details
- External ID
- 48701512
- Source
- HN
- Company
- —
- Product
- Adrafinil
- Website domain
- github.com
- Launched
- June 27, 2026
- Cohort
- —
- Upvotes
- 124
- Upvotes percentile
- 0.9323770491803278
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
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).
Enrichment
- Theme
- sleep, wake, and clock utilities
- Vertical
- Horizontal
- Function
- Agent / copilot
- Audience
- Developer
- AI stance
- AI feature
- Project type
- Hobby / open-source project
- Normalized one-liner
- keep mac awake while agents work
- Manually corrected
- False
Could you build this?
Partial The basic concept of keeping macOS awake can be done with CLI tools or assertions, but selectively allowing lid-closed execution tied specifically to agent process lifecycles requires low-level macOS private API handling.
What it would actually take: A production implementation requires a Swift/Objective-C daemon interacting with macOS IOKit (`IOPMAssertionCreateWithName`, preventing display sleep vs system sleep) and listening to lid close events via IOKit power management notifications. It also needs to actively monitor specific background process trees or network connections to automatically release the assertion when agent tasks terminate. Handling sleep prevention with the lid closed without external displays often requires root privileges or private IOKit properties (`AppleClamshellClosed`).
Discussion
20 comments analyzed.
Competitors mentioned: Amphetamine
Concerns raised: Thermal throttling reduces MacBook performance, Closing lid forces sleep on M-series Macs, Adrafinil has lower effectiveness for some users
Feature requests: Track battery and token usage while agents running
Competitors
Other products that read as similar to this one — 120 launches clear the similarity bar, closest 8 shown.
Attention rank: #21 of 121 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 170 days after the earliest competitor.
- Capsomnia · ph · 2026-07-25 · 158 upvotes · similarity 0.66
- agents-dont-sleep · github · 2026-09-23 · 8 upvotes · similarity 0.65
- Modafinil · hn · 2026-05-10 · 15 upvotes · similarity 0.63
- Open Caffeine · ph · 2026-06-01 · 162 upvotes · similarity 0.58
- Caffeine-for-Windows · github · 2026-09-28 · 14 upvotes · similarity 0.51
- Don't Lock My PC · ph · 2026-09-10 · 2 upvotes · similarity 0.49
- My Mac slept through its cron jobs, so I made goguma, a menu bar app · hn · 2026-08-19 · 8 upvotes · similarity 0.48
- NoSleepAgent · hn · 2026-06-01 · 6 upvotes · similarity 0.48
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a agent / copilot tool for Agriculture yet.