档案库 · 开发与企业工具 · 产品决策 · 2026
Adrafinil:仅在 AI 代理工作时保持 Mac 唤醒——Show HN,466 星
macOS 菜单栏工具,仅在 AI 编码代理有活动会话时阻止合盖睡眠——Show HN 124 分,GitHub 466 星。
Adrafinil (kageroumado)
做的是什么生意
A free, MIT-licensed macOS menu-bar app whose privileged helper blocks system sleep only while an AI coding agent holds an active session, then returns the Mac to normal sleep behavior.
起因
Built by the maker behind @kageroumado / kagerou.glass after the 3 a.m. case the README opens with: an agent is still mid-task in a session started hours earlier while the closed laptop lid has put the Mac to sleep. caffeinate and Amphetamine are 'stimulants' that keep the machine wired forever whether or not anyone is home, so Adrafinil was built as 'a eugeroic for machines' — named after the wakefulness-promoting prodrug — that does nothing until an agent acquires it and clears the moment the last session releases.
经过
Adrafinil ships one-click hook installers for nine agents (Claude Code, Codex, Cursor, Gemini CLI, Aider, Hermes, OpenCode, Cline, Pi), a sub-50ms acquire/release CLI, a bundled MCP tool and time-boxed holds for long builds or deploys. A reference-counted daemon stacks overlapping sessions and force-releases on thermal cutout, idle timeouts or process death; a one-click installer registers a root helper via SMAppService, and distribution is a signed, notarized DMG plus the official Homebrew cask. It targets macOS 26.4+ ('Tahoe'), with a community backport fork covering macOS 15 Sequoia.
结果
Still live as a single-developer open-source project as of 2026-09-05: 466 stars, 16 forks and 157 commits on GitHub, MIT-licensed; no company, funding round, price or revenue is disclosed in the material.
背景
Adrafinil 是一个 macOS 菜单栏应用,仅在 AI 编码代理有活动会话时阻止系统睡眠——包括合盖(clamshell)睡眠——而在没有代理工作时不影响正常的睡眠行为。它的赌注是夜间代理运行是一个真实的工作流,因此“保持唤醒”这一类别应该以活动为范围,而不是始终开启:与 caffeinate 或 Amphetamine 正好相反。
它通过三种方式工作:自动代理钩子在提交提示时获取、在停止时释放;通过内置 MCP 工具或“adrafinil hold”命令行实现的代理驱动限时保持,用于长时间构建和部署;以及手动菜单栏“保持唤醒”按钮。一个引用计数的守护进程叠加重叠会话,安全网——热切断、空闲释放、死进程清扫——确保放在包里的 Mac 在合盖时不会过热。
架构将四个产品分成三个特权层:菜单栏应用是纯粹的视图,非特权守护进程持有所有策略,而一个微型 root 助手是唯一接触睡眠阻塞 API 的组件,只暴露一个 setSleepBlocked(Bool)。2026 年 6 月 27 日的 Show HN 帖子获得 124 分和 78 条评论;到 2026 年 9 月 5 日抓取时,MIT 许可的仓库有 466 颗星、16 个分叉和 157 次提交,提供签名公证的 DMG 和官方 Homebrew cask。
这件事要成立,得有什么
- 它颠覆了现有类别:caffeinate 和 Amphetamine 让机器永远保持唤醒,而 Adrafinil 在代理获取它之前不做任何事,使正常睡眠成为安全的默认。
- 它挂接到代理的钩子生命周期——获取和释放与会话 ID 绑定——所以正确的行为自动发生,而不是依赖用户记得切换开关。
- 它最重要的信任工程在 root 睡眠控制上,将其隔离在一个只暴露 setSleepBlocked 的可审计助手中,策略在非特权守护进程中。
- 热切断、空闲释放和限时保持使夜间合盖代理运行从火灾隐患变为一个受支持的、合理的用例。
可借鉴之处
不要与通用工具比拼功能:找到生命周期信号(这里是代理会话),使一类行为正确,并让安全状态成为默认状态。
后续进展
截至 2026 年 9 月 5 日,Adrafinil 是一个活跃的 MIT 许可开源项目:GitHub 上有 466 颗星、16 个分叉和 157 次提交,可从签名公证的 DMG 或官方 Homebrew cask 安装,提供九个代理的钩子、MCP 支持和命令行工具。开发针对 macOS 26.4+;一个单独的移植分支支持 macOS 15 Sequoia。材料中没有披露公司、资金、定价或收入。
资料来源
发现哪里写错了?告诉我们。
轮到你了
你刚读完一家。说说你在做什么,看看谁在赌同一件事。
免费账号 · 3 次免费提问 · 不用绑卡