The inner loop covers pre-commit development, while the outer loop covers post-push delivery. The commit boundary separates local writing, building, testing, and debugging from code review, CI/CD, integration testing, and deployment.
TL;DR
AI agents now run the write-build-test-debug cycle on their own, with 78% of Claude Code sessions involving multi-file edits and agents averaging 20 autonomous actions before requiring human input. Code production has outpaced absorption, and DORA identifies the hidden verification tax behind that shift. This guide defines both loops, maps today's agent tools to each, and explains why the outer loop is the new constraint.
Engineers feel this shift as an inversion: the code takes minutes to generate, then sits for hours waiting on review, CI, and merge decisions. They have to decide whether generated changes are safe enough to absorb after the code appears in minutes. DORA finds that trust in AI-generated code remains uneven, with 30% of developers reporting little to no trust. DevOps practice formalized the classic inner/outer loop model, which later appeared in developer productivity metrics alongside DORA and SPACE, though agents have changed who runs each loop.
This article defines both loops, shows where tools like Copilot, Cursor, Claude Code, and Devin sit relative to the commit boundary, and covers the frameworks practitioners now use to describe agent-era workflows. The article also covers how Augment Cosmos, a unified cloud agents platform for running agents across the software development lifecycle, applies AI workflow orchestration to agent delivery. Cosmos exposes Environments, Experts, and Sessions as primitives, and teams using it see 5-10x speed-up for multi-file tasks. The Context Engine powering Cosmos processes entire codebases across 400,000+ files and carries repository files, review findings, test signals, and deployment context across the workflow. Agents can check generated changes against the codebase before review starts rather than relying on isolated diffs.
What Is the Inner Loop?
The inner loop is the rapid, iterative cycle an individual developer performs locally, before any commit reaches version control. Google's DORA AI capabilities model defines it as "a developer making a code change and seeing it running in a development environment." The loop runs "multiple times per hour." Martin Fowler compresses it further on his fragments page: "The inner loop is writing code, testing, debugging."
The stages repeat until the code meets the developer's standard:
- Write or modify code, with linters and type checkers running
- Build locally
- Run the application and unit tests
- Debug failures
- Refactor
- Commit to version control
The loop's defining property is feedback latency. An ACM Queue paper on developer experience identifies feedback loops as one of three core dimensions, alongside cognitive load and flow state. A GitHub engineering experiment found that spending an extra $4-5 on build compute saves about $40 per build for an individual developer. Every slow step in the inner loop is a forced context switch, which is why teams have historically kept the loop stripped down to what runs instantly on a laptop.
The boundary marker is the commit. As Ben de St Paer-Gotch describes it, the inner loop "essentially lives before a PR is reviewed/approved in the world of git."
What Is the Outer Loop?
The outer loop begins after a developer commits code to version control. The loop covers everything required to integrate, validate, and ship that code. Red Hat's platform engineering guidance describes outer-loop work as code review, production builds, compliance and security checks, non-functional and functional testing, and deployment to target environments. DZone offers the shortest version in its analysis of how the inner loop is eating the outer loop, calling the outer loop "everything after you push."
| Outer-loop dimension | What happens after the push | Why it adds latency |
|---|---|---|
| Review | Peers inspect changes before approval | Human availability gates merge decisions |
| Production build | CI systems build the committed code | Shared infrastructure handles larger validation scope |
| Compliance and security | Scans check policy, risk, and vulnerability signals | Specialized gates require auditable evidence |
| Functional testing | Integration and E2E tests validate behavior | Real dependencies and environments take longer than local tests |
| Deployment | Changes move through target environments | Staged releases involve coordination beyond the original author |
Teams made the outer loop slower by design as a deliberate tradeoff. DZone traces the split to a practical constraint: full validation testing against real dependencies in a realistic environment was slow and expensive, so developers "made a tradeoff to sacrifice thoroughness for speed in the inner loop and defer the real testing to continuous integration (CI)." Carlos Arguelles describes the resulting cadence in his essay on rethinking how we test, writing that "The outer loop takes minutes to hours. It's where the heavier integration tests and all E2E tests live, because they're too slow and too infrastructure-dependent for the inner loop."
The outer loop is also where collaboration concentrates. Speedscale's inner and outer loop documentation characterizes the inner loop as individual work with occasional peer input and the outer loop as high collaboration among team members. Review approvals, security gates, and staged deployments involve people beyond the original author, and each handoff adds wait time.
Inner Loop vs Outer Loop: Side-by-Side
The two loops differ across scope, speed, tooling, and ownership. This comparison captures the classic pre-agent split:
| Aspect | Inner Loop | Outer Loop |
|---|---|---|
| Scope | Individual developer tasks | Team/system-level activities |
| Focus | Code development and immediate validation | Integration, delivery, and deployment |
| Activities | Coding, building, unit testing, debugging | Code reviews, CI/CD, integration testing, deployment |
| Feedback speed | Immediate | Slower due to larger scope |
| Frequency | High, multiple times per hour | Lower, aligned with release cycles |
| Tools | IDEs, local build/test tools | Version control, CI/CD pipelines, monitoring |
| Collaboration | Individual, occasional peer input | High collaboration among team members |
Speedscale draws the test boundary at external dependencies: unit testing counts as inner loop "because it does not require any external resources," while tests needing external system integration belong to the outer loop.
How AI Agents Redraw the Loop Boundary
AI coding agents now execute the entire inner loop autonomously, which moves the human's active cycle one level up. Anthropic's agentic coding trends report documents that Claude Code sessions now stretch from minutes to hours, with one 12.5M-line codebase change completed in a single 7-hour run. Multi-file edits appear in 78% of sessions, up from 34% a year earlier, and agents complete an average of 20 autonomous actions before requiring human input, a figure that doubled in six months. The typical autonomous agent cycle mirrors the human one by analyzing the task, exploring the repository, implementing changes, running tests, debugging failures, and iterating.
Individual tools sit at specific points relative to the commit boundary. GitHub Copilot autocomplete stays firmly in the inner loop; an ACM Queue analysis of AI-assisted development notes that it "tackles the 'inner loop' of writing code in the IDE but leaves the 'outer loop' of development largely unchanged." Cursor also sits in the inner loop with a human-in-the-loop pattern of prompt, suggestion, review, and refine, as TrueFoundry's Cursor vs Claude Code breakdown describes. Claude Code spans both loops through strong test and version-control interaction, running autonomously in patterns like Geoffrey Huntley's Ralph Wiggum loop. Outer-loop agents include the GitHub Copilot coding agent ("Padawan"), which operates as an assignee on GitHub issues and returns PRs via GitHub Actions, and Devin from Cognition, which teams invoke from Slack, Jira, and GitHub. OpenHands, which self-positions in the outer loop, argues in its post on agents in the outer loop that effective teams will use both loop types.
| Tool | Loop position | Basis |
|---|---|---|
| GitHub Copilot (autocomplete) | Inner loop | Tackles writing in the IDE, leaves outer loop unchanged |
| Cursor | Inner loop, human-in-the-loop | Multi-file edits with developer reviewing diffs in the editor |
| Claude Code | Spans both loops | Strong test and version-control interaction; runs autonomously |
| GitHub Copilot coding agent ("Padawan") | Outer loop | Operates as an assignee on GitHub issues, returns PRs via GitHub Actions |
| Devin (Cognition) | Outer loop | Invoked from Slack, Jira, and GitHub, taking on entire tasks without opening an IDE |
| OpenHands | Outer loop | Self-positions there; argues effective teams will use both loop types |
The human role shifts accordingly. Anthropic's report describes engineers moving from implementers to orchestrators of agent systems, with human judgment operating as a permanent layer rather than a transitional state on the way to full automation. Martin Fowler describes this as supervisory engineering: programming changes when engineers supervise the agents that perform more of the coding work. Boris Cherny, the creator of Claude Code, described a March 2026 workflow where autonomous loops prompt Claude, choose next steps, and let the engineer focus on designing loops rather than issuing individual prompts. He runs roughly 5 parallel agents and ships 20-30 PRs a day.
The boundary itself is also dissolving from the tooling side as ephemeral environments spin up in seconds and give branches real integration testing against actual dependencies before merge. CircleCI's CTO describes AI coding agents as pulling CI feedback into the inner loop, so validation that once waited for the pipeline now happens before the push.
That same pre-merge shift is where the Context Engine fits. The Context Engine can reduce hallucinations in enterprise codebases by up to 40%, and its pre-merge agent validation uses repository context to flag issues before code reaches the PR stage.
Run your software agents at scale
Cosmos gives your agents the context, tools, and feedback loops they need to get better with every workflow.

Why the Outer Loop Became the Bottleneck
Agents accelerated inner-loop code production faster than outer-loop processes can absorb it, and verification capacity explains the queue. With 78% of Claude Code sessions now involving multi-file edits and long-running agents completing hours of work in a single session, generated changes arrive as multi-step, repository-spanning work rather than single-line completions. DORA finds that verification tax is the mechanism behind the queue: teams often spend writing-time savings on auditing. Dropbox's Kazuaki Okumura reported on rethinking engineering productivity that as AI tools spread across engineering, "accelerating code generation" shifted some bottlenecks downstream. The trust gap compounds these dynamics, since reviewers slow down when they suspect generated code needs closer inspection.
| Bottleneck source | What accelerates | What still gates delivery |
|---|---|---|
| Generated PR volume | Agents produce multi-step, repository-spanning changes | Review queues absorb more changes than before |
| Review availability | Code exists sooner | Human availability still gates merge decisions |
| CI queue time | CI feedback moves earlier for some branches | Shared infrastructure still handles larger validation scope |
| Security and compliance gates | Agents can prepare changes faster | Policy, risk, and vulnerability signals still need auditable evidence |
| Merge decision latency | Parallel agents create more candidate changes | Teams still decide which changes are safe enough to absorb |
For review bottlenecks, Cosmos Deep Code Review moves context into the review path itself. Teams using context-aware review see 59% F-score code review quality. Reviewers get repository files and codebase structure before they inspect assumption shifts, so they no longer have to rediscover that structure after the final PR.
The New Mental Models: Middle Loops and Checkpoints
Practitioners have converged on frameworks that insert a supervision layer between the classic two loops. Fowler describes a proposed "middle loop": "AI is increasingly automating the inner loop... But someone still has to direct that work, evaluate the output, and correct what's wrong. That feels like a new loop, the middle loop, a layer where engineers supervise AI doing what they used to do by hand." IT Revolution's three-loop framework formalizes the same structure: an inner loop (seconds to minutes) that becomes a request-output-verify cycle, a middle loop (hours to days) for continuity and coordinating parallel agents, and an outer loop (weeks to months) for organizational concerns.
The agent-era supervision layer turns continuous inspection into staged control points:
- Specify the task, intent, and constraints before agent work starts
- Let agents execute the request-output-verify cycle inside the inner loop
- Coordinate parallel agents through a middle loop that preserves continuity
- Pause for explicit approvals when agents reach review-relevant checkpoints
- Capture feedback as institutional memory for future tasks
Kief Morris, writing on humans and agents, distinguishes "humans in the loop," who inspect each line of agent output, from "humans on the loop," who work on the system that produces the output. His warning about the first mode: "The challenge when we insist on being too closely involved in the process is that we become a bottleneck. Agents can generate code faster than humans can manually inspect it." At QCon AI New York 2025, LinkedIn's Karthik Ramgopal and Prince Valluri described human involvement as explicit checkpoints. Their model replaces continuous oversight with approvals at defined pauses, and teams capture feedback as institutional memory for future tasks.
Cosmos is built around this checkpoint pattern. Cosmos Sessions support long-running and parallel agent workflows with auditable, replayable runs over days and weeks. The Cosmos Agent Runtime coordinates multiple agents working in parallel across workspaces, and Sessions record agent work so a run can stay private to one engineer or become a reusable workflow for others.
Cosmos checkpoint workflows reduce eight human interruptions to three checkpoints for teams implementing human-steered agent delivery. Agents handle five stages while humans steer prioritization, spec and intent review, and contextual understanding through code evolution. Because agents on the platform share a virtual filesystem with tenant and private memory, corrections from one checkpoint persist, so tomorrow's agent output starts from today's feedback. The cross-repository workflows guide walks through what this looks like in practice for cross-repository changes.
What the Inner/Outer Loop Framework Is Not
The framework describes iteration speed and ownership boundaries, and practitioners often confuse it with several adjacent concepts. Four distinctions matter for using the terms precisely:
- Software development lifecycle. The lifecycle describes sequential phases: requirements, design, implementation, testing, deployment, maintenance. The inner/outer loop framework shows how fast work cycles within those phases and who owns each cycle. AWS treats them as distinct in its serverless development guidance, with the loops operating inside the broader lifecycle process.
- Build-test-fix cycle. Build-test-fix is the content of the inner loop, the sub-process that runs inside it "several tens of times a day." How agents compress that cycle is a how-to question with its own tooling answers; this article stays on what the loops are and where their boundary sits.
- Shift-left. Microsoft documents shift-left testing as a strategy for moving testing earlier in the pipeline. The inner/outer loop framework defines a structural boundary at the commit; shift-left describes movement relative to any boundary and can operate within either loop.
- MLOps usage. In machine learning operations, Azure's machine learning ops concepts map the same terms to model training (inner) versus model deployment (outer). This article uses the general software development framing: pre-commit versus post-commit.
These distinctions keep the loop boundary focused on developer feedback latency and accountability rather than lifecycle phase names or adjacent operational taxonomies.
Rebalance Your Outer Loop Before Adding More Agents
Agent-driven inner loops put more pressure on review, CI, and merge decisions. The next step is to audit where your team's post-commit hours go across review queue wait, CI duration, and merge decision time, then compare those numbers with how fast agents now fill that queue. Teams whose review time already outpaces coding time need repository context, prior review findings, test signals, and deployment context available during review.
Teams handling post-commit verification can use CI/CD integrations to connect Cosmos to GitHub, Jira, Slack, CI status, and team knowledge sources through native integrations and MCP. Those connections bring issue context, team discussions, CI results, and knowledge sources into review, testing, and merge decisions. Cosmos human-in-the-loop policies let teams define where they require human judgment for post-commit escalation while agents handle the intervening stages in auditable sessions, with the Context Engine keeping repository context, memory, and external signals available across the workflow.
FAQ
Related
Written by

Ani Galstian
Ani writes about enterprise-scale AI coding tool evaluation, agentic development security, and the operational patterns that make AI agents reliable in production. His guides cover topics like AGENTS.md context files, spec-as-source-of-truth workflows, and how engineering teams should assess AI coding tools across dimensions like auditability and security compliance