Awake while AI agents work
Long agent runs should not stop because your Mac fell asleep. AIwake keeps the Mac awake while Claude Code, Cursor or Codex is actually working — and lets it sleep as usual the moment they are done.
One app, two editions: compare them.
How it works
Claude Code, Cursor and Codex can run small commands — hooks — when a prompt is sent, when a tool or command starts and ends, and when the agent finishes its turn. AIwake adds hooks that report these moments to the app on your Mac.
Turn on an integration
In Settings › Integrations, pick an agent. Before anything is changed, AIwake shows the exact text it will add and the file it will add it to.
The agent reports its steps
Each hook sends the moment to AIwake on 127.0.0.1, from your own Mac. Several sessions and several agents can work at once.
Awake, then asleep
While at least one session is working, the app holds a standard macOS power assertion. When the last one finishes, it lets go and the Mac sleeps as usual.
Every hook runs the same one-line command. It prints nothing, never blocks or changes what the agent does, and exits quietly even when AIwake is not running.
# the command in each hook; only the port, agent and event differ
/usr/bin/curl -s -o /dev/null -m 1 -X POST --data-binary @- -H 'Content-Type: application/json' http://127.0.0.1:<PORT>/macaiwake/v1/<agent>/<event> || true
Made for long agent runs
Awake exactly as long as the work goes on — no longer.
Three agents, many sessions
Works with Claude Code, Cursor and Codex, several sessions at once. The Mac stays awake until the last one is done.
Long commands covered
Long builds and test runs stay covered until the command finishes, up to a ceiling you choose — two hours by default — in case its end is never reported.
Safety timeouts
If an agent quits without saying so, AIwake lets the Mac sleep once no signal has arrived for a while — five minutes by default.
Waiting for you
Choose whether an agent waiting for your permission keeps the Mac awake, or lets it sleep after the timeout.
Display on, if you like
By default only the Mac stays awake, and the display dims and turns off as usual. One switch keeps the display on too.
Manual keep-awake
No agent needed: keep the Mac awake for 30 minutes, for any time you set — say 3 h 20 min — until a date and time, or until you turn it off.
Kind to the battery
On battery, AIwake lets the Mac sleep once the charge drops below a level you choose — 10% by default — or keeps it awake regardless, if you prefer.
Any app, over MCP
Apps and agents that speak the Model Context Protocol can ask AIwake to keep the Mac awake for a build, a download or any long job.
Menu bar, Dock, or both
AIwake lives in the menu bar, as a cup near the clock. By default, if the menu bar is too full to show it, it appears in the Dock instead — or choose menu bar, Dock or both in Settings › General.
15 languages
The app follows your Mac's language, or the one you pick in Settings › General: English, Russian, German, Spanish, French, Portuguese, Turkish, Japanese, Korean, Chinese, Arabic, Hindi, Indonesian, Urdu or Bengali.
Open at login
Starts with your Mac, if you want it to. Everything else stays out of the way until an agent gets to work.
Buy me a coffee — I'm not a machine
AIwake is free, with no ads and no tracking. If it saved one of your long runs, you can leave a tip in the app. It unlocks nothing: every feature is free.
You stay in control
Integrations are off until you turn them on.
- You see the change first. Before anything is written, AIwake shows the exact text it will add and the file it will add it to.
- macOS asks you. In the Mac App Store edition, you allow access to that agent's settings folder by selecting it in a standard macOS panel.
- One file, with a backup. The app changes only that one file and keeps a backup of it next to the original.
- Gone in one click. Turn an integration off, or choose “Remove All Integrations…”, and AIwake removes its entries. Your other settings are not touched.
| Agent | The one file AIwake changes |
|---|---|
| Claude Code | ~/.claude/settings.json |
| Cursor | ~/.cursor/hooks.json |
| Codex | ~/.codex/hooks.json, or ~/.codex/config.toml if your own hooks are already defined there |
Codex runs a new hook only after you approve it: run /hooks in Codex, approve the AIwake entries, then start a new session.
Any app can ask, over MCP
AIwake is also a local MCP server. Any app or agent that speaks the Model Context Protocol can keep the Mac awake for a build, a download or any long job — and let it sleep when the job is done.
Three tools, nothing else
keep_mac_awake- Keeps the Mac awake for 1 to 1440 minutes, with an optional reason that AIwake shows in its menu. Asking again replaces the earlier request, and the hold ends by itself when the time runs out.
allow_sleep- Ends that app's request. Agents, other apps or you may still keep the Mac awake.
get_status- Tells whether the Mac is being kept awake and why: agent sessions, apps, the manual timer, or low battery letting it sleep.
Only apps on this Mac can connect, and requests from web pages are refused. The server is on by default; one switch in Settings › Integrations turns it off.
Add it to your agent
The server speaks Streamable HTTP at the address shown in Settings › Integrations — usually http://127.0.0.1:49137/mcp. The same place has these lines, ready to copy:
Claude Code
claude mcp add --scope user --transport http aiwake http://127.0.0.1:49137/mcp
Cursor · ~/.cursor/mcp.json
{ "mcpServers": { "aiwake": { "url": "http://127.0.0.1:49137/mcp" } } }
Codex · ~/.codex/config.toml
[mcp_servers.aiwake] url = "http://127.0.0.1:49137/mcp"
Private by design
Your prompts and commands are none of our business.
Only 127.0.0.1
Hook signals and MCP requests arrive only on 127.0.0.1, from your own Mac; web pages are refused. The Mac App Store edition makes no outgoing connections at all.
Nothing stored
Hooks may carry your prompts and commands. AIwake reads them in memory only for the session ID and tool call ID, throws the rest away, and never stores or logs them.
No data collected
No account, no analytics, no advertising and no server. The details are in the privacy policy.
Try it without an agent
Settings › Verification sends a test signal, so you can watch a session start and the power assertion appear — then stop it again.
- Click Send Test Signal: the tab shows the test session as active and the power assertion as held, the session appears in AIwake's menu, and the cup starts to steam.
- In Terminal,
pmset -g assertionslists AIwake's assertion, named “An AI coding agent is working”. - Click Send Stop Signal: the assertion is released and your Mac may sleep again.
Or from Terminal
The Verification tab also shows two curl commands. Pasted into Terminal, they send the same requests an agent's hooks send — the first starts a test session, the second ends it.
Two editions, one app
Built from the same source code, with the same local port and the same hooks.
Mac App Store edition
Sandboxed and reviewed by Apple, updated through the App Store. This is the one most people want.
Direct edition
A notarized disk image from this site, with built-in updates. It is not sandboxed, which makes room for features a sandboxed app cannot have — like keeping the Mac working with the lid closed.
Direct downloadLet the agent finish the job
Requires macOS 14 or later. Works with Claude Code, Cursor, Codex and any app that speaks MCP — and manual keep-awake needs no agent at all.