Copilot CLI was still working.
Your Mac didn't care.

You ran copilot in your terminal, handed it a task, stepped away — and macOS went to sleep mid-run. The agent didn't fail, it just got paused along with your Mac. Here's why that happens, and how to stop it.

To keep your Mac awake while Copilot CLI 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 Copilot CLI working and lets your Mac sleep when the run finishes.

The direct answer

Why your Mac sleeps while Copilot CLI is still going

GitHub Copilot CLI runs as a process in your terminal, and it spends most of a task waiting on model responses — 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 a busy Mac sleeps on exactly the same schedule as an idle one. After your screen-sleep or system-sleep timer runs out, macOS suspends the Mac, and the copilot process is frozen along with everything else until you wake it back up.

This bites hardest on the runs Copilot CLI is best at: you put it in autopilot mode so it can carry a refactor or a failing test suite forward without step-by-step approvals, you walk off to get coffee, and you come back to a Mac that slept ten minutes in. The session isn't lost — it resumes where it froze — but nothing happened while you were gone.

The fix is to stop macOS from sleeping for as long as the agent is actually running a task — then let it sleep normally again shortly after the work goes quiet — within your grace window, 90 seconds by default. You can do that for free in two minutes, or with a tool that watches for real activity so you don't have to babysit it.

The free option

Free tools can keep your Mac awake too

If you only run Copilot CLI occasionally, you don't need to buy anything. Two solid free options:

  • The built-in caffeinate command. Open a second terminal tab and run caffeinate -i before you kick off a long Copilot CLI run. It'll hold sleep off until you close that tab 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 specific apps are running.

Both are a fine choice if your runs are a few minutes here and there. The catch: neither one knows when Copilot CLI actually finished. 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 Copilot CLI

AgentBarista watches real activity signals — the CPU of the copilot process and its children, and on-screen terminal text via Accessibility. Copilot CLI is on the built-in watch list, and you can add any app as a watched target in Settings.

Watches activity, not a timer

It reads the actual work signals — process CPU (including child processes running your builds and tests) and on-screen terminal text — instead of a fixed keep-awake timer you have to remember to set and unset.

Lets go when the run is done

When activity goes quiet, AgentBarista waits out a short grace period and then releases sleep prevention automatically. No forgotten caffeinate tab, no battery held hostage overnight.

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.

Copilot CLI Claude Code Cursor Codex Gemini CLI Windsurf OpenCode VS Code 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.

FAQ

Questions Copilot CLI users actually ask

Isn't this just caffeinate with extra steps?

Pretty much, yeah — caffeinate or Amphetamine will do the basic job for free, and that's a totally fine choice if you're not running agents all day. AgentBarista adds the parts caffeinate doesn't: it releases sleep on its own when the work stops, it won't keep your battery pinned at 2% overnight, and it'll tell you how much time it actually kept your Mac awake.

I delegate long runs to the cloud with & — do I still need this?

Not for those runs. When you prefix a prompt with &, Copilot CLI hands the task to a cloud coding-agent session on GitHub's side, and your Mac sleeping doesn't touch it. This page is about the default local interactive runs — where the agent edits files and runs commands on your machine, and sleep freezes it mid-task.

What does it read on my 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.

When can I actually get it?

Right now. The download is a free 14-day trial of the full app — no card needed. A Personal License is $19/year if you subscribe before September 15 — locked in for as long as you stay subscribed. New subscribers after that pay $29/year. Cancel any time.

More agents

Also running Windsurf, Zed, or another agent?

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