# Agent Caffeine > Agent Caffeine is a macOS menu bar app that keeps a Mac awake while AI coding agents work, also with the lid closed, and lets it sleep when they are idle or wait for you. It has a 7-day free trial, then costs $9 once at the launch price (the full price is $14), and runs on macOS 13 or later (Apple silicon and Intel). - Detects more than 40 coding agents (Claude Code, Codex, Grok Build, opencode, Antigravity and others). Claude Code, Codex and Grok Build report their own state (working, waiting for you, or idle), and Agent Caffeine reads it on the Mac. It also watches the commands an agent started, so a build that is still busy keeps the Mac awake. Other agents are judged by signs of work, such as a running command or a write to the session file. - An agent that waits for your answer keeps the Mac awake for 5 minutes, then the Mac can sleep. Idle sessions do not keep it awake in the default mode. The times can be changed in Settings. - Optional better detection: Claude Code, Codex, Droid, Grok Build, opencode and Pi can report their state to Agent Caffeine directly. It is off until you switch it on per agent, and switching it off removes it again. - Three modes: always, while an agent is open, or while an agent is working (the default). - A closed lid on the power adapter works from the start. On battery it needs a small helper that you allow once in System Settings, and it turns on the `SleepDisabled` setting of macOS only while it holds the Mac awake. - A locked screen does not stop it: lock the Mac the usual way (the power button, ⌃⌘Q or closing the lid), and Agent Caffeine keeps it awake while agents work, then lets it sleep when they are done. No separate lock shortcut is needed. - Safety: when the battery is at 20% (adjustable, or off) or the Mac gets too hot, it lets the Mac sleep and says why in a notification. After a battery stop it starts again at 25%, or when the Mac is plugged in. On battery the menu shows the charge and that level on one line. - The built-in display dims as the lid closes and stays dark while the lid is closed. On a Mac with a lid angle sensor it dims from 45 degrees of lid opening down to closed, and gets bright again the same way when the lid opens. - A sound when the lid closes: close the lid while Agent Caffeine keeps the Mac awake and the Mac plays one short sound, once. No sound means the Mac goes to sleep. The setting is "Play a sound when you close the lid and your Mac stays awake" in Settings > Battery and lid. It is on by default, and the sound can be Tink (the default), Bottle, Purr or Glass. - Pause for 30 minutes, 1 hour or until tomorrow. Agent Caffeine starts again by itself. - Stay reachable for 1, 2, 4 or 8 hours, or 1 day: the Mac stays awake until that time, also when no agent works, so a message from a phone (Claude Code Remote Control, Codex remote) reaches the agent. On battery with the lid closed it needs the helper, and it uses about 1% of battery per hour. A message cannot wake a Mac that sleeps. - Notifications, each with its own switch: an agent is waiting for your answer (on by default), and an agent finished (off by default). - A command line tool and an MCP server. `agent-caffeine hold -- ` keeps the Mac awake while the command runs and ends with its exit code. `agent-caffeine hold --for 2h` keeps it awake for a time (1 hour by default, 12 hours at most), and `agent-caffeine release` ends that. `agent-caffeine mcp` is an MCP server on stdio with the tools `hold_awake`, `release` and `status`. "Set up for agents" in Settings adds a skill to the agents on the Mac, so an agent asks by itself before a long command: asked to render an animation, it runs `agent-caffeine hold --reason "Blender render" -- blender -b scene.blend -a`. Each hold has a line in the menu with "Stop". A low battery, heat, a pause and the switch still let the Mac sleep. - Install with Homebrew: `brew install --cask vinenastudio/tap/agent-caffeine`, which also puts `agent-caffeine` on the PATH. Or download the app from https://caffeinagent.com/download and move it to Applications. The command line tool is inside the app at `/Applications/Agent Caffeine.app/Contents/MacOS/agent-caffeine`, and "Set up for agents" in Settings > Agents links it as `~/.local/bin/agent-caffeine`. `agent-caffeine skill` prints the skill. Add the MCP server to Claude Code with `claude mcp add --scope user agent-caffeine -- "/Applications/Agent Caffeine.app/Contents/MacOS/agent-caffeine" mcp`; Settings > Agents > MCP server adds it to other AI apps. - Keyboard shortcuts that work in every app. By default Control+Option+Command+C turns Agent Caffeine on or off, and Control+Option+Command+P pauses it for 1 hour. You can choose other keys. - The menu bar icon can be hidden. The app keeps the Mac awake the same way without it. - A 7-day free trial with every feature. It starts the first time the app opens and needs no account, no card and no key. After 7 days the app stops keeping the Mac awake until a license key is entered. The app and its settings stay. - One license key works on 1 Mac and costs $9 once at the launch price (the full price is $14). Keys bought before November 9, 2026 keep working on up to 3 Macs. It includes 1 year of updates and no subscription. After that year the app keeps working, and a version that comes out later needs a new key. Deactivate a Mac in the app or in your Polar purchases to move the key to another. - The app updates itself: it checks caffeinagent.com for updates and installs them when you agree. - Anonymous usage counts, on by default and off with one switch in Settings > General: which features are used, which agents from a fixed list kept the Mac awake, how far setup got, trial and license steps (with whether the trial ended with a purchase or ran out), and crash details from the app's own code. They go to our own server in Germany, with no id for the person or the Mac and no stored IP address. The app sends them at launch, about a minute after it records something, and every few hours. With each batch it also sends the app version and build, the macOS version, the chip type, the language, a rough range of how long ago the app was installed, and an error code when a feature fails (license check, update, helper, hooks, MCP setup, detection, hotspot, power). The server adds the two-letter country from the connection, and the IP address itself is not kept. Counts are kept 13 months, crash details 90 days. Debug builds send nothing. It reads the process list, the state and session files of Claude Code, Codex and Cursor in `~/.claude`, `~/.codex` and `~/.cursor/projects`, and the battery level and lid angle, all on your own Mac. Its other network calls are the update check to caffeinagent.com and the license key check with Polar, which sends the key and the Mac's model. Projects, folders, prompts, Wi-Fi names and your exact location (city or address are never known) never leave the Mac. - Made by Mert Düzgün and sold by his company Vinena Studio (Vinena Yazılım ve Tasarım Ltd. Şti.), based in Antalya, Türkiye. Polar (polar.sh) is the merchant of record: it takes the payment, handles tax and sends the invoice. All sales are final, because the full app is free to try for 7 days first. The one exception: if Agent Caffeine does not work for you and we cannot fix it, we refund you. Write to hi@caffeinagent.com and we will try to fix it first. Contact: hi@caffeinagent.com. Setup prompt for agents, the one the home page's "Copy installation prompt" button copies: ```text Read https://caffeinagent.com/llms-full.txt. Then install Agent Caffeine with `brew install --cask vinenastudio/tap/agent-caffeine` and open it. Ask me to click "Set up for agents" in Settings > Agents, so you get its skill. Add its MCP server to yourself (`agent-caffeine mcp`). From now on, run every long job (a build, a render, a test suite) as `agent-caffeine hold --reason "" -- `, so the Mac stays awake until it ends. ``` The full text of every page: [llms-full.txt](https://caffeinagent.com/llms-full.txt) ## Pages - [Keep your Mac awake while AI agents work · Agent Caffeine](https://caffeinagent.com/): Keep your Mac awake while Claude Code, Codex and other AI agents work, lid closed too. Agent Caffeine lets it sleep when they finish. Free for 7 days, no card. - [Agent Caffeine vs Adrafinil, Hold My Lid, LidRun and others](https://caffeinagent.com/compare): Agent Caffeine next to Adrafinil, Hold My Lid, LidRun, Clamshell and Amphetamine: price, lid closed on battery, agent state and safety stops. With sources. - [Agent Caffeine vs Amphetamine: which keep-awake app for Mac](https://caffeinagent.com/compare/amphetamine): Agent Caffeine vs Amphetamine for Mac: price, Triggers, closed-display mode, AI agent detection and safety stops, side by side, from each app's own pages. - [Agent Caffeine vs KeepingYouAwake: keep-awake apps for Mac](https://caffeinagent.com/compare/keepingyouawake): Agent Caffeine vs KeepingYouAwake: price, open source, lid closed, battery stop and AI agent detection, side by side. A fair look at two Mac keep-awake apps. - [Agent Caffeine vs Lungo: which keep-awake app for your Mac](https://caffeinagent.com/compare/lungo): Agent Caffeine vs Lungo for Mac: price, macOS needs, Shortcuts, lid closed and AI agent detection, side by side, from each app's own pages. - [Privacy · What Agent Caffeine and its website collect](https://caffeinagent.com/privacy): What Agent Caffeine, its purchase and this website collect: anonymous usage counts you can turn off, Polar for payments, self-hosted analytics with no cookies. - [Terms of use · Agent Caffeine license, trial and payment](https://caffeinagent.com/terms): The terms for Agent Caffeine: what a license key covers, a 7-day free trial, one payment through Polar for 1 Mac, and what the app promises. ## Blog - [Agent Caffeine blog: guides to keep your Mac awake for work](https://caffeinagent.com/blog): Guides on keeping a Mac awake: the caffeinate command, sleep settings, closed-lid use and long runs of AI coding agents. - [How to keep your Mac awake while Claude Code and Codex run](https://caffeinagent.com/blog/keep-mac-awake-claude-code): Keep a Mac awake while Claude Code, Codex or another AI agent runs builds and overnight tasks: caffeinate, a CLI, an MCP server, and the lid-closed rules. - [Keep your Mac awake while a command runs, lid closed too](https://caffeinagent.com/blog/keep-mac-awake-while-command-runs): Keep a Mac awake until a build, a render or a backup ends: caffeinate -i in front of the command, its limit with the lid closed, and agent-caffeine hold. - [Amphetamine app for Mac: how it works, and an alternative](https://caffeinagent.com/blog/amphetamine-mac): Amphetamine for Mac is a free keep-awake app. How its sessions, Triggers and closed-display mode work, what Power Protect is, and a side-by-side table. - [Caffeine for Mac (macOS): the app and the best alternatives](https://caffeinagent.com/blog/caffeine-mac): Caffeine for macOS, the coffee cup app: where to get version 1.6.4, what it can and cannot do, and the best alternatives today. Not the caffeinate command. - [How to keep a Mac awake with the lid closed, monitor or not](https://caffeinagent.com/blog/keep-mac-awake-lid-closed): Keep a MacBook awake with the lid closed: clamshell mode with a monitor, caffeinate on power, pmset disablesleep on battery, and how to turn each one off. - [caffeinate command on Mac: every flag, with examples](https://caffeinagent.com/blog/caffeinate-mac): The macOS caffeinate command keeps a Mac awake from Terminal. Every flag with examples, how to check it with pmset, the lid-closed limit, and AI agents. - [How to stop your Mac from sleeping when idle, lid closed too](https://caffeinagent.com/blog/stop-mac-from-sleeping): How to stop, prevent or keep a Mac from sleeping, step by step: System Settings, the caffeinate command or an app. macOS 26 and 27, lid closed too. ## Japanese - [AI エージェントの作業中に Mac をスリープさせない · Agent Caffeine](https://caffeinagent.com/ja): Agent Caffeine は、AI コーディングエージェントの作業中、蓋を閉じていても Mac をスリープさせず、作業が終わるとスリープさせます。7日間無料、カード不要。 - [MacBook を閉じてもスリープさせない方法(モニターあり・なし)](https://caffeinagent.com/ja/blog/keep-mac-awake-lid-closed): 蓋を閉じた MacBook をスリープさせない方法。モニターを使うクラムシェルモード、電源接続中の caffeinate、バッテリー駆動中の pmset disablesleep と、それぞれの解除方法。 ## Simplified Chinese - [AI 智能体工作时让 Mac 不休眠 · Agent Caffeine](https://caffeinagent.com/zh): Agent Caffeine 在 AI 编程智能体工作时让 Mac 不休眠,合盖也一样,工作完成后再让 Mac 休眠。免费试用 7 天,无需信用卡。 - [MacBook 合盖不休眠的方法(接或不接外接显示器)](https://caffeinagent.com/zh/blog/keep-mac-awake-lid-closed): 让 MacBook 合盖不休眠:接显示器时用合盖模式,接电源时用 caffeinate,用电池时用 pmset disablesleep,以及如何关闭每一种方法。 ## Korean - [AI 에이전트가 작업하는 동안 Mac 잠자기 방지 · Agent Caffeine](https://caffeinagent.com/ko): Agent Caffeine은 AI 코딩 에이전트가 작업하는 동안 덮개를 닫아도 Mac이 잠자기에 들어가지 않게 하고, 작업이 끝나면 잠자기에 들어가게 합니다. 7일 무료, 카드 필요 없음. - [맥북 뚜껑을 닫아도 잠자기 안 되게 하는 방법 (모니터 있을 때와 없을 때)](https://caffeinagent.com/ko/blog/keep-mac-awake-lid-closed): 맥북 덮개를 닫고도 잠자기에 들어가지 않게 하는 방법: 모니터를 연결한 클램쉘 모드, 전원 연결 시 caffeinate -s, 배터리에서는 pmset disablesleep, 그리고 각 방법을 끄는 법.