Aider was still working.
Your Mac didn't care.

If macOS went to sleep mid-task, Aider — the terminal pair-programming agent — froze right where it was. It didn't fail; it got paused along with your Mac. Here's why that happens, and how to stop it.

To keep your Mac awake while Aider runs: the free way is macOS's built-in caffeinate — start your session as caffeinate -i aider and the Mac can't idle-sleep until the agent exits. The automatic way is AgentBarista, which watches for real agent activity and lets your Mac sleep once the work is done.

The direct answer

Why your Mac sleeps while Aider is still going

Aider spends most of a task waiting on a model response — which barely uses any CPU. But macOS doesn't decide from CPU at all — it goes by your idle time, how long since real keyboard or mouse input, plus the power assertions running processes hold. So working hard doesn't protect the machine: a Mac mid-refactor sleeps on exactly the same schedule as one doing nothing. After your screen-sleep or system-sleep timer runs out, macOS suspends the Mac, and the aider process is frozen along with everything else until you wake it back up.

This bites hardest on exactly the runs worth walking away from: a big multi-file edit across a repo map, an architect-plus-editor pass where two model calls happen back to back, or a long --yes-always session you kicked off and left alone. The fix is to stop macOS from sleeping for as long as the agent is actually running — then let it sleep normally again once the run is done. You can do that for free in two minutes, or with a tool that watches for real agent activity so you don't have to babysit it.

The free option

Free tools can keep your Mac awake too

If you only run Aider occasionally, you don't need to buy anything. Because Aider is a terminal agent, the cleanest free fix is one command:

  • The built-in caffeinate command. Launch your session as caffeinate -i aider instead of aider. The Mac can't idle-sleep while the agent runs, and the moment Aider exits, normal sleep is allowed again — nothing to remember to undo. Already on your Mac, free. For a scripted or unattended run, wrap the whole command the same way: caffeinate -i aider --message "your instruction" --yes-always.
  • Tie it to a session that's already running. If you started Aider before you thought about sleep, you don't have to restart it — caffeinate -i -w $(pgrep -nf aider) attaches to the newest process whose command line mentions Aider and releases the moment that process exits. Use -f here rather than a plain pgrep -n aider: Aider runs as a Python program, so its own name often isn't what macOS lists as the process. Check what you'd be attaching to first with pgrep -lf aider.
  • Amphetamine (free, Mac App Store). A menu-bar toggle to keep the Mac awake on a timer or while your terminal app is open — handy if you'd rather flip a switch than type a command.

All of these are a fine choice if Aider runs for a few minutes here and there. The catch: none of them knows when the agent actually finished a task versus when it's just sitting at an idle prompt. You either stop it yourself, or it keeps your Mac awake — and your battery draining — long after the work is done.

The purpose-built option — honest status

What AgentBarista does today for Aider

Straight answer: Aider is in AgentBarista's built-in agent list, so you don't have to add it yourself — the aider process match is wired in, and because Aider runs as a Python program, the list also matches the case where macOS reports the process as python3 and Aider's path sits in the command line. Recognising Aider isn't the whole job, though. To hold your Mac awake we need a signal that work is actually happening, and for Aider today that means either real CPU load or the on-screen text of your terminal — and reading that text needs the macOS Accessibility permission. We have not added a session-file signal for Aider, which is the thing that catches a long, silent model wait at near-zero CPU. Three more things we'd rather say out loud than let you discover: we haven't confirmed that every install route (pipx, uv, a virtualenv shim) lands on a process shape the list recognises, we haven't confirmed on hardware which text Aider shows while a turn is actually running, and we haven't done the full end-to-end pass on a Mac with Aider on it.

Recognised out of the box

Aider ships in AgentBarista's agent catalog — no custom setup needed to recognise it, including the Python-hosted case. That part needs no permission.

The gap we'd rather name

Long model-wait turns burn almost no CPU. With no session-file signal for Aider yet, catching those depends on the on-screen text, which needs Accessibility. Treat Aider as covered-but-unconfirmed rather than tested.

Has a safety net regardless

A battery cutoff and an emergency restore mean it never gets permanently stuck keeping your Mac awake — true for every app AgentBarista watches, verified or not.

Aider (in the built-in list, verification pending) Claude Code Cursor Codex Gemini CLI Copilot CLI OpenCode Zed Antigravity Claude ChatGPT + more

It runs on your Mac. AgentBarista never opens your files. To tell a working agent from a finished one it looks at process command lines and CPU, at the names and modification times of your agents' session files, and — only if you grant macOS Accessibility permission — at the on-screen text of the agent apps you enable and of the terminals we support. Two of those can contain your own words: a command line includes any prompt you pass on it, and on-screen text includes whatever is visible in that window, your code included. Both are matched against status phrases on your Mac and discarded on the spot: never stored, never sent. Nothing about your work leaves your Mac — no file contents, no code, no prompts, no file names, no activity data. Your stats and settings stay on this Mac. The app contains no analytics or telemetry of any kind. Its network calls are two: license validation, sent to our payment provider, Lemon Squeezy — activating a license sends your license key and your Mac’s name, and the routine check after that sends your license key and an anonymous instance id, nothing else — and an update check that fetches the new-version list from agentbarista.com, sends no personal data, and can be turned off in Settings.

Getting it

$19/year, locked in for as long as you stay subscribed. Cancel any time.

AgentBarista Personal License — one Mac, $19/year
  • Runs as a menu-bar app — pick a mode, get back to work
  • Battery cutoff on by default (20%), plus a one-click emergency restore
  • Signed and notarized by Apple
Subscribe — $19/yr

$19/year if you subscribe before September 15 — locked in for as long as you stay subscribed. New subscribers after that pay $29/year. 30-day money-back guarantee — one email, full refund.

Download free 14-day trial

The download is the trial — the full app, free for 14 days, no card needed. Need more Macs? 5-Mac Pack — $129/year, flat.

More agents

Also running Claude Code, Codex CLI, or another agent?

Same Mac-goes-to-sleep problem, different tool. Each of these guides covers the fix for that agent specifically: