Zed's agent was still working.
Your Mac didn't care.

You kicked off a long run in Zed's Agent Panel, stepped away, and came back to a sleeping Mac and a paused agent. The run didn't fail — it got suspended mid-task along with everything else. Here's why that happens, and how to stop it.

To keep your Mac awake while Zed'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 Zed's agent working and lets your Mac sleep when it finishes.

The direct answer

Why your Mac sleeps while Zed's agent is still going

An agent run in Zed — whether it's Zed's own agent or Claude Code, Gemini CLI, or Codex running inside the Agent Panel as a separate process — spends most of its time waiting on model responses. Waiting barely uses any CPU, and Zed itself is a lean native app, so nothing on the machine looks busy. macOS decides sleep from CPU and user input, sees an "idle" computer, and suspends it — freezing the agent right where it was.

When you wake the Mac, the run picks up from wherever it got paused: the task list stalled, the diffs half-reviewed, the multi-file edit stopped mid-thought. The fix is to stop macOS from sleeping for as long as the agent is actually working — then let it sleep normally again shortly after the run goes quiet — within your grace window, 90 seconds by default. You can do that for free in two minutes, or with a tool that knows the difference between "agent working" and "agent idle" so you don't have to babysit it.

The free option

Free tools can keep your Mac awake too

If you only run long agent tasks in Zed occasionally, you don't need to buy anything. Two solid free options:

  • The built-in caffeinate command. Open a terminal and run caffeinate -i before you start a long run in the Agent Panel. It'll hold sleep off until you close the terminal or press Ctrl+C. Simple, free, already on your Mac.
  • Amphetamine (free, Mac App Store). Gives you a menu-bar toggle and basic process triggers, so you can set it to stay awake while Zed is running.

Both are a fine choice if your agent runs for a few minutes here and there. The catch: neither one knows when the agent actually finished. "While Zed is running" is most of your workday — you either turn it off yourself, or it keeps your Mac awake and your battery draining long after the run is done.

The purpose-built option

What AgentBarista does differently for Zed

Zed ships in AgentBarista's built-in watch list. The detection isn't tied to any one app, though: AgentBarista watches real activity signals — the CPU of a watched process and its children, and on-screen text via Accessibility — and you can add any app, including Zed, as a watched target in Settings.

Watches for real work

An agent waiting on a model response looks idle to macOS. AgentBarista looks at actual activity signals — process CPU including child processes, and on-screen status text — not just a timer you set and forget.

Lets go when it's done

When the work stops, AgentBarista releases sleep prevention within your grace window — 90 seconds by default — no terminal window left open, no battery held hostage overnight — and shows you how much run time it saved.

Has a safety net

A battery cutoff and an emergency restore mean it never gets permanently stuck keeping your Mac awake — the risk every manual keep-awake trick carries.

Zed Claude Code Cursor Codex Gemini CLI Copilot CLI OpenCode VS Code Windsurf 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 one network call is 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.

Pricing

Try it free, then keep it. No subscription.

Pro, one-time
$19 once
  • 14-day free trial, no card needed
  • $15 founding price for the first 200 customers
  • Includes 1 year of updates
  • Lifetime option: $39 once, updates forever
Get notified at launch

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

Running agents across a team instead? See team pricing.

FAQ

Real questions, straight answers

Does AgentBarista support Zed?

Zed is in the built-in watch list. There's no Zed-specific magic behind it: AgentBarista watches real activity signals — the CPU of a watched process and its children, and on-screen text via Accessibility — and you can add any app, including Zed, as a watched target in Settings. If Zed's Agent Panel changes tomorrow, the same signals still apply.

I run Claude Code or Gemini CLI inside Zed — does that count?

Zed runs external agents as separate processes it launches. AgentBarista's process signal counts a watched app's child processes too, and Claude Code and Gemini CLI are in the built-in list in their own right — so a run started from Zed's Agent Panel is watched either way.

Why not just caffeinate or Amphetamine?

If you run agents occasionally, use them — they're free and they work, and we explain how above. Where AgentBarista earns its price: it won't drain your battery overnight, it shows you what it actually saved, and it's first to support brand-new agents as they ship.

Will it run my MacBook's battery flat overnight?

No — that's the failure mode it's built to avoid. Sleep prevention releases as soon as the agent looks done, and a battery cutoff forces the Mac to sleep before the battery empties, no matter what mode you're in. There's an emergency restore if anything ever gets stuck.

More agents

Also running OpenCode, Antigravity, or another agent?

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