Guide

How to run Claude Code in the background (and still catch when it needs you)

How to run Claude Code in the background (and still catch when it needs you)

You hand Claude Code a task — refactor a module, chase down a flaky test, wire up an endpoint — and then you want to go do something else. Read a PR, answer Slack, ship a different feature. The phrase people reach for is "run Claude Code in the background," but that phrase hides two very different things, and picking the wrong one is why agents quietly stall on you.

Two meanings of "background"

There's truly detached, and there's running but still watchable. They are not the same problem.

Here's the thing most people miss: a coding agent is not a batch job. It pauses. Claude Code stops for permission before a risky command, asks what you meant when your instructions were ambiguous, and waits at the end for the next move. Those pauses are the whole interaction. So when developers say they want to run Claude Code in the background, they almost always want the second meaning — out of the way, but not out of reach. Treat an interactive agent like a headless one and it sits idle on a prompt you never saw.

The native-ish options, and where they leak

The instinct is to reach for the classic Unix toolbox. Each one keeps the process alive; none of them keep you in the loop.

The common failure is identical across all of them: the agent keeps running, but the signal — it needs a decision, it finished — never finds you. You traded babysitting for blindness. That trade is the subject of stop babysitting your AI coding agent.

The workflow that actually works

If what you want is "running but still notified," three pieces have to be true at once:

That last piece is the one tmux and nohup structurally can't give you, and it's where Claude Code's design helps. Claude Code exposes lifecycle hooks — roughly Notification (it wants attention), Stop (it finished), and PreToolUse (about to run a tool, can pause for allow/deny). Those are the exact moments worth a sound or a flash. Wire them to a notifier and "background" stops meaning "blind."

Where Backgrind fits

This is the shape Backgrind is built around. A background daemon keeps your agents alive across UI restarts and crashes, and notifications fire even while the window is hidden — a chime plus an accent ring on the tab that needs you, driven by those same Claude Code hooks. You run your real claude CLI (your login, your history), put it out of the way, and answer only when it actually pings. If you want the deeper mechanics of pinning it over your other windows, see an always-on-top terminal over any app, or try the live demo to feel the notification loop.