Skip to content

Repository files navigation

loop-bench

SWE-bench for loop designs — standardized benchmarks that measure loop architecture quality beyond pass/fail.

CILicense: MIT


The Problem

Loop design decisions are made on vibes, not data.

Developers don't know: Does my verification gate actually catch failures? Is my loop converging or spinning? How does my loop compare to alternatives on the same tasks? What does my loop cost per successful task?

Existing benchmarks (SWE-bench, Terminal-Bench, AgentBench) confound model capability with loop/harness design. Two reports using the same model can differ by 25+ percentage points purely because of the scaffold.

The Solution

loop-bench holds the model constant and varies only the loop design. It measures what the loop contributes — not what the model can do.

┌──────────────────────────────────────────────────────────┐
│ loop-bench Leaderboard │
│ Model: claude-sonnet-4-6 │
├──────────────┬──────┬────────┬───────┬───────┬──────────┤
│ Loop Design │ Pass │ $/Task │ Drift │ Honest│ Erosion │
├──────────────┼──────┼────────┼───────┼───────┼──────────┤
│ plan-first │ 87% │ $1.23 │ 0.08 │ 0.96 │ 0.15 │
│ reflexion │ 83% │ $0.94 │ 0.12 │ 0.91 │ 0.19 │
│ minimal │ 70% │ $0.67 │ 0.22 │ 0.85 │ 0.28 │
└──────────────┴──────┴────────┴───────┴───────┴──────────┘

Key Insight: Isolate the Loop, Not the Model

StudyFinding
GPT-5.5 in Codex vs. CursorSame model, 25.7pp score difference — scaffold only
"Beyond Resolution Rates" (9,374 trajectories)Framework swaps = 0.9–19.4pp variation
SlopCodeBench (196 checkpoints)Quality degrades in 77% of agent trajectories
Artificial Analysis Coding Agent IndexSame model, two harnesses = 32x cost difference

What We Measure (11 Metrics)

Primary Metrics

MetricWhat It Captures
Convergence RateIterations to completion
Cost EfficiencyDollars per successful task
Verification AccuracyDoes the verifier catch real failures?
Drift ScoreDid the loop stay on-goal?
False Completion RateLoop said "done" but wasn't
Erosion ScoreCode quality degradation over iterations

Secondary Metrics

MetricWhat It Captures
First-Edit DelaySteps before first code modification
Verbosity ScoreFraction of redundant/duplicated code
Context EfficiencyOutput tokens / total tokens
Recovery RateHow often the loop recovers from failed verification
Honesty ScoreWhat the agent said it changed vs. the actual diff

Anti-Contamination by Design

Unlike SWE-bench (94% of tasks in training data, OpenAI abandoned it Feb 2026), loop-bench uses custom synthetic repositories that don't exist on GitHub. No model has seen these tasks.

Task Categories

CategoryTasksWhat It Tests
Bug Fix10Single-file to cross-module fixes
Feature10Spec-driven implementation with rubrics
Refactoring5Structural quality under transformation
Multi-Step5Architectural decisions that compound

Tasks span TypeScript, Python, and Go.

Architecture

┌──────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐ ┌──────────┐
│ task.yaml │────▶│ Docker │────▶│ Loop │────▶│ Evaluator│────▶│ Reporter │
│ │ │ Sandbox │ │ Adapter │ │ (rubric │ │ (metrics │
│ │ │ │ │ │ │ + tests) │ │ + LTF) │
└──────────┘ └──────────┘ └───────────┘ └──────────┘ └──────────┘
│ │
▼ ▼
LTF trace file result.json

Every run produces LTF traces — the open standard for agent loop telemetry.

Competitive Differentiation

BenchmarkMeasuresWhat It Misses
SWE-benchIssue resolution rateConfounds model + scaffold. Pass/fail only. Contaminated.
Terminal-BenchCLI agent capabilityNo loop-level analysis
SlopCodeBenchCode quality degradationNo cost. No verification accuracy.
AgentBenchCross-domain generalizationSynthetic environments. No loop analysis.
loop-benchLoop architecture quality11 metrics. LTF traces. Hold-model-constant. Anti-contamination.

Baseline Loop Designs

Three reference implementations included:

LoopStrategyExpected CostExpected Quality
MinimalBare act → verify cycleLowLow
ReflexionSelf-correction via reflection memoryMediumMedium
Plan-FirstPlan → execute → verify with replanningHigherHigher

Quick Start

# Install
npm install -g @loop-eng/bench
# List tasks
bench list
# Run benchmark with a loop adapter
bench run --adapter ./my-loop.ts --model claude-sonnet-4-6
# View results
bench report --results ./results

Writing a Loop Adapter

importtype{LoopAdapter,LoopRunConfig,LoopRunResult}from"@loop-eng/bench";constmyLoop: LoopAdapter={name: "my-custom-loop",asyncrun(config: LoopRunConfig): Promise<LoopRunResult>{// Your loop implementation here// The adapter runs inside a Docker sandbox with access to:// config.repoPath - the task repository// config.goal - what to accomplish// config.testCommand - how to verify// config.modelId - which model to use// config.constraints - budget limits},};exportdefaultmyLoop;

Part of the loop-eng Ecosystem

ToolWhat It DoesStatus
ltfLoop Trace Format — the open standardShipped
loopguardCircuit breaker for agent loopsShipped
loopctlhtop for AI coding agentsShipped
kitScaffold production-ready loops in 30sShipped
loop-benchSWE-bench for loop designsActive
loopreplayWireshark for agent loopsPlanned

License

MIT

About

SWE-bench for loop designs — standardized benchmarks that measure loop architecture quality beyond pass/fail

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages