Abenhaim: AI Agent Refactors 189 Files in 717k-Line TypeScript App
TL;DR
- A new arXiv case study documents an AI coding agent modifying 189 files in a 717,725-line TypeScript codebase in three days for $2,430.
- Author Joel Abenhaim reports 201 defects were corrected across 31 audit passes before any human executed the program.
- The refactor removed a lifetime invariant so a streaming AI generation can survive its UI panel closing and reattach on reopen.
A single-author case study on arXiv is making the rounds among engineering leads because of one number: an AI coding agent handled a core architectural change to a 717,725-line TypeScript codebase over three days for $2,430, with no human reviewing its code before it ran. The paper, by Joel Abenhaim, documents a specification-first protocol in which the agent iterated on a written spec through 14 refinement cycles, then produced the implementation through 17 verification cycles, converging only when two consecutive verification passes returned zero findings.
The refactor itself was substantive rather than cosmetic. Abenhaim reports 189 files touched, 31 of them new, with 34,770 insertions and 16,422 deletions landing in two commits. The task was dismantling a lifetime invariant that had assumed a UI panel would stay open for the full duration of an AI request; the new behaviour lets a streaming generation survive the panel closing and reattach to the same live stream on reopen. Across 31 audit passes, Abenhaim writes, 201 defects were corrected before any human executed the program, and the finished software behaved as specified across the initial run and roughly thirty sessions after.
Read carefully, this is one engineer's tightly instrumented log of one refactor, not a benchmark and not a replication study. The abstract does not name the specific coding agent or underlying model used, does not quantify the hours the author spent writing and iterating the specification the agent converged against, and offers no third-party access to the codebase for outside verification. 'No bug observed' means none found by the agent's own audit loop and none seen by the author across his own sessions, a much narrower claim than a codebase-wide correctness proof.
Even with those caveats, the artifact is the interesting part. For teams sitting on large TypeScript monorepos they cannot justify hand-refactoring, the write-up is a concrete price and cadence reference point rather than a vendor pitch, and the audit-and-verification loop is documented in enough detail for another team to try without buying into any particular agent product.
Originally reported by paper
Read the original article →Original headline: AI Agent Self-Corrects 201 Bugs Across 189 Files in 717k-Line Codebase—Zero Human Review, $2,430 Total Cost