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

Markus Borg, Nadim Hagatulah, Adam Tornhill, Emma Söderberg
1/5/2026
cs.SEcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 1 weaker match is hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{borg2026code,
  title  = {Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics},
  author = {Markus Borg and Nadim Hagatulah and Adam Tornhill and Emma Söderberg},
  year   = {2026},
  eprint = {2601.02200},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.02200v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.02200.svg)](https://codeofpaper.com/paper/2601.02200)

Discussion