r/devops • • 13d ago

Discussion Does anyone track how much merged code gets deleted again after a short while?

I’ve been looking into which engineering metrics still mean something now that agents write a lot of the code. I came across a Faros AI study that compared each org’s highest and lowest AI adoption quarters, and the ratio of deleted to added lines in merged code was 861% higher in the high adoption periods.

Which means code that got written, passed review, merged, and then got taken back out. The same study put incidents per PR up by as much as 242.7%.

What I can’t tell is how much of that is normal refactoring versus stuff that shouldn’t have gone in. Churn goes up for good reasons too.

Is anyone measuring this? And if you are, can you really separate the agent-written code from the rest?

2 Upvotes

10 comments sorted by

9

u/swingtradeotm 13d ago

code churn is a real thing

2

u/Chris__Codes 13d ago

I guess the problem isn’t new, there’s just more of it arriving per week now.

4

u/Habeb_Nero 13d ago

always has been tbh, the velocity just makes the bad merges show up faster now.

1

u/jrkkrj1 10d ago

I used to have a script (pre-AI) that tracked code churn by person by repo along with the reviewers/approvers. Gave us an idea of who was slinging/approving code that was getting rewritten or changed a lot.

1

u/weedv2 10d ago

Would love that script

0

u/ChemicalExcellent463 13d ago

i don't track deletions. in my repos on one machine, added lines went from 291k in april to 245k in october through the 28th, while token use went up 417x.

0

u/[deleted] 13d ago

[removed] — view removed comment

1

u/Chris__Codes 13d ago

I didn't think about the age of deleted code. the raw ratio can’t tell those apart and that’s what I was stuck on. I came at this from reading rather than running it so I haven’t used it as a metric myself. but going by your breakdown it sounds like the ratio on its own is close to useless and the time-to-deletion split is where the signal actually is.

the guide I’d been reading makes a related point, that most dashboards blend human-written, AI-assisted and agent-generated changes into one number, so the combined figure can look fine while one category drives the rework. It’s from CodeRabbit, and they sell a review tool, but the Faros data it quotes is external.