How we think

The Stabilization Pass

Every stretch of AI velocity accrues invisible debt; the cleanup cycle isn't overhead, it's where patterns get codified

The 12 hours nobody scheduled

On a client engagement - a small B2B SaaS engineering team we advised - the team was running AI-augmented development at a sustained 3,000–4,000 absolute lines of code per day. Roughly 48,000 absolute lines in 15 days. After about a week of that pace, the team stopped shipping features and spent 12 hours doing nothing but cleanup: refactoring, consolidating duplicated components, untangling abstractions that had drifted apart.

The natural way to book those 12 hours is as a tax. The cost of moving fast. A line item to minimize.

That's the wrong ledger. The 12-hour pass turned out to be the most durable thing the team produced that week - not because of the code it fixed, but because of what it codified. This piece is about why that debt accumulates invisibly, why the math of it is worse than it feels, and why the stabilization pass is the mechanism that makes AI-augmented velocity sustainable instead of self-defeating.

Debt that is invisible per diff

Here is the uncomfortable property of AI-generated code that passes review: it is almost right.

Every diff the team shipped during the fast week had been reviewed by an engineer. Nothing was rubber-stamped. And honestly assessed, each cycle landed at roughly 90% clean. The remaining 10% was never a bug. It was a component that duplicated a pattern that already existed two directories away. A naming convention applied slightly differently than last time. An abstraction drawn at the wrong altitude - workable, but one notch off.

None of that fails a code review. None of it breaks a test. Per diff, it is invisible.

The problem is that it is additive. The next feature doesn't land on a clean foundation - it lands on the slightly-wrong shape the last feature left behind, and it conforms to that shape. The AI is especially diligent about this: it reads the surrounding code and faithfully extends whatever patterns it finds, including the drifted ones. Slightly wrong becomes the local convention, and the convention propagates.

0.9 to the tenth

If each cycle is 90% clean, ten cycles of building on top of each other do not leave you at 90%. They compound:

0.910 ≈ 35%

A team that would never accept a 35%-quality codebase will absolutely accept ten consecutive 90% diffs - because each individual diff looks fine. The degradation never presents itself as a decision. There is no moment where anyone chose to let quality fall by two-thirds. It is the silent product of cycles that were each, individually, good enough.

40%60%80%100%0246810CycleEffective foundation qualitywhat each diff looks like in review≈ 35%
90% clean per cycle, compounded
The compounding cost of 90% clean: ten cycles that each pass review compound down to roughly 35% - what the codebase actually feels like.

At pre-AI throughput, this compounding was slow enough that quarterly refactoring absorbed it. A developer producing 150 lines a day takes weeks to lay down enough cycles for the curve to bite. At 3,000–4,000 absolute lines a day, the same number of compounding cycles happens in days. The math didn't change. The clock speed did.

That is exactly what the client team experienced: after roughly a week at full velocity, the codebase started resisting. Features that should have been trivial required touching more files than they should have. The team felt the curve before they could name it.

What the cleanup actually produced

The 12-hour pass had two outputs, and the second one mattered more than the first.

The first output was the obvious one: fixed code. Duplications collapsed, abstractions corrected, conventions re-aligned.

The second output came from a deliberate discipline during the pass: every time the engineers fixed a recurring mistake, they reverse-engineered it into a written standard. Not "fix it and move on" - fix it, then ask why did the AI keep producing this? and write down the rule that would have prevented it. By the end of the pass, the team had a frontend patterns document: component structure, state conventions, naming, where shared logic lives, what gets extracted and what doesn't.

Then the critical step: that document was fed into the persistent context that the AI coding tool reads at the start of every session. The standards stopped being tribal knowledge and became standing instructions.

The effect was immediate and measurable in the only way that matters: whole categories of mistakes stopped recurring. The AI that had been faithfully propagating drift was now faithfully propagating the codified standard instead. Same diligence, pointed in the right direction.

A stabilization pass that only fixes code has bought you a clean foundation that will erode at exactly the same rate as before. A stabilization pass that codifies patterns into persistent AI context has lowered the erosion rate itself.

The virtuous loop

Run that mechanism repeatedly and you get a loop:

Code fastAccumulateinvisible debtStabilizationpassExtract recurringmistakes into patternsCodify intopersistent AI context
Back to code fast - with fewer mistakes. Each revolution starts cleaner than the last.

Code fast. Accumulate debt. Stop and stabilize. Extract every recurring mistake into a pattern. Codify the patterns into the AI's persistent context. Code fast again - and the per-cycle quality is now higher than 90%, because the mistakes that used to recur are pre-empted by standing rules.

Each revolution of the loop makes the next one cheaper. The first stabilization pass on the client engagement took 12 hours because it was paying down a week of unguided drift and writing the standards from scratch. Subsequent passes get shorter, because the standards already exist and each pass only has to capture the new failure modes that emerged since the last one.

The compounding works in both directions. Unmanaged, 90% per cycle compounds down to 35%. Managed - with each pass raising the per-cycle baseline - the same compounding mechanics work for you.

Why organizations don't see the gains

This is, we'd argue, a significant part of an industry-level puzzle. DORA's research on AI-assisted development found individual developer output going up while organizational delivery stayed flat. Engineers report being faster; the organization doesn't ship faster.

The debt mechanism explains a real share of that gap. AI velocity creates cleanup debt at a proportional rate. If a team doesn't budget explicit hygiene cycles, the debt doesn't disappear - it gets paid anyway, in less legible currency: features that take longer than they should, defects that take longer to trace, onboarding that gets harder, refactors that nobody scheduled but everybody performs in fragments. Individual output up, organizational throughput flat. Net break-even, with worse morale.

Capturing AI's velocity gains at the organizational level means treating stabilization as a scheduled, first-class activity - the same way deployment windows and sprint ceremonies are scheduled.

The every-10K-lines rule

The practical framework that came out of the engagement data: every 10,000 absolute lines of AI-augmented code, run a dedicated stabilization pass. No new features.

The specifics matter:

  • Count absolute lines, not net. Absolute (adds plus removes) measures how much code the AI touched - which is what generates drift. Net measures growth, which is irrelevant here. A heavy refactoring PR with low net still accrued review debt.
  • No features during the pass. A pass that allows "just one small feature" is not a pass. The discipline is the point - debt paydown and feature work pull the AI in opposite directions, and mixing them produces neither.
  • The deliverable is the patterns document, not just the diff. If the pass ends without new or updated codified standards, it treated symptoms. Ask of every fix: was this a one-off, or the third time? Third-timers become rules.
  • The rules go into persistent AI context immediately. A patterns document that lives in a wiki the AI never reads is documentation. The same document in the AI's standing context is prevention.

At the client team's pace, 10,000 absolute lines meant a pass every two to three working days. That sounds aggressive until you run the comparison: the team waited roughly twice that interval and paid 12 hours. Debt compounds; the longer the interval, the more each pass costs, and the curve is not linear. Frequent shallow passes are cheaper than rare deep ones.

The 10K figure is a starting point, not a constant. It is a function of how much of each cycle is AI-written: the higher the AI share per cycle, the thinner the human correction layer, and the faster the 0.9 erodes toward 0.85 - which compounds dramatically faster. Teams running heavier AI autonomy should shorten the interval; teams keeping humans deep in every diff can stretch it. Where to set that dial is its own framework - we call it AI Code Nines - but the operating rule stands on its own: pick a trigger denominated in absolute lines, schedule the pass before the codebase starts resisting, and make codified patterns the deliverable.

The stabilization pass is not the overhead of AI-augmented development - it is where each cycle's lessons get banked into the next, and it is what separates individual output going up from organizational delivery going up with it.

Also read

A Working AGENTS.md, AnnotatedContext Modeling
See AI Dev Team EnablementLet's Talk

Don't take our word for it - ask ChatGPT what it thinks of this piece.