fx was still working.
Your Mac didn't care.

If macOS went to sleep mid-task, fx froze right where it was. It didn't fail; it got paused along with your Mac. Here's why that happens, the free one-line fix, and the one thing about fx's name that any keep-awake tool has to get right — ours included.

To keep your Mac awake while fx runs: the free way is macOS's built-in caffeinate — start your session as caffeinate -i fx and the Mac can't idle-sleep until fx exits. That is the recommendation on this page today. fx is not in AgentBarista's built-in agent list yet, and the reason is worth two minutes of your time even if you never buy anything: the command is called fx, and there is a second, much older, much more widely installed Mac tool with exactly that name. Details below.

The direct answer

Why your Mac sleeps while fx is still going

fx spends most of a task waiting on a model response — 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 working hard doesn't protect the machine: a Mac mid-refactor sleeps on exactly the same schedule as one doing nothing. After your system-sleep timer runs out, macOS suspends the Mac, and the fx process is frozen along with everything else until you wake it back up.

This bites hardest on the runs worth walking away from: a long plan-then-edit pass across a repo, a big test-and-fix loop, or a fx ask you kicked off and left alone. The fix is to stop macOS from sleeping for as long as the agent is actually running — then let it sleep normally again once the run is done.

The free option

Free tools can keep your Mac awake too

fx is a terminal agent — a single native binary, not a windowed app — so the cleanest free fix is one command, and it is genuinely the right answer for most people:

  • The built-in caffeinate command. Launch your session as caffeinate -i fx instead of fx. The Mac can't idle-sleep while fx runs, and the moment fx exits, normal sleep is allowed again — nothing to remember to undo. Already on your Mac, free. For a one-shot run, wrap it the same way: caffeinate -i fx ask "explain the changes in this repository".
  • Attach to a session you already started. You don't have to restart it. fx installs as a real native binary — the setup script puts a single executable at ~/.local/bin/fx by default, or wherever FX_INSTALL_DIR points — so macOS reports the process under its own name rather than under an interpreter like node or python. Because two different tools can be called fx (see the next section), list them with their full path so you can tell which is which: ps -Awwo pid,comm | grep -E '/fx$'. The Vercel agent shows as …/.local/bin/fx; the JSON viewer shows as /opt/homebrew/bin/fx on Apple silicon, or /usr/local/bin/fx on an Intel Mac. Take the PID you want, then hold sleep off until that exact process exits with caffeinate -i -w <pid>.
  • Amphetamine (free, Mac App Store). A menu-bar toggle to keep the Mac awake on a timer or while your terminal app is open — handy if you'd rather flip a switch than type a command.

All of these are a fine choice if fx runs for a few minutes here and there. The catch: none of them knows when the agent actually finished a task versus when it's just sitting at an idle prompt. You either stop it yourself, or it keeps your Mac awake — and your battery draining — long after the work is done.

The thing a keep-awake tool has to get right

Two different Mac tools are called fx

Vercel's coding agent installs with curl -fsSL https://fx.sh/setup.sh | bash, which writes one executable to ~/.local/bin/fx. But brew install fx installs something else entirely: a long-established terminal JSON viewer, homepage fx.wtf, currently at version 39. Same four keystrokes, completely different program. Plenty of Macs have both.

That matters for anything that decides "is my agent working?" by looking at a process name. A JSON viewer piped a large file will burn CPU for a moment and then exit. A coding agent will sit at near-zero CPU for two minutes waiting on a model, then edit twelve files. If a keep-awake tool matches the bare name fx and trusts CPU as proof of work, it gets both cases exactly backwards: it can hold your Mac awake for a pager you already closed, and let it sleep during the run you actually cared about.

The practical version, whatever tool you use: don't match on the bare name. Match on the install path, or watch what fx writes while it works. fx keeps its state under ~/.fx/, and each saved session gets its own folder holding an events.jsonl that fx appends to as the run progresses. So a file-timestamp check tells you whether the run is actually moving:

  • stat -f "%Sm %N" -t "%F %T" ~/.fx/sessions/*/events.jsonl | sort | tail -5 — newest last. Updated in the last minute means something is happening; frozen for ten means decide what that means for your workload. The -t "%F %T" matters: without it macOS prints the date as Aug 24 12:00:00 2026, and sort then orders by month name — Sep above Aug above Apr — so the last line is whichever month sorts last alphabetically rather than the freshest one. If you'd rather not remember that, ls -lt ~/.fx/sessions/*/events.jsonl | head -5 gives you newest-first with no flags to get wrong.

We read that layout out of fx's own source rather than guessing it, but we have not yet run fx on a Mac of ours and watched those timestamps move — so treat it as read-from-the-source, not measured-on-hardware, and check it against your own machine before you build anything on it.

The purpose-built option — honest status

What AgentBarista does today for fx

Straight answer: fx is not in AgentBarista's built-in agent list, and we would rather say that here than let you find out after paying. It isn't a technical dead end — our catalog can pin a CLI by its install path as well as by its name — it's that we haven't verified the right path to pin. fx's setup script defaults to ~/.local/bin/fx but honours FX_INSTALL_DIR, so a rule keyed to the default would quietly miss anyone who moved it, and we don't ship detection rules we haven't watched work on a real Mac. Matching the bare name instead is the one thing we won't do: built-in CLI entries trust CPU as evidence of work, so a name rule would let the JSON viewer hold your Mac awake. fx is also very new — its own README says "Status: Experimental", it first appeared publicly in August 2026 and is still on 0.0.x releases, so its shape may still change. When we've run it and measured it, it goes in.

What you can do today: AgentBarista lets you add your own app to watch, and user-added apps are matched loosely and are CPU-trusted. That works for fx, with one caveat you should know before you rely on it — the loose match tests your text against both the process name and its full command path, in both directions, so a two-letter entry like fx is a wide net that can catch unrelated processes whose path merely contains those letters. Giving it more of the path to match on is the safer shape. We have not run fx on a Mac of ours, so treat this route as reasoned from how the matching works rather than something we have measured — and for genuinely unattended overnight runs, use caffeinate -i fx, which does not depend on any of it.

Not in the built-in list

Deliberate, not an oversight. We'd pin it by install path rather than by bare name — but fx's path is overridable and we haven't measured it on a real Mac yet. A bare-name rule would fire on the unrelated JSON viewer.

Custom-app route, with a caveat

You can add it yourself. Matching is loose and tests the full command path, so a two-letter name is a wide net — prefer more of the path, and don't lean on it for unattended runs.

Has a safety net regardless

A battery cutoff, plus a one-click restore — it asks for your password once — for the rare case a crash leaves sleep disabled. True for every app AgentBarista watches, built-in or not.

fx (not built in — custom app, see above) Claude Code Cursor Codex Gemini CLI Copilot CLI OpenCode Zed Claude ChatGPT + more

Worth saying plainly: free tools like Keepresso and adrafinil are open source and genuinely good, and both read agent hooks, which is a more accurate signal than guessing from CPU. If you're a solo dev running one agent, either is a reasonable choice. Where we put our effort is being quick to support brand-new agents as they ship, and being straight about which ones we've actually measured — which is why this page tells you fx isn't one of them yet.

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
  • Claude Code, Cursor, Codex and more in the built-in list — fx as a custom app
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.

Running agents across a team instead? See the teams page.

More agents

Also running Claude Code, Codex CLI, or another agent?

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