Sonar hat dies direkt geteilt
AI agents struggle with messy code. 🧠 Just like we do. Poorly written code is cognitively expensive for humans — deep nesting, god methods, cryptic names, your brain keeps re-reading the same lines, trying to hold too much at once. Turns out, AI coding agents have the exact same problem. https://lnkd.in/dMUtFdqm A study just published by Olivier Schmitt and Priyansh Trivedi at Sonar ran 660 trials of Claude Code across carefully controlled repository pairs: same architecture, same behavior, same tests. The only variable? Code cleanliness. The result? Clean code didn't change whether the agent solved the task. But it radically changed how it worked: → 7–8% fewer tokens consumed → 34% fewer file revisitations That last number is the telling one. File revisitation is what happens when the agent edits a file, moves on, then comes back — a behavioral signature of uncertainty. The same loop a developer falls into when the code doesn't make its intent and structure clear. We have spent years at Sonar working hard and arguing that maintainability principles aren't just about developer experience — they're about correctness, reliability, and ultimately cost of software. This study adds a new dimension: clean code is now (also) directly an AI efficiency lever. The tools changed. The problem didn't. And we are more committed than ever to solve it at Sonar!