Romanela Polutak

Does state of your code determine an AI agent's performance?

Recently our team concluded in our peer-reviewed research that that code health determines AI-performance. The study "Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics" concluded that when agents operate on unhealthy code, the defect risk increases by 60% (at least).

It’s was a large-scale study of 5,000 real programs using six different LLMs to refactor code while keeping all tests

passing.

Agents will amplify the good or bad in the codebase, and the risk of increased technical debt is really, really high. But the positive side is that as stated... "Code Health acts as a protective buffer. Healthy code reduces error-generation risk and gives AI the structural clarity it needs to act more predictably.

Machines get confused by the same patterns as humans. The evidence is clear: unhealthy code undermines AI-assisted development, increasing breakage rates and reducing the benefits of automation. Organizations that want safe, reliable, and effective AI-assisted development must invest in Code Health as a foundational capability. Without it, AI will not accelerate delivery; it will accelerate defects and developer frustration.

What's your take on it?

21 views

Add a comment

Replies

Best
Stan Kolotinskiy

In some cases, the ability of a LLM to write "bad" code (bad as in consistent with the existing codebase) is probably good IMV, especially when the codebase is big, because it's not fun to have to read through several different patterns and approaches to solving conceptually similar tasks in different parts of the product.