Coding agents refactored a 300,000-line C codebase in three weeks for roughly $4,000 in tokens, according to a CodeScene case study. The work generated 2,903 commits across 726 files, changed 252,055 lines and moved CodeScene’s Code Health score from 5.6 to 10.0.
The target was an open-source decompilation of Street Fighter III: 3rd Strike. Agents received a deterministic quality score and a replay harness that compared the game’s state hash frame by frame after changes. They also built a playbook of 22 refactoring recipes and 82 notes, including failed approaches. The team used Claude Opus for most work and merged changes to a fork through 54 pull requests.
Those conditions also limit the claim. A game with repeatable frame traces offers a powerful correctness oracle that many production legacy systems lack. Practitioners questioned whether the health metric captured architecture, performance, memory use or subtle timing regressions, and whether results measured the model or the surrounding harness.
The measured outcome is the completed refactor, its cost and duration. Projected reductions in defects and token waste come from earlier CodeScene research, not this experiment. A planned Lund University study will compare feature work on the original and refactored versions to test whether the cleaner score produces practical development gains.