Articles

Recommended · Talk · GOTO Copenhagen · Adam Tornhill · 2026

AI-Friendly Code: The Missing Link for Speed with Quality

Agents work far more reliably on healthy code than on grown legacy. Code quality decides whether AI speed lasts or fades after a few months.

Go to source ↗gotocph.com ·

In short The bottleneck isn’t the model - it’s the code it meets.

What it is about

Adam Tornhill, founder of CodeScene, looks at something many teams know: the first weeks with AI agents are fast, but a few months later the advantage is gone. Complexity grows and more defects reach production. His thesis: agents stumble over the same patterns as humans - deeply nested logic, god classes, swallowed exceptions, missing modularity.

The basis is an in-house study. Several language models refactored thousands of small Python programs, and tests checked whether everything still worked afterwards. On healthy code, changes broke noticeably less often. For mid-sized models, the risk of breakage was roughly 15-30% lower, depending on the model.

What caught our attention

Code quality becomes a prerequisite for AI, not a nice-to-have. According to the talk, the average codebase sits far below the level at which agents work reliably. Grown legacy is the real bottleneck for agents in the enterprise.

An agent alone barely cleans up. In CodeScene’s measurement, a current coding agent working unaided fixed only about one in five code smells. With an objective quality signal as feedback, it fixed nearly all of them. The pattern convinces us: measure deterministically, let the agent restructure in a targeted way, measure again.

Merge conflicts are a team issue. When several agents work on the same god class in parallel, they collide. The fix lies in how responsibilities are cut, not in the model.

How we read it

The numbers come almost entirely from CodeScene’s own research, and Code Health is their own metric. The underlying study is a preprint and covers only Python, using short competitive-programming programs rather than production code. For the strongest models, the difference was no longer statistically significant. The slides and the press release show partly higher figures than the paper. We still find the direction plausible: it matches the large-scale study of AI code in public repositories and our own experience.

What we take from it

Before agents speed up work in an existing system, it pays to check the code health of the areas they will work on. Where needed, clean up first in a targeted way, backed by tests. Quality checks belong in the agent pipeline as a fixed gate, not at the end. That is how we work in AI-assisted modernisation and how our practice experiment on bug fixing with agents ran. More on the frame in From the artefact to the tool.

Further reading: Preprint “Code for Machines, Not Just Humans” (arXiv) · Video and slides are on the talk page (link above).

Part of the SII Germany team

Let’s
talk.