0:00
/
Preview

Refactoring Street Fighter With AI đŸ•šī¸ — with Adam Tornhill

Refactoring Podcast â€ĸ Episode 73

Listen now:
YouTube | Apple | Spotify

Today’s episode is brought to you by: Notion

Learn more about Notion’s Developer Platform today at https://ntn.so/refactoring


Today's guest is Adam Tornhill, founder of CodeScene and author of Your Code as a Crime Scene.

With Adam, we talked about how his team refactored the whole Street Fighter 3 codebase, which is more than 300K lines of code, in just a few days and spending a few thousand dollars in tokens, and measured how that led to better and cheaper AI development of new features.

And then we discussed how the CodeScene team does agentic development, what the process looks like, what the bottlenecks are, and what are the crucial parts that Adam believes we still need to do as humans.

Show notes:


đŸĨ‡ Interview Summary

If you are a 🔒 paid subscriber 🔒 you will find my own summary of the interview below.

It’s the 5-minute, handcrafted takeaways of what we talked about, with timestamps to the relevant video moments, for those who don’t have time to sit through the 1-hour chat.

Here is the agenda for today:

  1. đŸ•šī¸ Refactoring Street Fighter with AI agents

  2. 📖 The refactoring playbook

  3. đŸ§Ē Testing, docs, and the new fundamentals

  4. 🤖 CodeScene’s agentic development process

  5. 🔮 Bottlenecks and the future of the developer role

Let’s dive in 👇


1) đŸ•šī¸ Refactoring Street Fighter with AI agents

Adam’s team at CodeScene, in collaboration with researcher Marcus Borg, set out to explore large-scale refactoring using AI agents. They needed a code base that was non-trivial, legacy, and universally understandable, so they picked a decompiled version of Street Fighter 3, a 25-year-old game with 300,000 lines of C code.

When they first analyzed the code base with CodeScene’s own metrics, it scored a 5.4 on a 10-point scale, roughly the industry average for enterprise code and very far from what Adam calls “AI-optimal code” (9.5 or higher). The team had two goals: uplift the code health as much as possible, and preserve the existing behavior of the game.

“I’ve never ever seen anything close to this before. A rewrite at that scale would have been a 12-to-18-month project. And now that can be automated for a fraction of the cost at a fraction of the time.”

Street Fighter turned out to be a particularly good target because the game already had a clever test approach: computing the hash of each rendered frame and comparing them. This gave the agents a reliable way to verify that refactoring didn’t break anything.

The preparation phase took about two weeks (as a side project), with the team exploring different models and patterns. The actual uplift then took just a few days and cost roughly $4,000 in API tokens. They primarily used Claude Code with Opus, because while GPT models were competent at refactoring, they weren’t as good at documenting and extending the playbook.


2) 📖 The refactoring playbook

This post is for paid subscribers