Carlos Tapia
← All notes

86% of my agents' code is still there, and most of the drop came from one week

· 3 min read

Checking whether agent code is any good is slow. A cheap proxy is how much of it is still there later. Line survival with git blame is a known way to measure churn in any codebase; here I applied it to a production repository where the code is written by agents, mine and those of a team that works on its own.

Survival is the share of lines added since a start date (the window) that are still at HEAD. The rest is churn. The window starts on 26 August 2026, and only code files count.

RunCommitsLines addedStill aliveSurvival
7 Sept18325,06823,23192.7%
9 Sept23533,08328,43185.9%

TABLE 1 · Same repository, same window start, two days apart.

Survival against volume, by week

Bars are lines added. The marker is what share of them is still at HEAD.

Lines added Still alive
Week of 24 Aug — 4,933 · 95% Week of 24 Aug 4,933 95% Week of 31 Aug — 22,725 · 82% Week of 31 Aug 22,725 82% Week of 7 Sept — 5,425 · 95% Week of 7 Sept 5,425 95%

FIG. 1 · The heavy week is the low-survival week, with a light 95% week on either side of it. A single observation.

Part of that drop is age: the second run measures the same lines two days older, and a deleted line never comes back. With two runs I cannot say how much. By week:

Week ofLines addedStill aliveSurvival
24 Aug4,9334,70395%
31 Aug22,72518,58682%
7 Sept5,4255,14295%

TABLE 2 · 9 Sept run. On 7 Sept the week of 31 Aug was still at 92%.

The week with four times the volume has the worst survival. Between the two runs, 2,815 more lines were rewritten or deleted, and 2,504 of them come from that week.

The worst commit

Most of those 2,504 lines are a single commit: it added 2,408 lines and none are still there. It bundled several large changes at once (multi-tenant support, an integration with an external system and security hardening). The commit log, the tests and code review did not flag it. I only saw it by measuring survival, after the fact. In the average it disappears.

How this was measured. Line-level survival over a single production repository: every line of code added by a commit in the window, checked with git blame at HEAD to see whether it is still there. Code files only. 235 commits, 331 files. The window starts on 2026-08-26. Two runs, 2026-09-07 and 2026-09-09, over the same window start.

Related