Stop Your Mac Sleeping While Cursor's AI Agent Runs

Mac went to sleep in the middle of a Cursor agent task, and now you're here. Short answer below, then the free option, then the tool built for exactly this.

To keep your Mac awake while Cursor's agent runs: the free way is macOS's built-in caffeinate -i — run it in Terminal before you start, and stop it yourself when the run ends. The automatic way is AgentBarista, which detects Cursor's agent working and lets your Mac sleep when it finishes.

The fix

Why this happens, and the fastest way to stop it

macOS sleeps your Mac based on how long since you touched the keyboard or trackpad, plus the power assertions running processes hold — not on whether Cursor's agent is mid-task, and not on CPU load either. A Mac pinned at 100% sleeps on the same schedule as one doing nothing, so a long model wait at near-0% CPU isn't even the reason it happens. The immediate fix: open System Settings → Lock Screen (or Battery on older macOS) and turn off "Turn display off" / set it to Never while you're running long agent tasks, or run caffeinate from Terminal before you kick off the task. That stops the sleep — it just doesn't know when Cursor is actually done, so you have to remember to turn it back off.

Honest answer

Free tools can do this too

caffeinate (built into every Mac) and Amphetamine (free, Mac App Store) will both keep your Mac awake on a timer or while a process you pick is running. If you only run Cursor's agent occasionally, that's a perfectly fine choice — no need to install anything else. Where they fall short is the same place every plain keep-awake tool falls short: they don't know when Cursor's agent specifically starts and stops, so you either babysit them or they keep your Mac awake — and your battery draining — long after the agent finished.

Built for this

What AgentBarista does differently for Cursor

AgentBarista watches Cursor specifically — CPU usage and the on-screen text in its agent panel — and keeps your Mac awake only while there's a real, active task running.

Catches the "thinking" gaps

Cursor's agent can sit at near-0% CPU while waiting on a model. AgentBarista reads window text too, so it knows the agent is still working even when CPU alone looks idle.

Lets go when Cursor's done

Once the agent finishes or goes idle, normal sleep comes back within your grace window — 90 seconds by default. No babysitting a timer, no battery held hostage overnight.

Works alongside everything else

Already run Claude Code, Codex, or another agent in another window? AgentBarista watches all of them — not just Cursor — from one menu-bar app.

Private by design

It runs on your Mac. That's it.

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 Gemini CLI, Copilot CLI, or another agent?

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