Your Codebase Has a Second Reader Now
Every piece of advice about readable code, use clear names, do not repeat yourself, keep one source of truth, was always aimed at the next human who opens the file. For most of software history that reader was hypothetical and easy to ignore. It is not hypothetical anymore. A second reader shows up on every task now, it is faster and more literal than any teammate, and it exposes exactly how much of that advice you were quietly skipping.
The reader was always the point
Code is read far more often than it is written. That line is old enough to be a cliche, and we treated it like one. We knew clean names and consistent structure helped the next person, but the next person was often future us, months away, so the incentive to do it now was weak. Style guides existed and got ignored. Dead code accumulated. Two helpers did the same thing because writing a third was faster than finding the first.
The agent removes the excuse. It reads the code to decide what to write, and it reads a lot of it, on every task, immediately. All the readability advice we filed under nice-to-have turns out to have been load-bearing. We just never had a reader impatient and thorough enough to bill us for the mess.
Agents imitate what they read
Here is the mechanism that makes this concrete. An agent working in your repository infers what good looks like from the code already there, then produces more of the same. Your codebase is not just where the work happens. It is the example set the agent learns your standards from, per task, in real time.
That cuts both ways. Consistent code compounds: the agent sees one clear pattern, copies it, and the next reader sees two clear instances instead of one. Inconsistent code compounds too, in the wrong direction. When one concept has two implementations, the agent cannot tell which is canonical. So it guesses, or it writes a third, and now the next agent has three patterns to choose from. Inconsistency is not neutral. It is a tax that grows every time anyone touches the code.
The code you already have is the prompt for the code you get next.
The fundamentals that now pay double
None of the following is new. What is new is the size of the payoff, because a second reader collects on it constantly.
- One canonical owner per concept. A single source of truth for each idea gives the agent an unambiguous thing to extend. Two competing implementations guarantee a third.
- Honest names. A name that says what a thing does is context the agent gets for free. A misleading name is context that actively points it the wrong way.
- Types that make invalid states unrepresentable. A constraint encoded in a type is a rule the agent cannot skip, because the code will not compile if it does. That is worth more than the same rule written in a comment it may not read.
- Real examples over prose. A working, idiomatic example teaches an approach better than a paragraph describing it. The agent will copy the example almost exactly, so make the example the one you want copied.
- Delete dead code. Every abandoned path is a pattern the agent might treat as current. Removing it is not tidiness, it is removing a wrong example from the training set the agent reads at work.
Read that list again and notice it is the same list a good engineer would give a new hire on day one. The agent is a new hire who reads the entire codebase before every commit and takes it literally.
Broken windows at machine speed
The broken windows idea holds that visible disorder invites more of it. In a codebase, one sloppy pattern signals that sloppy is acceptable here, and the next change matches the tone. With human authors that decay was slow, paced by how often someone opened the file. With an agent it is fast, because the agent opens everything and matches the tone it finds without any of the social hesitation that made a person pause and clean up.
So the maintenance question flips from occasional to continuous. A messy pattern no longer waits months to spread. It can spread across the repository in an afternoon of agent work. The upside is that the reverse is just as fast: fix the canonical example, and the next wave of generated code inherits the fix.
This is the same instinct behind harness engineering. Hold the model fixed and invest in the environment it reads. The oldest environment you have is the codebase, and it was always teaching the next reader what to do. Now the next reader shows up on every task and does exactly what the code taught it.
FAQ
Does clean code matter more with AI coding agents? Yes. The agent reads the codebase to decide what to write and imitates what it finds. Consistent, well-named, single-source-of-truth code steers it toward good output. Inconsistent code forces rediscovery and multiplies mistakes at machine speed.
Why do agents produce duplicate or inconsistent code? Usually because the codebase gave them no clear pattern to copy. When one concept has two implementations, the agent cannot tell which is canonical, so it guesses or adds a third. A single canonical owner removes the ambiguity.
How do I make a codebase easier for an agent? The same things that help a human: one canonical implementation per concept, honest names, types that rule out invalid states, real examples, and deleted dead code. Consistency is the highest-leverage investment, because the agent treats every file as a template.