Striff Engineering Data & research
What a broken architecture rule costs, and when you pay for it
In a NeurIPS 2026 benchmark, 15 coding agents kept extending their own code, and its structure eroded in 77% of runs. Architecture exists to keep the next change cheap, for agents and people alike. A broken rule costs one line in the pull request that broke it, and a refactor once enough has been built on top.
On this page
Give Anthropic’s Opus 4.7 a small command-line tool to build. It parses its flags with Python’s standard argparse, and its main() function is 38 lines long. Then ask for a new feature, and another, eight rounds in all, each building on the code the agent wrote the round before.
By the eighth round, main() is 240 lines. The argparse call is gone, replaced by a hand-written loop in which seven flags each get an identical pair of branches, one for --flag value and one for --flag=value. No helper was ever extracted.
That run comes from SlopCodeBench, a benchmark from the University of Wisconsin–Madison, MIT and Washington State University, accepted to NeurIPS 2026. It gave 15 of today’s coding agents, including Opus 4.7 and GPT 5.3 Codex, 36 problems to extend checkpoint by checkpoint. Opus 4.7 was not unusual:
15 coding agents, extending their own code
Source: Orlanski et al., SlopCodeBench, arXiv 2603.24755 (v2, May 2026). Erosion also rose in 53% of the human repositories over their git histories, so people are not immune; agents erode more, and faster.
One more result from the same paper matters for everything below. The authors tried telling the agents to write clean code. It made the first version cleaner, by up to a third, and did nothing to slow the decline. An instruction shaped where the agents started, and had no effect on where they ended up.
Pass rates tell you whether each change worked. Erosion tells you what the next change will cost. Keeping that cost down is what architecture is for, and this post is about what happens when it slips.
Architecture is for the next change, whoever makes it
A common argument goes like this: layering, boundaries and module rules were written so that people could read the code, agents can read anything, so the rules matter less now.
Engineers who build with agents every day disagree, and they all land on the same reason. Steve Smith, who maintains some of the most-used Clean Architecture templates for .NET, put it this way in June 2026:
“The argument that ‘architecture is just for humans’ assumes that AI agents can hold arbitrarily large contexts perfectly and act on them without cost or error. Neither is true today.”
A well-bounded module, he goes on, “lets the agent focus on a small, coherent slice of the codebase. The blast radius of any given change is smaller. The context required is smaller. The bill for your AI usage is smaller.”
Oren Eini, the founder of RavenDB, reached the same place in January:
“Maintainability in the age of coding agents looks remarkably like it did before. The essential requirements remain: clear boundaries, a consistent architecture, and the ability to go into a piece of code and understand exactly what it’s doing.”
There is early measurement too. A SonarSource study ran Claude Code 660 times on pairs of repositories matched on architecture, dependencies and behaviour that differed only in code quality. Cleanliness didn’t change the pass rate, but on the cleaner code the agent used 7 to 8% fewer tokens and revisited files 34% less often (Trivedi and Schmitt, arXiv 2605.20049). SonarSource sells code-quality tools and the study is small, so treat it as a first data point.
Put plainly, readability was always a means to an end. The goal is to keep the cost of the next change low: how much of the system it has to touch, and how sure you can be that it’s correct. Whoever makes the change pays that cost, a person or an agent. Following the architecture saves both of them time, and breaking it adds to the bill for everyone who comes after.
The rules teams write down
Teams that build with agents write their architecture into the files their agents read: AGENTS.md, CLAUDE.md, Copilot instructions. Most of it comes as short sentences like these:
Six rules from real agent files, and what each one protects
| The rule, quoted | What breaking it costs |
|---|---|
stlite, CLAUDE.md: "Never import streamlit.web in stlite-lib (Tornado can't run on Pyodide)." | The product. Stlite runs Streamlit in the browser, and one import takes that away. |
copperhead, AGENTS.md: "check/verify remains deterministic, LLM-free, and network-free. Its module graph must not import a provider or model SDK." | Trust. A check that might call a model can give a different answer tomorrow. |
movar, apps/diagnostics/AGENTS.md: "Observability ships separately and never in the published @movar/extension, even off-by-default." | What reaches users. The published extension is meant to carry "zero diagnostics surface", switched on or not. |
| sockethub, AGENTS.md: "Server MUST NOT directly import platform code (platforms are child processes via IPC)." | Isolation. The same file says "Platform crashes must not affect other platforms", which only holds while each platform runs in its own process. |
midi-captain-max, firmware/AGENTS.md: "do not import from adafruit_hid.mouse in the hot dispatch path (CP 7.x does a filesystem scan per import call)." | Latency on a device that has to respond to a foot pedal. |
OrthoRoute, copilot-instructions.md: "domain/ importing from infrastructure/ is always a bug." | The ability to test the core without the infrastructure, and to swap the infrastructure later. |
Each rule is quoted from the repository's default branch as of November 2026, linked at that commit. The right-hand column is our reading of the reason the authors give.
Each one records a decision somebody made so that the next person, or agent, wouldn’t have to learn it again. Several carry the reason in the same sentence. The question is what it costs when one of them stops being true, and the answer depends almost entirely on when you find out.
In the pull request, it costs one line
When a change breaks a rule like the ones above, the break is usually a single import, call or dependency. Caught in the pull request that introduced it, the fix is to move that line before the merge. Nobody has built on it yet, and the author still remembers why they wrote it. The break will never be cheaper than this.
Here is what happens when nobody catches it:
One broken rule, from pull request to refactor
The pull request
One import crosses a boundary. The fix is one line, and the author still has the context.
The merges after
The next change that needs the same thing takes the same shortcut, because that is now how the code works.
The docs lie
AGENTS.md still says the rule holds. Every agent that reads it builds on a system that no longer exists.
The refactor
Untangling it is now a planned project, with its own time, risk and review.
The fix at step 1 and the fix at step 4 remove the same dependency. What changes is everything built on it in between.
After the merge, it starts charging interest
Researchers have measured steps 2 to 4 for years, under the name architectural debt.
What architectural debt costs, in four studies
Sources: Ernst et al., FSE 2015; Xiao, Cai, Kazman et al., ICSE 2016; Besker, Martini and Bosch, JSS 2019; Nayebi et al., ICSE-SEIP 2019.
The Carnegie Mellon survey asked engineers in three large organizations where their technical debt came from, and the authors’ conclusion was blunt: “architectural decisions are the most important source of technical debt.”
The open-source study shows how that debt is paid. Files caught up in an architectural flaw keep changing together and keep needing fixes. In each of the seven projects, the top five architectural debts covered 8% to 25% of the error-prone files and accounted for 20% to 61% of the project’s maintenance effort. The authors call that effort interest: you pay it on every change that touches the tangled files, for as long as the flaw is there.
Debt also makes more debt. The Chalmers developers reported that they were “frequently forced to introduce new” debt because of the debt already there. That is step 2 of the diagram, measured.
Brightsquid, a healthcare messaging company, shows what the interest had been costing by what it saved when it stopped paying. After a refactoring aimed at its architectural debt, the average time to resolve a new issue fell by 72%, build time fell by more than 83%, and the number of bugs fixed per month nearly doubled. Those gains came from a planned project, with the time and risk that implies. Stopping a break in the pull request that introduces it costs a line.
These studies have limits. The open-source one infers effort from commit history, the Chalmers figure is self-reported, and Brightsquid is one company. They point the same way, though, and no study we know of finds that architectural breaks get cheaper with age.
Agents bring the expensive part sooner
All of the research above was done on code written by people. Agents change three things, and each makes the bill arrive faster.
Why agents speed up the interest
Sources: Li, Zhang and Hassan, AIDev, 2025; arXiv 2602.11988; SlopCodeBench.
There is far more change. Interest is charged per change that touches the tangled code, so more changes means the debt grows faster.
Agents do what the docs say. That is good news while the docs are true. Once a rule is broken in the code, an agent reads a document describing a system that no longer exists, and builds as if it did.
Agents learn from the code around them. A Tsinghua study looked at why maintainers reject agent pull requests whose code works. Their answer:
Agent code “ignores project-specific conventions, duplicates functionality already provided by internal APIs, and violates implicit architectural constraints accumulated over years of development.” (Learning to Commit, arXiv 2603.26664)
Their fix is to teach the agent from the repository’s own history. A break that has been merged is part of that history, so the code itself becomes the example the next change follows. That last step is our inference rather than something the paper measured, and it matches what happened to Opus 4.7’s main(), where the same pair of branches was repeated for flag after flag.
Put together, a rule broken in a busy repository where agents write the code will have more changes built on it, sooner, while its docs keep telling every agent the rule still holds.
Review doesn’t see it
Reviewers miss these breaks for a structural reason. The rule lives in a document, and the change lives in a diff that doesn’t include that document. A reviewer reading the diff sees a clean import. To spot the break they would have to remember every architectural sentence in the repository and check each one against each change, on teams where agents are opening more pull requests than ever.
We showed one real case in an earlier post: a clean refactor in Ericsson’s ecChronos, approved and merged, that made a sentence in the module’s README false. The sentence was in a file the diff never touched.
Where a broken rule gets caught, and what the fix costs
| Caught | The fix | Who has the context |
|---|---|---|
| In the pull request | Move one line | The author, today |
| A few merges later | Untangle the break and the changes that copied it | Whoever finds it, from git blame |
| When it hurts | A planned refactor | Whoever is assigned the refactor |
Only the first row is cheap, and only a check that runs on every pull request reliably lands there.
Where we stand
- Architecture exists to keep the next change cheap, whoever makes it. Agents didn’t make it optional. Code with clear boundaries is cheaper for an agent to change for the same reasons it is cheaper for a person.
- A written architecture rule is a requirement. If a repository’s docs say the domain never imports the infrastructure, a change that makes it do so has a defect, just as a change that fails a test does.
- The pull request that breaks a rule is the place to catch it. It is the only point where the fix costs one line and the author still has the context. Every merge after that adds interest.
- The check has to sit above whoever wrote the change. People and agents both break rules, and SlopCodeBench shows that telling an agent to be careful doesn’t hold up over many changes. The check should give the same answer for the same change every time.
- If a rule isn’t worth checking, take it out of the doc. Agents will follow it either way. A rule that is written down and never checked is the worst case: agents trust it, and nobody notices when it stops being true.
- When the doc is what’s wrong, that’s worth catching too. Sometimes the code moved on for a good reason. Then the cheap fix is to update the sentence in the same pull request, before the next agent reads it.