HackerPapers

arXiv:2601.02200cs.SE

Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics

Markus Borg, Nadim Hagatulah, Adam Tornhill, Emma Söderberg

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

We are entering a hybrid era in which human developers and AI coding agents work in the same codebases. While industry practice has long optimized code for human comprehension, it is increasingly important to ensure that LLMs with different capabilities can edit code reliably. In this study, we investigate the concept of ``AI-friendly code'' via LLM-based refactoring on a dataset of 5,000 Python files from competitive programming. We find a meaningful association between CodeHealth, a quality metric calibrated for human comprehension, and semantic preservation after AI refactoring. Our findings confirm that human-friendly code is also more compatible with AI tooling. These results suggest that organizations can use CodeHealth to guide where AI interventions are lower risk and where additional human oversight is warranted. Investing in maintainability not only helps humans; it also prepares for large-scale AI adoption.

arXiv comments
Accepted for the 3rd ACM International Conference on AI Foundation Models and Software Engineering (FORGE 2026)
Journal reference
DOI
Subjects
cs.SESoftware Engineering cs.AIArtificial Intelligence

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Jul 2026 to Jul 2026.

Comments linking this paper, per year.

Discussed in comments1 thread

    • > is there any proof that slop matters beyond our sensibilities as developers? I've seen a few papers recently on the topic in terms of LLM, here is two I found by quick googling * "Does Code Cleanliness Affect Coding Agents? A Controlled Minimal-Pair Study"…

      paffdragonView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.