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, 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. But busy isn't the test: macOS goes by your idle time — how long since real keyboard or mouse input — plus the power assertions running processes hold. CPU isn't part of it, so the Mac suspends on its normal schedule and freezes 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 kept awake.

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 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.

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 kept awake, 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: