Measurement · AI involvement

How much of your code is AI-written? An honest answer

Everyone wants one number. Here is what can actually be measured, what can't, and how to get evidence you can defend instead of a percentage you can't.

August 2026 · methods documented in the detection paper and the REP_CHURN paper

Why the one-number answer doesn't exist

Real code is a mixture. Humans edit model output; models refine human code; the same file passes through both in a week. Detection research has had to invent a third class — "machine-refined" — because purely-AI and purely-human files are the rare cases. Per-file AI detectors exist, but their strongest signals are surface features (comment style, formatting) that vanish under trivial edits, and their accuracy decays as models change. A percentage built on them is a guess wearing decimals.

What you can measure — three honest layers

1. The attribution floor. AI coding agents can leave machine-readable co-authorship trailers in commit history. Scanning for them gives a hard floor, not a total — attribution is voluntary and strippable. Measured on public history, floors range from 0.02% of commits on a hand-maintained framework to 65.9% on an intensively agent-built application.

2. The shape of the change. AI-assisted development replaces code rather than editing it, and that shows up in plain diff arithmetic. Established hand-maintained projects edit about one changed statement in six in place; a measured agent-built codebase edited one in five hundred. It is a process signature, not a verdict — young fast-growing projects also score low — but it needs no ML and reproduces from your own git history.

3. Your codebase against its own history. The strongest inference is longitudinal: a repository whose in-place editing share collapses out of its own historical band has changed how it is developed, whoever's name is on the commits. That comparison has no cross-project confounds at all.

Getting the evidence

CodeDelta measures all three layers in one pass — commit-trailer attribution, statement-level churn shape, and baselines against your own history — from a CLI, a GitHub Action, or a scheduled scan, entirely inside your own infrastructure. Every number reproduces from two commit hashes. Run it on one repository, or read the measurements across nine public codebases first — commit hashes included, so you can check the arithmetic yourself.