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 (14-day free trial, then $19 one-time), 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 keyboard/mouse activity and CPU load — not on whether Cursor's agent is mid-task. When the agent is waiting on a model response, your Mac can sit near 0% CPU for long stretches, which looks idle to macOS even though real work is still running. 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.

Pricing

14-day free trial, then keep it for good

Pro is $19 once — not a subscription. Updates included for a year. Founding price is $15 for the first 200 customers. Prefer to pay once and never think about it again? Lifetime is $39 once, all future updates included.

Get notified at launch

Not live yet — leave your email and we'll ping you the moment it is.

  • 14-day free trial, no card needed
  • Watches Cursor, Claude Code, Codex, and more
  • One-time price, not a subscription

Running a team of devs on Cursor instead of just you? See team pricing.

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: