Code Got Cheap. Maintenance Didn't: Patterns That Keep Agent-Written Systems Alive
Coding agents made writing code almost free. Maintaining it did not.
At Maersk, Dmitry Buykin works on a production system that spans 110 countries and roughly 10,000 scenarios. He estimates three-quarters of it is prose instructions rather than conventional code. After agents began writing most of the changes, he learned the hard way that generation is no longer the constraint. Verification, attention, and entropy control are.
His first attempt to regain control was radical. He deleted unused tests and boilerplate and rewrote the project (he calls it the Thanos moment). Useful pieces disappeared with the mess. Then the agents kept writing, and the sprawl grew back. The practical limit was how much change a human could still check. Once volume crossed that line, even a cleanup required judging, in one pass, everything that deserved to survive.
The shift was from occasional mass rewrites to continuous small sweeps. Weekly pruning, evidence-backed decisions, and rules that keep changes small enough to explain in one sentence.
Prose is engineering material
When most of the “code” is instructions an agent will follow, those instructions need the same discipline as source code. Buykin’s team built a prose linter. Authors lint changed files and record the result in a ledger. They also borrowed mutation testing: deliberately break a sentence and watch whether any test turns red. Almost none did. Passing tests gave little signal about which meaning a rewrite had to preserve.
They keep one document that serves both readers. Agents get precisely specified blocks. Experts get the surrounding explanation and sign off. When a task fails, the expert reviews it with the exact information the production agent saw. That note becomes the next change and a regression case.
Repeated paths through the prose are promoted to tools only after they recur and agree across countries. Paths that still vary stay in prose so the person who owns the rule can still read and correct it. When a procedure becomes a tool, the step-by-step prose is removed; otherwise agents run the work twice.
Control what the model sees and what it can write
Given a choice of what to load, the model loaded everything, saw prices, and invented a pricing check nobody had asked for. The team moved context selection into the runtime. For a specific decision the runtime supplies only the three facts needed and keeps the full record itself. For larger sets the model receives a short handle; the runtime validates it before any write.
Only code can open the write path. There are multiple checks before a write and a journal so an action takes effect only once. That lets the team revise the prose many times a day without opening new attack surface.
Evidence over vibes, and attention as a scarce resource
Checking consumed almost nine-tenths of the agent’s time on a change and a growing share of Buykin’s own week. The strongest evidence is replaying real historical tasks. Before looking at results they write down what would prove their expectation wrong, and they deliberately make each new check fail once so they know it can detect the failure it is meant to catch.
Attention is rationed. Before building a proposed check they replay it over thousands of past sessions. If it would have fired on less than 1%, that is a signal about reach. An expert’s correction becomes an eval; an agent then searches sibling slices (one process in one country) for the same failure. The search can be broad; the edit stays narrow because local differences are often intentional.
When Buykin could no longer explain what had changed, he treated that as the signal to stop and fix the review process. The dashboard can stay green while human understanding collapses.
Precision-first review when models write trustworthy code
At Block, Joah Gerstenberg saw the same shift from the other side. Once coding models improved enough that engineers trusted the code they produced, verification became the new rate limit. Reviewers are now handling about three times as many lines as a year ago. Early AI reviewers were so noisy that people deleted the comments. False positives cost the reviewer its audience.
Block rebuilt around precision over recall. Three specialist reviewers examine a change through different lenses (behavior & contracts, reliability & operations, security & trust boundaries). A coordinator merges duplicates and tries to disprove findings. A judge rechecks what was dropped. The result on ReviewBench was high grounded precision. Risk-based tiering routes routine changes to lighter review and high-stakes changes (money movement, PII, public claims, SOX) to deeper human attention. Planning tools bring review in before the code is written so alignment happens earlier.
Practical patterns worth stealing
- Treat every agent change as a future maintenance cost. Accept it only when it is small enough to explain in one sentence.
- Slice work (by country, process, or bounded context) so corrections stay local unless the same failure is confirmed elsewhere.
- Move repeated, agreed paths into tools and delete the step-by-step prose so agents do not re-execute them.
- Give the model only the facts it needs for the current decision. Let the runtime hold the rest and open write paths.
- Prefer replay on real tasks and evidence ledgers over “it looks fine.” Make new checks fail on purpose once.
- Run a weekly prune or ratchet that only allows certain counts (legacy branches, unused conditions, noisy rules) to go down.
- Build AI reviewers that stay quiet when they have nothing worth saying. Precision protects human attention; multiple specialist lenses plus a skeptical coordinator improves coverage without drowning people in noise.
- Keep two kinds of memory for the next agent session: what happened (history) and what is true now (current account), linked by evidence to root causes.
The teams that win are not the ones whose agents write the most code. They are the ones that can still prove what the agents actually did, keep the entropy from compounding, and direct scarce human judgment to the places where local laws, money, or irreversible actions are involved.
Sources
- Dmitry Buykin (Maersk), Agents Made Code Free. Maintaining It Didn't Get Cheaper. — AI Engineer talk / ai.engineer summary
- Joah Gerstenberg (Block), Cut The Noise: Building a Code Reviewer You Can Trust — YouTube / slides & notes
- Related: Laurie Voss on stopping vibe-testing and running real agent evals (Agentic AI Foundation / AI Engineer talks)
Hacker News has been circulating related threads on agent plans, internal tools, and the gap between “agent finished” and production-ready. The concrete production practices above are still under-discussed relative to the volume of new agent demos.