CHTree All articles
AI & Productivity

AI Planted a Forest in Your Repo — Bring a Saw

CHTree
AI Planted a Forest in Your Repo — Bring a Saw

Photo: UK Prime Minister, CC BY 2.0, via Wikimedia Commons

AI coding assistants in 2026 are very good at one thing: making more code. Ask for a helper and you get a helper, a test file, a small abstraction, and a config flag. Ask for a service and you get a service, a Dockerfile, a health check, and a README that sounds confident. That is not a moral failure. It is what happens when planting is cheap.

The bill shows up later. Your repo starts to feel like a forest where the canopy has closed. Light stops reaching the files people actually maintain. Search results get noisier, reviews get longer, and the one utility function everyone needs is buried under six generated cousins. AI did not invent technical debt. It invented technical volume, which is debt with better PR.

The canopy problem is a maintenance problem

Generated code is not automatically bad. Some of it is excellent. The issue is that volume changes the economics of ownership. A team can review ten pull requests a week. It cannot review ten pull requests a week plus the twelve generated files hiding inside each one. The result is predictable: reviewers skim, tests get copied rather than understood, and abstractions multiply because adding a wrapper is faster than finding the old one.

You do not fix that with a ban on AI tools. You fix it with thinning. Think of a forester walking a dense stand of trees. They do not hate trees. They remove the ones that are crowding out the good growth. Your codebase needs the same treatment.

Track provenance like you track bugs

You cannot thin what you cannot see. Start by recording which code was AI-assisted. This is not about shaming anyone or scoring teams. It is about knowing where the roots are. Add a lightweight label to pull requests, a commit trailer, or a field in your PR template. Keep it simple: generated, assisted, or handwritten. If your team hates labels, use a bot that flags files above a certain churn threshold and asks the author to confirm provenance.

The point is to create a map. When a generated module starts causing trouble, you want to know whether it was a one-off experiment or part of a larger pattern. You also want to know who asked for it. That leads to the next step.

Every generated cluster needs a gardener

Shared ownership is how code becomes a rental property. Everyone assumes someone else is watching it. AI-generated code makes this worse because it often arrives without a clear human sponsor. The person who prompted it may have moved on, and the reviewer may have approved it as a convenience.

So assign an owner. Not a committee. A person. That owner has the right to delete the code, not just maintain it. Put the owner in CODEOWNERS or your equivalent. If you cannot name the human who will answer for a file at 2 a.m., it is not owned. It is litter with syntax highlighting.

Measure maintenance load, not lines shipped

Lines of code is a terrible scoreboard for AI-assisted work because the tool is optimized for exactly that number. Track maintenance load instead. A useful starter set: number of active alerts per service, dependency count, test runtime, files changed in the last 90 days, and the number of open TODOs older than one quarter. None of these are perfect. Together they tell you which parts of the forest are demanding water.

You can also do a simple cost-of-ownership review for new generated services. Ask three questions. Who owns it? What breaks if it disappears? How much time will it add to on-call? If the answers are vague, the service is not ready to exist.

Put deletion reviews on the calendar

Most teams schedule launches. Almost nobody schedules deletion. That is backwards. A thinning review is a thirty-minute meeting, once a quarter, where you look at generated code that has low activity and ask whether it still earns its spot.

Use blunt heuristics. No caller in 60 days is a candidate. No owner is a candidate. Duplicate helper with a near-identical name is a candidate. A test that asserts implementation details instead of behavior is a candidate. A script that was promoted to a service without a documented consumer is a candidate. Delete the candidate, do not comment it out. Git remembers.

A simple thinning checklist

A healthy AI-assisted codebase should feel like a managed forest, not a hedge maze. You want room to walk, light to reach the understory, and a clear view of what is actually growing. AI can plant. Humans still have to prune. Otherwise you are not shipping software. You are mulching.

All Articles

Related Articles

The Autocomplete Hangover: When AI Speed Leaves Your Debugging Brain Behind

The Autocomplete Hangover: When AI Speed Leaves Your Debugging Brain Behind

The Root Ball Always Wins: A Blunt Guide to Service Migration Decisions

The Root Ball Always Wins: A Blunt Guide to Service Migration Decisions

The Package You're Afraid to Delete Is Steering Your Roadmap

The Package You're Afraid to Delete Is Steering Your Roadmap