Your AI Coding Agent Is Slowly Rotting Your Code

summarized

TLDR

AI coding agents rot their own codebase even while they get new features right: in the SLOP CodeBench runs, Claude Opus 5.5 at medium effort handled 145 of 196 new-behavior steps but kept the whole program working on only 28, and top models strictly pass just 12.2-16.3% of checkpoints. The rot is mechanical, patch piled on patch with copied logic instead of restructuring, and it shows up overwhelmingly as broken old behavior, since roughly 256 of Opus 5.5's 258 final-checkpoint failures were regressions. That is why paying 4.2x more for extra effort bought three fewer strict passes: the damage accumulates in old features that no model setting or prompt in the tests actually slowed down.

Key points

Claude Opus 5.5 at medium effort passed only 28 of 196 steps while getting the new behavior right on 145.

Top models strictly pass just 12.2% to 16.3% of checkpoints in the October SLOP CodeBench rerun.

Opus 5.5 at extra high effort cost 4.22x more than medium yet passed three fewer checkpoints.

Roughly 256 of Opus 5.5's 258 final-checkpoint failures were regressions of previous behavior.

Agent code was 2.3x more verbose and twice as eroded as code from 473 human Python repos.

Tools mentioned

Techniques

  • Regression testing that reruns every earlier checkpoint test
  • Erosion measure weighting complexity score by square root of line count
  • Verbosity measure using 137 waste-pattern rules plus copied lines
  • Anti-slop prompt listing patterns to avoid
  • Plan-first prompt requiring a plan before coding
  • Reasoning effort settings for longer deliberation
  • Research-plan-implement workflow with human review
  • Fresh context sub-agents
  • Complexity and copied-code hooks between iterations
  • agents.md file for design decisions
Transcript (captions)

0:00 Your coding agent can get the new feature right most of the time and still hand back a broken program. And the newest slop code bench run puts numbers on that. Across 196 steps, Claude Opus

0:12 5.5 at medium effort got the new behavior right on 145 and kept everything working on just 28. On a real repo, that gap shows up as tasks that each look fine while the codebase keeps

0:24 getting harder to change. Every obvious fix costs money. Whether it's a stronger model, maximum effort, or a don't write slot prompt, slot codebench was built to catch that slow rot. None of the 15

0:35 agents in the May version of its paper finishes a single problem end to end, and the code structure gets worse in 77% of runs. In Theo's words, the popular explanation is that bad code multiplies

0:47 way, way faster than good does. And the benchmark agrees the code gets worse even though his video never cites it. But in human layers October rerun, opus at extra high effort cost 4.2, two times

0:59 as much as medium and passed three fewer checkpoints. Yet its code came out about five times cleaner by human layer's own measure. And if rot were only sloppy writing, the cleaner run should have

1:09 passed more. So where does the rot in these tests come from? By the end, you'll know how the benchmark catches it, what agents do to their own code as specs pile up, and which fixes are

1:19 measured, and which are only sensible advice. A feature can work and still count as a failure. And the reason starts with how each problem runs. Researchers at WMadison and elsewhere

1:29 hand the agent a spec and it builds a program. At every later checkpoint, it gets only the new spec plus the workspace it left behind. So it lives with its own earlier decisions while

1:39 quality gets measured after each step. One problem in the paper called code search shows that loop growing. Checkpoint one is a command line tool that searches Python files by exact text

1:50 or reax. And checkpoint two adds JavaScript and C++. By checkpoint 3, it has to match on the code syntax tree with placeholders that stand in for whole expressions. Checkpoint 4 adds

2:02 rules that pick out matches and fix them automatically. And checkpoint 5 adds Go, Rust, and Java. Each spec forces design decisions without dictating the internal structure. So every architecture choice

2:14 belongs to the agent. Grading is where it turns strict with four groups of tests at every checkpoint. Core tests check the behavior the new spec describes. Hidden

2:23 tests probe the functionality around it. And error tests check how it handles errors. Then there's a group that reruns every test from every earlier checkpoint, the regression tests. A

2:34 strict pass needs all four at once. Say the agent breaks exact matching from checkpoint one while adding rust in checkpoint 5 and that step fails even if rust works perfectly. According to the

2:46 paper, a mistake at checkpoint 2 can zero out every checkpoint after it. Which is why the test to watch in the benchmark and in your repo are the regression tests. Through that lens, the

2:56 October numbers start to make sense with today's models strictly passing between 12.2 and 16.3% of checkpoints. Opus at medium gets the new behavior right on about three steps in four. if you divide

3:09 one count by the other and then fails most of those on the strict count. Tests can tell you something broke, but they can't tell you what's happening to the code underneath. So, the paper measures

3:18 the code itself with two numbers. First comes complexity collecting in a few functions until they're painful to touch, which the paper calls erosion. Each function gets a weight. Start with

3:28 its complexity score, which counts the decision points inside it, and multiply by the square root of its line count. Erosion is the share of all that weight sitting in functions scoring above 10.

3:38 So a codebase erodess as its weight drifts into a handful of huge branchy functions. Across runs, the average number of functions at complexity 10 or more climbs from 3.6 to 23.7. Opus 4.7's

3:51 main function on a problem called forge is the paper's worked example. Over eight checkpoints, it grew seven times in complexity and went from 38 lines to 240.

4:02 Along the way, the agent replaced arg parse, the argument parser that ships with Python, with a handwritten flag loop and never pulled out a helper. Arg parse exists, so you never have to write

4:11 that loop. And the agent wrote it anyway, with an identical pair of branches pasted in for each of seven flags. A second measure counts the lines flagged by 137 waist pattern rules, plus

4:23 the lines that copy other lines, divided by all the lines, and the paper calls that verbosity. You'd expect it to grow because agents keep inventing new bad patterns. Rule violations barely move

4:34 though, up.3%. While structural duplication grows 96%. Duplication here comes from the agent writing fresh copies of logic it already has instead of reusing it. And the patching numbers

4:45 show the same habit from another side. Early in a run, agents rewrite about 97% of their code at each checkpoint. And late in a run that falls to under a third. Meanwhile, the cost of each

4:56 checkpoint grows 2.2 two times from start to end. So, the agent pays more per step to change less of its code, and the program grows sideways, patch on patch. Gabe Oransky, the benchmark's

5:07 lead author, described the same habit from watching runs. On one manufacturing problem, agents told at checkpoint 5 to reuse an existing calculation, tried to rewrite it, and got it wrong. In

5:18 Oransky's words, these models refuse to ever delete code unless there's no other choice. Why? They'd rather patch and copy than restructure. No source explains. So what's left is the paper

5:28 measuring the habit and its author watching it happen. Then there's the comparison with human code which changed between versions of the paper. In March it said human code stays flat across 20

5:39 tracked repos. By May it had swapped in the git histories of 473 Python repos and erosion rose in 53% of those against 77% of agent runs. Human code rots too then, just less often and more slowly

5:53 than agent code, which ends up 2.3 times more verbose and twice as eroded as those repos. On top of that, agent code piles up verbosity about seven times faster and erosion about five times

6:05 faster. With rates like those, patch on patch matters far more when an agent is the one patching. So, ROT comes with a rising bill per step, and the three fixes from the start all mean spending

6:15 more. First up is a newer model and the October rerun covered all 36 problems. Opus 5.5, GPT6, and GLM 5.3 still strictly pass only 12 to 16% about where GPT 5.5, the May papers best agent,

6:32 already sat at 14.8. Effort is the second, the setting that lets a model reason longer before acting. Opus 5.5 at medium, earned 28 strict passes for about $193.

6:44 At extra high, it earned 25 for about 817, 4.22 times the bill. That works out to roughly 624 extra dollars for three fewer passing checkpoints, which is a

6:55 lot to pay for the setting with the bigger number on it. GPT6 slid from 30 to 26 at about twice the cost. Only GPT6 Astra gained going from 29 to 32 at 2.9 one times the cost. So for Astra, more

7:10 effort did pay. Each setting ran once and the writeup itself draws a line there. It says higher effort wasn't a reliable way to buy strict passes in these runs and that this doesn't prove

7:21 more reasoning hurts coding. Human layers cleaner code number from the start comes from a section headed code quality findings blurry on human layer's own slop score where a lower number

7:31 means less slop. Opus at extra high scored 77.75% against 94.25 for medium. The writeup describes that gap as code close to five times cleaner, and the score only

7:43 covered 28 of the 36 problems because of limits in the scanner that measured it. So, the pricier run wrote cleaner code and still pass fewer checkpoints. On Hacker News, a developer called Bachland

7:55 asked how much of a score around 15% is just noise and whether Medium's extra code would start costing it on problems twice as long, which is still unmeasured. A dev community analysis

8:05 argues the 28 against 25 gap can't be statistically significant because one failure cascades into the checkpoints after it. Going further, an independent noise analysis estimates that only about

8:16 10 of the 196 checkpoints are in play, the ones whose result could plausibly flip between runs and that roughly half of all strict passes come from checkpoint one. Telling a three

8:26 checkpoint effort difference apart would take 2 to 11 runs per setting at up to about $9,000. That makes it the rare benchmark argument that's cheaper to keep having than to settle. For now,

8:38 effort behaves like a spending dial with an uncertain return in these tests. So, the lever left to check is what you tell the agent. Prompts are the third fix, and the paper tested that one directly.

8:48 An anti-slot prompt that lists patterns to avoid and a plan first prompt that makes the agent write a plan before coding both ran against the same growing problems. The anti-slot prompt did

8:59 produce cleaner first drafts, cutting initial verbosity by roughly 28 to 36% and for GPT 5.5, initial erosion by nearly 58%. Neither prompt slowed the decay after that. Both added about 12%

9:14 to the cost per checkpoint, and correctness slipped 2.3 points. >> A better prompt buys you a cleaner starting point. But what separates agent repos from human ones is how fast they

9:24 decay. And no prompt in these tests change the rate of decay. You're left with the question from the start where the rot comes from when a newer model, more effort, and a cleaner prompt don't

9:34 stop it. A table in the October update holds the answer, counting every failed test case at each problem's final checkpoint. Opus 5.5 at Medium failed 258 test cases there, and 256 of them

9:48 were regressions. Call it nearly 9 and 10. Most of what's broken at the end is behavior that used to work. GPT6 Astra at extra high, the one model that gained from extra effort, has the same shape of

10:01 its 1,435 failures, 1,178 were regressions, and just three of its final checkpoints strictly pass. New features are usually the part that

10:11 works, and older features are where the damage piles up. Put that beside the patching numbers, and the mechanism closes up. Late in a run, the agent changes under a third of its code,

10:20 copies logic instead of restructuring, and packs complexity into a few huge functions. Failures collect in the old behavior all those patches have to work around. So in these tests, turning

10:30 effort up did little because the rot grows patch on patch and shows up as broken old behavior. Fixes follow from that with one limit said upfront because the only ones the benchmark measured

10:41 were those two prompts. Everything from here is reasoned advice that fits the mechanism and wasn't tested inside slop code bench. Human layer ran into this on its own product. Agents ran its codebase

10:52 until it reached 30 to 40,000 lines including a state machine spread across four Unix processes and eventually the company archived the whole thing. Dex Hortiz summary was if you let the agents

11:04 take the wheel, this is what happens. where the failures land points to the first fix. Make the agent run the full test suite, old test included, before it calls a task done. A dev community

11:14 analysis pairs that with defaulting to medium and raising effort only as a retry. Of everything in this video, the cheapest fix is a test command your repo probably already has. Keeping people on

11:25 design decisions is the second fix, and it follows from the patching. Human layers research, plan, and implement workflow puts people on reviewing the research and the plan rather than the

11:35 code. Its reasoning is that a bad line of a plan could lead to hundreds of bad lines of code. And one case it reports is BAML, a 300,000line Rust codebase. On Reddit, a March thread titled, "How to

11:47 not create goop code," got the same answer from its top reply, which said to spend more time planning and never trust AI with design. Given how agents patch instead of restructuring, that advice

11:58 fits what the benchmark measured. Readers of the paper also suggest fresh context sub aents, hooks that check complexity and copied code between iterations, and an agents.md file that

12:08 keeps design decisions in the repo. None of them was evaluated as the write up proposing them says itself. For a developer running claude code or codecs on a live repo, the better pick is

12:19 medium effort by default and the full test suite run before any task counts as done. Also, add a person who signs off on the plan before the agent writes code. Save maximum effort for retries

12:29 and expect an anti-slot prompt to improve the first draft and nothing after it. Two limits come attached since every effort result here is a single run and GPT6 Astra did better at extra high.

12:40 The opening gap 145 steps right and 28 still working is the number to watch in your own repo. And in these runs, the old tests are where it opened. When your agent's code starts to rot, which shows

12:52 up first for you, broken old features or new code growing sideways.

Frontier News · by Hyperjump Technology