🧑💻 AI agent
Keep your Mac awake while Codex runs
Codex is partway through editing your repo and running commands when the screen dims and the Mac drops to sleep. AwakeMate keeps it awake for the whole session instead.
Free 14-day trial · one-time $39.99 · no telemetry · macOS 13+
When your Mac sleeps mid-Codex
Codex runs as an autonomous coding agent: it plans, patches files, runs commands, and waits on the model between each step. Those waits read as idle to macOS, so the Mac sleeps right in the middle of a task. The agent loop stalls, the terminal session can drop, and a long refactor or fix you queued up never finishes. Just reading its output without typing is enough to start the idle countdown.
AwakeMate keeps it awake while Codex runs
AwakeMate detects the codex process and holds your Mac awake while it runs. Because Codex is typically installed via npm, macOS may report it as node; Deep CLI detection (on by default) reads the actual script name so it is matched as codex rather than a generic node process.
Detected process: codex
Tip: leave "Sleep when tools go idle" off
Keep "sleep when tools go idle" OFF for Codex. It spends a lot of each run waiting on the model rather than burning CPU, so idle sleep would mistake those pauses for you being done and end the session early.
Get the most out of it
- Leave Deep CLI detection enabled so an npm-installed Codex is recognised as codex instead of node.
- Start a long task, confirm AwakeMate shows the Mac as kept awake, then step away with confidence the run will continue.
More questions about Codextap to expand
Does AwakeMate keep the Mac awake during Codex's between-step pauses?
Yes. With idle sleep off, the Mac stays awake for as long as the codex process is alive, including the pauses while it waits on the model between actions.
Codex appears as "node". How does AwakeMate recognise it?
Deep CLI detection reads the real script name behind the node launcher, so the npm-installed Codex is matched as codex. It is on by default.
Is this just caffeinate with a UI?
It uses the same gentle IOKit power assertion as caffeinate and prevents idle sleep only, but it does it automatically per tool, with no telemetry and no changes to your saved energy settings.
How do I keep my Mac awake while Codex finishes an agentic run?
Let AwakeMate handle it. Add codex to your watched tools and the Mac stays awake automatically for the full run, then sleeps once the agent exits - you never have to start or stop anything by hand. Codex usually appears as node because it is installed via npm, so Deep CLI detection matches it on its real name. It is the most reliable way to keep a long Codex task alive without watching the terminal.
Is AwakeMate better than caffeinate or setting Battery to Never for Codex?
It is more precise. You can run caffeinate codex ... or flip Battery and Energy Saver to Never, but those are manual switches you must flip on and off, and they keep the whole Mac awake for every app rather than just while Codex runs. They have no concept of the tool starting or stopping, no idle-aware sleep, and no notch status. AwakeMate automates exactly that per tool, using the same gentle idle-sleep assertion under the hood and never changing your saved energy settings.
Can I leave a long Codex task running overnight on battery?
Yes, and AwakeMate gives you control over it. You can choose whether to keep going on battery or only on power, and set a low-battery cutoff so the Mac is allowed to sleep before the battery runs flat. AwakeMate prevents idle sleep while the lid is open and Codex is running, so the agent keeps working overnight - just remember that with the lid closed macOS still sleeps unless the Mac is on power with an external display.
Will it keep my Mac awake for Codex with the lid closed, even on battery?
Yes. Turn on "Keep awake with the lid closed" in Settings - Options and approve the one-time helper; AwakeMate then keeps the Mac awake with the lid shut while Codex runs, and dims the built-in screen so it is not draining the battery under the lid. It works on most Apple Silicon Macs (Apple forces sleep on some, so close your lid once to confirm). It works on battery too, but real work drains it faster, so keep it on power for long runs. See how it works.