← Back to AI Insights
Gemini Executive Synthesis

Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working.

Technical Positioning
A context-aware solution to prevent MacBooks from sleeping during AI agent activity, differentiating from generic sleep-preventing apps by activating only when needed and addressing battery drain concerns.
SaaS Insight & Market Implications
This product addresses a specific, emerging pain point for developers utilizing local AI agents on MacBooks. The market implication is a growing need for intelligent power management solutions that adapt to compute-intensive, background tasks, particularly those involving AI. Current solutions like `caffeinate` or generic keep-awake apps are insufficient due to battery drain and manual management overhead. Adrafinil's context-aware activation, tied to specific AI agent activity, highlights a trend towards more granular, automated system resource management. The open-source nature and focus on security (notarized, minimal privilege root helper) are critical for developer adoption. This product targets a niche but expanding segment of AI developers, indicating a market for specialized utility software that optimizes hardware utilization for AI workloads.
Proprietary Technical Taxonomy
pmset disablesleep 1 pmset disablesleep back to 0 Claude Code Codex root helper setSleepBlocked call unprivileged parts notarized

Raw Developer Origin & Technical Request

Source Icon Hacker News Jun 28, 2026
Show HN: Adrafinil – keep a lid-closed Mac awake only while agents work

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

Developer Debate & Comments

kylehotchkiss • Jun 28, 2026
`sudo pmset -a sleep 0`
AussieWog93 • Jun 28, 2026
How does this differ from https://github.com/samber/cc-caffeine?
exabrial • Jun 28, 2026
Amphetamine is what I use. It has a robust set of triggers, like if you ip address changes to a certain subnet (like private IPs on a work network)https://apps.apple.com/us/app/amphetamine/id937984704?mt=12
47 • Jun 28, 2026
I have been using the builtin macOS `caffeinate` command for this.For example:caffeinate -dimsuThat keeps the Mac awake so I can use Claude remotely from phone.You can also wrap your command as well, but I rarely use it.caffeinate -dimsu your-agent-command
lellow • Jun 27, 2026
Interesting. Kind of similar in purpose, but I created a simple app to schedule and type the "continue" word in my terminal after X time has passed, since I have to wait for my usage to be restored. =)
mr_toad • Jun 27, 2026
I’ve often wondered about the thermal performance or running a MacBook with the lid closed. One argument is that the reduced surface area from a closed lid increases temperature. Others argue that not running & rendering the display (and thus GPU) generates less heat. I’m not sure who to believe.
rancar2 • Jun 27, 2026
For MacOS, keep awake with:sudo pmset -a disablesleep 1Reset back:sudo pmset -a disablesleep 0
aqme28 • Jun 27, 2026
Thank goodness. I can’t leave my laptop for a second unattended because my cat loves nothing more than to dance on the keyboard. I’ve need something like this.
chopete3 • Jun 27, 2026
This is great. Will check it.Recently I bought a usb-c empty external monitor card to prevent mac from going to sleep. There are many of these external monitor simulators on Amazon.I still see the laptop go to sleep many times with the external monitor simulator.This is the one I bought.4K 60Hz USB-C Type-C Virtual Display Adapter DDC EDID Dummy Plug Headless Ghost Display Emulator 2K 60hz1080P@120Hz
processunknown • Jun 27, 2026
Does it also make my Mac irritable?

Frequently Asked Questions

Market intelligence mapped to Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working..

How is Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working. positioned in the market?
Based on our AI analysis of the original developer request, its primary technical positioning is: A context-aware solution to prevent MacBooks from sleeping during AI agent activity, differentiating from generic sleep-preventing apps by activating only when needed and addressing battery drain concerns.
What is the general sentiment around Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working.?
Yes, we have tracked 61 direct responses and active debates regarding this specific topic originating from Hacker News.
What architecture is tied to Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working.?
Our proprietary extraction maps Adrafinil, a macOS application that prevents a MacBook from sleeping with the lid closed only when AI agents (e.g., Claude Code, Codex) are actively working. to adjacent architectural concepts including pmset disablesleep 1, pmset disablesleep back to 0, Claude Code, Codex.

Engagement Signals

100
Upvotes
61
Comments

Cross-Market Term Frequency

Quantifies the cross-market adoption of foundational terms like Claude Code and Codex by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.