The Lean Argument for a Runner That Closes the Loop From Claude Code Task to Merged Pull Request

A runner must own every handoff, from intake to review.

· 8 min read
Cover illustration for “The Lean Argument for a Runner That Closes the Loop From Claude Code Task to Merged Pull Request”
Cloud Agent Adoption · November 18, 2026 · 8 min read · 1,773 words

A bring-your-own API key cloud coding agent runner should run Claude Code or Codex with a team’s own Anthropic or OpenAI API key and produce a pull request that a human can review, without anyone having to handle the handoffs. Its leverage comes from owning the path from task intake through isolated execution and CI to human review. The agent still needs a human to approve a merge.

Why a dispatched Claude Code task does not automatically become a merged pull request

An engineer dispatches a Claude Code task and closes the laptop. The task may run as planned and still never reach a reviewer. A completed agent session is not necessarily a pull request, and a commit does not establish that checks passed or that someone can assess the change. The gap is one of loop integrity. If the handoffs between the trigger, execution, and review are incomplete, the engineer remains responsible for moving work forward after delegating it.

That responsibility falls across five seams, namely task intake, environment setup, isolated execution, PR creation, and human review. Each seam can require a manual intervention. Someone confirms that the environment is ready, watches CI, responds to a failed check, or nudges the agent to move from a commit to an open PR. These interventions erode the gain from delegating the coding itself because they keep the engineer attached to the task.

Cloud execution removes one dependency, but not all five handoffs. Claude Code on the web runs sessions in isolated, Anthropic-managed VMs, while Codex cloud runs tasks in OpenAI-managed containers. Cursor cloud agents use isolated cloud VMs, and Devin runs in vendor-managed cloud environments. The laptop can leave the execution path. Whether the engineer can leave it too depends on what connects that execution to a reviewable result.

What "closing the loop" actually requires in mechanical terms

A runner closes the mechanical loop by accepting a trigger, provisioning an environment, executing the agent in isolation, monitoring CI, and surfacing a reviewable PR. Human judgment belongs at review, rather than in the transport of work from one stage to another. This distinction separates an unattended workflow from a remote terminal that still needs supervision.

Claude Code sessions can start at claude.ai/code, in the Claude apps, through claude --cloud, through @Claude in Slack, or through routines on a schedule or GitHub events. Cursor supports entry points including its desktop app, cursor.com/agents, its iOS app, Slack, Linear, the API, and comments on supported GitHub and Bitbucket work. Codex supports the web, the ChatGPT desktop app, mobile, and the Codex CLI, with @ChatGPT in Slack or Microsoft Teams also available in Enterprise workspaces. These entry points cover the start of the workflow. Their practical value is that engineers can start work where its context already lives.

Once work starts, the execution layer must give each task its own environment, including its databases, services, and ports. Isolation is a prerequisite for parallel execution. Without it, tasks can collide over shared resources, and a failure can affect work on another branch. Anthropic provisions a fresh Ubuntu VM with the repository, common toolchains, Docker, PostgreSQL, and Redis, and caches files installed by a setup script for about seven days. Codex checks out the chosen branch or commit and preserves files, including uncommitted changes, so work can reopen from another device, with saved state recoverable for up to seven days after the last start of a turn or task resume.

The required artifact is a draft pull request on a named branch with CI results attached. A reviewer should not have to decode agent state. Devin can create pull requests, respond to review comments, and read CI results through its GitHub app. Copilot in the cloud can open one pull request per task, with session logs showing the work and tools used.

Parallelism is what makes the loop worth closing at scale

Teams gain when several tasks can move ahead on separate branches without waiting for a developer to get back to the keyboard. Cloud execution makes that independence possible. Work can survive the laptop closing, run overnight, or start from a phone before passing to a teammate. When each task also produces a reviewable PR, parallel execution gives the team work it can use without someone having to finish each session by hand.

Coinbase built Forge on Linear’s Agent SDK to work across Slack, GitHub, and Linear with the context already in each system. That example grounds the workflow side of the argument. A task does not have to begin in a separate interface detached from the discussion, issue, or repository that defines it. The structural advantage is continuity between the place work is identified and the systems where it proceeds, rather than another destination for engineers to supervise.

Linear uses its own agent workflow to resolve roughly a third of incoming bug reports, mostly on the first pass. This is a narrower application of the same principle. Incoming work can move through a repeatable workflow instead of requiring an engineer to initiate and shepherd every attempt. Claude Code routines follow that pattern with scheduled and GitHub-event triggers that can run daily code reviews, health checks after each release, and dependency audits without someone at the keyboard.

More branches can mean more proposed breaking changes. Isolation limits the risks of running tasks by giving each one its own VM and environment, while draft PRs keep proposed changes separate from merged code. Neither control proves that a change is correct. They establish the boundary at which parallel production stops and review begins, which is also where the next bottleneck emerges.

Review volume, not authoring volume, is where the loop breaks down

A runner that triples PR output without addressing review time leaves the queue waiting at the review stage. Authoring is no longer the limiting stage. Reviewers must still check what changed, whether the evidence backs it up, and whether the change belongs in the protected branch.

Bot-authored PRs wait longer for pickup and are accepted at a much lower rate than human-authored ones, reflecting a lack of a fast signal for what reviewers can trust beyond code quality alone. More output does not supply that signal. The runner therefore needs to account for the review stage beyond PR creation.

Authorship and review became independent roles. That separation avoids the subtle bias of an agent implicitly trusting its own work and creates checks and balances before human approval.

The production side can also feed work back into the loop. Sentry can automatically create a Linear issue when an error fires, run root cause analysis, and optionally open a pull request with a suggested fix without leaving Linear. That connects a production signal to a proposed repair. Agents should be allowed to investigate and propose, while draft pull requests, required human review, branch protection, and a protected main preserve the decision boundary.

Where execution runs determines what governance is possible

Human approval governs the final change, but execution location governs what happens before that approval. The agent may already have worked with repositories, secrets, and build artifacts by then. For regulated organizations, doing that work on vendor infrastructure can put it outside the security perimeter and prevent them from using the runner. Review alone cannot resolve that infrastructure objection. Owning the loop therefore requires control over where the work runs as well as who can merge its result.

Claude Code v2.1.224, released August 7, 2026, adds self-hosted environments on Team and Enterprise plans. The command claude self-hosted-runner turns a team’s machines or containers into the compute layer for sessions. This changes the execution boundary. Repository checkouts, secrets, files, and build artifacts remain inside the organization’s infrastructure, while Anthropic handles authentication and session routing. Model inference and session transcripts still go to Anthropic, so self-hosted execution is not the same as keeping every part of the system inside the network.

The two runner modes fit different workload patterns. Fixed runners keep a set number of machines running all the time and share out sessions as they arrive, so they fit steady demand that is easy to predict. On-demand runners use an orchestrator to start a runner when work arrives and stop it when finished. That mode is more cost-efficient for variable usage. It also provides a straightforward connection to existing CI/CD infrastructure, tying the compute lifecycle to the arrival and completion of work.

Cursor splits the work in a similar way with self-hosted workers. File edits and terminal commands run inside the network, while Cursor runs the agent loop, inference, and planning in its cloud. A team evaluating governance needs to understand which operations remain inside its perimeter and which remain with the vendor. Infrastructure control is the prerequisite for enforcing that boundary, which still requires examination.

The smallest infrastructure decision: what a team actually needs to wire this up

For a team asking how to run Claude Code or Codex in the cloud without managing its own infrastructure, the lean decision is choosing an environment for the existing agent. A bring-your-own API key cloud coding agent runner should combine managed execution with the team’s own subscriptions and keys. Credentials should not be resold through the runner. Teams must assess whether that environment also owns the handoffs that turn a dispatched task into work a human can review.

The environment is the durable part of this choice. Claude Code, Codex, Cursor, or another harness can be swapped, but the surrounding workflow can still create dependence if its triggers, credentials, and outputs are tied to one harness. Agent portability keeps that choice open. The useful criterion is whether the same isolated environment and workflow can support a different harness without requiring the team to rebuild how work starts and reaches review.

In practice, that environment must combine per-task VM isolation with integrations for Slack, Linear, GitHub, and schedule or webhook triggers. It must also make execution observable. Session recordings, audit logs, and PR outputs give the team material it can inspect and act on, rather than requiring it to infer what happened from a final diff. Credential handling belongs in that same decision because the team’s keys and subscriptions define a separate boundary from the runner’s orchestration role.

At enterprise scale, SOC 2, SCIM, audit logs, and self-hosting belong in the product. A managed cloud environment and a self-hosted compute layer serve different operational needs, so reducing infrastructure work cannot override a requirement to keep execution inside the security perimeter. The lean choice is the smallest environment that satisfies both the workflow and governance requirements. Its unit of output remains a reviewable pull request that a human can merge, comment on, or send back.

Sources

  1. Cloud development environments for coding agents: 9 platforms compared
  2. How to run Claude Code in the cloud: 5 options compared

More in Cloud Agent Adoption