Coding agents aren’t just fixing single issues anymore. Codex goal mode, Claude Code goal mode, Claude dynamic workflows and the “Ralph loop” all try to keep an agent working toward one objective for hours or days. That raises a question most benchmarks can’t answer: how well does the loop around the model hold up over a long development effort? LoopsBench is our benchmark to measure exactly that. We describe the change as a move from harness engineering to loop engineering.
This post is based on our paper LoopsBench: From Harness Engineering to Loop Engineering in Coding Agent Evaluation, written with Han Li, Zhemin Fang, Rili Feng, Yingqi Zhao, Jiaheng Liu, Pengfei Gao, He Ye, Qingwei Lin, Saravan Rajmohan, and Dongmei Zhang. The paper has the full method, setup, and results.
Harness vs. loop
A harness is the layer that turns a model into an agent: tools, prompts, the edit/run cycle. A loop sits on top of the harness and controls work that lasts a long time. It keeps the objective alive, decides what to do next, renews context through compaction or restarts, and keeps earlier work from breaking. We argue that once agents take on long-horizon development, most of the difficulty moves into this layer. That means a benchmark has to show what happens during the run, not just score the final state.
Existing suites fall short here. SWE-bench and its variants, FeatureBench, SWE-EVO and repo-generation benchmarks such as NL2Repo-Bench all score a terminal artifact. They can’t tell you whether an agent did dependent subproblems in a sensible order, kept intermediate obligations, or broke things that were already working.
How tasks are built: dependency DAGs
Each LoopsBench task is a directed acyclic graph of development units. A unit is a separately testable piece of work. It has a requirement, a file or symbol scope, a set of prerequisites, a reference patch, and tests. The benchmark has:
- 112 tasks in 8 programming languages and 9 domains, with more than 5,300 development units, and a median dependency depth of 6. Our comparison table lists a patch-scale figure of 37,296 for LoopsBench, compared with 33 for SWE-bench.
- Three real-world sources: 57 Course Labs (university projects from 30 universities), 29 PR Sequences (merged-PR streams from long-lived GitHub repos), and 26 Research Evolutions (clusters of papers linked by “load-bearing” inheritance, each with an open-source implementation).
- Selection thresholds: a temporal span of at least 2.5 months and a solution scale of at least 1,200 in each source’s own scale unit, so that routing and regression pressure actually show up.
An edge goes into the DAG only when the gold artifacts give unambiguous evidence for it. There are four kinds: sequential PR chains, structural module reuse (editing a file or symbol that an earlier unit introduced), functional producer→consumer API edges (imports or calls), and compositional layering (subclassing or extending a schema). The evidence is hunk overlap or symbol-level dependence. A denylist keeps out hot monolith files, generated artifacts and lockfiles. We are clear that this is a conservative lower bound on the true dependency structure.
Each unit’s tests pass a three-trial fail-to-pass check with three conditions:
- Solvability: the full gold solution passes every test.
- Non-triviality: an empty workspace passes none.
- Discriminativeness: the gold patch limited to the unit’s DAG ancestors still fails at least one test.
Instructions are rewritten from the gold diff so that they keep the public acceptance contract (signatures, output formats) and hide the implementation path and any identifying source names.
The flow-aware runtime
The evaluation harness is the most interesting part of the design.
- Topologically gated test release. Tests are released for scoring along the ready frontier: a unit becomes active once all of its predecessors pass. Gating only affects scoring. The agent can still edit anything and can follow any valid topological order. It isn’t required to replay the historical order, and it isn’t told which unit is currently ready.
- Regression obligations. After a unit passes, its tests stay enforced for the rest of the run. Breaking one counts as a regression.
- Dual-container snapshots. The agent edits in container A. On a fixed cadence the runtime snapshots A, drops snapshots with empty diffs, queues the rest, and runs the released tests in container B. The result is a trace of metrics at the actual change points as well as at the end.
The reported metrics are Resolve Rate (RR), Test Pass Rate (TPR), normalized dependency Depth, Regression Rate, and tokens. They also include plan-fidelity metrics computed against the recovered DAG: Edge F1, Layer agreement, Critical Path Ratio (CPR) and Width Ratio (WR).
RQ1: how far do loops get?
Not very far. The best configuration is Claude Opus-4.7 in Claude Code with outer continuation, and it resolves 25.00% of tasks. “Outer continuation” means an external evaluation loop that restarts the agent on residual work. Selected results (RR without / with continuation, TPR with continuation):
| Config | RR w/o | RR w/ | TPR w/ | Depth |
|---|---|---|---|---|
| Opus-4.7 (Claude Code) | 16.96% | 25.00% | 53.05% | 0.61 |
| GPT-5.5 (Codex) | 14.29% | 21.43% | 50.84% | 0.53 |
| GLM-5.1 (Claude Code) | 13.39% | 18.75% | 45.49% | 0.44 |
| DeepSeek-V4P (Claude Code) | 11.61% | 18.75% | 47.34% | 0.46 |
| Gemini-3.1-Pro (Claude Code) | 8.93% | 14.29% | 43.59% | 0.31 |
| Qwen3.6-Plus (Qwen Code) | 6.25% | 9.82% | 45.10% | 0.31 |
In a sweep that holds the model fixed (gpt-5.4), the loop implementation matters a great deal:
| Loop (gpt-5.4) | RR w/o | RR w/ | Depth |
|---|---|---|---|
| Codex | 13.39% | 18.75% | 0.49 |
| Claude Code | 12.50% | 17.86% | 0.42 |
| GitHub Copilot | 10.71% | 15.18% | 0.38 |
| OpenHands | 6.25% | 9.82% | 0.20 |
| SWE-agent | 5.36% | 8.93% | 0.16 |
| mini-swe-agent | 4.46% | 7.14% | 0.13 |
Without outer continuation, a single run usually covers only a shallow prefix of the DAG. The traces also show empty patches on unresolved units and skipped hard obligations in favor of easier ones. Continuation cuts down early stalls, but Resolve Rate levels off because later units inherit the obligations earlier units left open.
RQ2: plan, code and test state
| Loop | Edge F1 | CPR | WR | PatchLen | #Tests | Reg |
|---|---|---|---|---|---|---|
| Claude Code | 0.71 | 0.31 | 1.08 | 1.58× | 28 | 7.11% |
| Codex | 0.67 | 0.33 | 1.14 | 1.71× | 24 | 4.83% |
| GitHub Copilot | 0.58 | 0.41 | 0.92 | 1.83× | 22 | 6.91% |
| OpenHands | 0.39 | 0.85 | 0.39 | 2.31× | 16 | 2.46% |
| SWE-agent | 0.37 | 0.88 | 0.36 | 2.36× | 15 | 2.18% |
| mini-swe-agent | 0.27 | 0.97 | 0.24 | 2.54× | 11 | 0.24% |
- Planning gap. No loop’s recorded plan comes close to the recovered DAG; the best Edge F1 is 0.71. The closed-source loops plan as a tree and slightly over-parallelize (WR > 1). Most of their extra branches split up requirements that are actually serial. The open-source loops run nearly linear chains (CPR close to 1).
- Patch surplus. On units they do solve, agents write patches 1.6–2.5× longer than the gold patch while keeping only moderate token overlap with it.
- Sparse tests. Agents write far fewer tests than the native suites contain, so earlier work has little protection. Every deployed loop shows several points of regression. The low regression numbers for lighter loops mostly mean they passed fewer obligations that could later regress, so they shouldn’t be read as better discipline.
RQ3: which loop-engineering choices matter?
| Loop | Context rounds | Regressions/run | RR |
|---|---|---|---|
| Codex goal mode | 32.76 | 0.34 | 20.59% |
| Claude Code goal mode | 34.69 | 0.13 | 17.65% |
| Claude dynamic workflows | 97.96 | 0.36 | 24.11% |
| Ralph loop | 13.24 | 0.17 | 7.84% |
Dynamic workflows, which spawn task-specific workers with narrow contexts, renew context most often and score highest. They still have the most regressions per run. Splitting work across workers removes the dependence on one ever-growing transcript, but when the workers report back, someone still has to track which obligations are already complete. The Ralph loop restarts with a fresh invocation for residual work and does worst here, which suggests a restart that carries no state over loses too much.
Takeaways for people building agents
- Treat the loop as part of the system under test. Changing only the loop moves results by more than 2.5× on the same model. Leaderboards that credit everything to the model leave out an important variable.
- Explicit dependency state is the weak point. Agents break work into local issues and don’t keep a global plan. Persisting a dependency graph and a ledger of satisfied obligations is a reasonable next step.
- Write regression tests as you go. Sparse test authoring connects directly to the regression events.
- Context renewal is necessary but not sufficient. Compaction, workers and restarts all help with context limits. None of them replaces structured state handoff.
Limitations
The authors list several limitations:
- The recovered DAG is a lower bound. It can miss implicit configuration, build or cross-service dependencies.
- Unit boundaries and reference patches aren’t unique.
- Exploratory redesigns that replace earlier requirements are out of scope.
- Mobile, frontend-heavy and hardware-adjacent projects aren’t covered.
- Scores reflect the released tests, not full semantic equivalence.
- Claude Opus 4.7 helped materialize the tasks, which could bias wording, unit boundaries and tests. Because the sources are public, some contamination risk remains.
Because Claude-based tooling built the tasks and a Claude configuration tops the leaderboard, independent replication with other models would be useful.
Resources
- Paper: arXiv:2608.00267
- Project page: loopsbench.ai
- Code and data: microsoft/Loopsbench
