← All guides

Guide

Background agents: coding agents that work while you don't

A background agent is a coding agent you hand a task to and then stop watching. It works in its own environment, usually a cloud machine with your repository cloned and its dependencies installed, and comes back with something you can review, most often a pull request.

This guide covers what that changes about how you work, which jobs suit it, how to set one up so it succeeds, and how background agents differ from proactive ones.

What a background agent is

The coding assistant in your editor works with you: you prompt, it edits, you watch, you correct. A background agent takes the same kind of model and tools (reading files, running commands, editing code, running tests) and moves the session somewhere else, so it can run for as long as the task takes without holding your laptop or your attention.

Cursor's help pages put it simply: background agents are coding agents that typically run for a very long time, taking a task from start to finish without interruption and reporting back with proof the work is done. Vendors use different names for the same idea: cloud agents, asynchronous agents, autonomous coding agents.

How it differs from the assistant in your editor

  • Where it runs: in an isolated machine or container, not on your computer. Closing your laptop doesn't stop it.
  • Who waits: nobody. You start the task, go do something else, and come back when it reports in.
  • What you get back: a branch, a diff or a pull request with a summary of what it did and what it checked, rather than edits appearing in your open files.
  • How you steer it: up front, in the task you write and the environment you give it, and afterwards, in review comments. There's less back-and-forth in the middle.
  • How many at once: because each task has its own environment, you can run several in parallel on different branches.

Background agents vs. proactive agents

A background agent still waits to be asked. Someone writes the task, assigns the issue or sends the prompt, and the agent works on that one job.

A proactive coding agent is given a standing job instead of a single task: watch the error tracker and fix new errors, keep dependencies current, re-run the test suite and repair what breaks. It starts work on its own when something happens, then hands the result to a person to review. Every proactive agent runs in the background; not every background agent is proactive.

Tasks that suit a background agent

  • Bug fixes with a clear reproduction: an error message, a stack trace or a failing test.
  • Failing or flaky tests that need investigating and fixing.
  • Dependency and framework upgrades, where the work is mechanical but touches many files.
  • Migrations and renames across a codebase: an API change, a deprecated call, a config format.
  • Writing missing tests for code that already works.
  • Small, well-specified features where the issue says what done looks like.
  • Documentation that has drifted from the code.

Tasks to keep for yourself

  • Product decisions where the right answer isn't written down anywhere the agent can read.
  • Architecture changes that cut across teams or services.
  • Anything that needs production access or secrets you wouldn't give a new contractor on day one.
  • Vague asks (“clean up the auth code”) with no way to check the result.

How to hand off a task so it succeeds

  • Write it like an issue for a new teammate: the goal, where in the code to start, and how to tell it's done (a test that should pass, a page that should load, an error that should stop).
  • Make the environment reproducible. A setup script that installs dependencies and a single command that runs the tests matter more to an agent than to a person, because it can't ask you.
  • Tell it the commands: how to build, lint, type-check and test. Many tools read a file in the repository for this, such as AGENTS.md; check what yours reads.
  • Keep permissions narrow. Let it push branches and open pull requests, not merge to your main branch or deploy.
  • Keep tasks small. One bug or one upgrade per task gives you a pull request you can actually review.

Reviewing what comes back

  • Treat it as a pull request from a capable new teammate: read the diff, not just the summary.
  • Check that it ran the tests and that CI passed on its branch, rather than taking its word for it.
  • Watch for scope creep: unrelated reformatting, renamed files or extra changes it wasn't asked for.
  • Try the change where you can, in a preview deployment or locally, especially for anything a user sees.
  • When it's wrong, say why in a review comment. Most tools let the agent pick the pull request back up from there.

Where to find background coding agents

Several coding tools now offer background agents. Plans, limits and pricing change often, so check each vendor's own documentation for what's current.

  • Cursor Cloud Agents: Cursor's background agents, which run in isolated cloud machines with your repository and environment set up.
  • GitHub Copilot in the cloud: Copilot's cloud agent, started from an issue or a prompt on GitHub and returning a pull request.
  • Jules by Google: Google's asynchronous coding agent, which works on a task in the cloud and reports back.
  • OpenAI Codex Cloud: Codex tasks that run on OpenAI-managed computers, so work continues while your computer is asleep.

Questions people ask

Is a background agent the same as an autonomous coding agent?

Mostly. Both describe an agent that completes a task end to end without step-by-step guidance. “Background” stresses that it runs away from your editor while you do other work; “autonomous” stresses that it decides the steps itself.

Will a background agent push straight to my main branch?

Not if you set it up well. The common setup is for the agent to work on its own branch and open a pull request that a person reviews and merges. Check your tool's repository permissions to confirm what it can do.

Does my code leave my machine?

Usually, yes: most background agents run in the vendor's cloud with a copy of your repository. What they store and for how long differs by vendor, so read each one's security and data documentation before connecting a private repository.

How is a proactive coding agent different?

A background agent works on a task someone gives it. A proactive agent has a standing job, such as fixing new errors as they appear, and starts work on its own when something happens, still handing its changes to a person to review.


Want a coding agent that starts the work itself? Proactive Coding is your proactive coding agent. Get in touch and tell us what you're building.

More guides