Skip to content

Automating agent work means letting Claude Code, Codex or Cursor run without a person at the keyboard: toward a stated goal, on a schedule, on a cloud machine, or from a labelled issue to a pull request. It pays off only when deterministic gates, a budget and a named human merge check the result instead of someone reading every line.

This section is for developers who want the agent to keep working after they stop typing, and for tech leads who decide what may run unattended. Every “keep going” you type is a turn the agent could have taken alone.

You want to…Start with
Keep one session working until a checkable condition holdsThe /goal command
Re-run a prompt on a cadence: poll a deploy, babysit a PRThe /loop command
Choose between Claude Code cloud sessions, Codex cloud, Cursor Cloud Agents, Copilot and JulesBackground and cloud agents compared
Turn a labelled issue into a review-ready pull request with no one typingIssue to PR pipeline
Carry a change past the merge: auto-merge by risk class, rollout, rollbackIntent to production
Branch in your own code on what the agent foundAgent SDKs compared
Split one job across several agents without multiplying costOrchestration patterns

Multiplexers, sandboxes and third-party orchestrators live in the agent tools catalog.

Each step removes one kind of human involvement. Move on only when the previous step runs without rescue.

  1. Make “done” machine-checkable. A single command (tests, type check, lint) must decide success. See Level 4: you write the specs.
  2. Stop typing “keep going”. Use /goal for work with a finish line and /loop for work on a cadence inside a session you still watch.
  3. Move the run off your laptop. Start the same bounded task as a background or cloud agent and review what comes back. Add an SDK or several agents only where one headless command is not enough.
  4. Remove the trigger. Wire the issue-to-PR pipeline so a label starts the run and CI re-runs the gates independently.
  5. Remove the merge and deploy steps for low-risk classes only. Follow intent to production and keep human approval for everything else.

Where does each tool start an unattended run?

Section titled “Where does each tool start an unattended run?”

In a session: /goal and /loop. From a script or CI: claude -p with --output-format json and a spending cap, --max-budget-usd (print mode only). claude --bg starts a background session that claude agents (agent view, research preview) lists and claude logs or claude attach follows. Routines (/schedule, research preview) run on Anthropic’s infrastructure. For code that branches on results, use the Claude Agent SDK. Checked against Claude Code 2.1.283 (the latest channel, 2026-09-26).

You read evidence, not the diff:

  • Gates the agent cannot edit. CI re-runs tests, types, lint and security scans on the pushed branch, whatever the agent claims.
  • An evidence bundle on every PR. The evidence bundle lists what was run, what changed and what was not checked; see reading evidence instead of code.
  • Budgets and caps. A dollar or turn cap per run, and a fix loop capped at a small number of attempts.
  • A trace of what the agent did. Agent observability ties tool calls and cost to each PR.
  • A named human merge, until a risk class has earned auto-merge.

No machine-checkable definition of done yet? Begin at Level 4. Otherwise, start with /goal today, then build the issue-to-PR pipeline. Level 5: you run the software factory describes where this section leads.