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 (14-day free trial, then $19 one-time), 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. macOS only looks at CPU and user input to decide whether to sleep, so an agent that's "thinking" hard but computing little looks idle to the OS. 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 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

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

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

When can I actually get it?

Soon — AgentBarista is in the final pre-launch stretch. Tap any Get notified button on this page, leave your email, and we'll ping you the moment it's live. No spam, just the launch note.

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: