Blog Me Out
Back to feed
Technology

Your Codebase Has a New Reader, and It Isn't Human

Blog Me OutJun 26, 2026

TL;DR

Clean code stopped being a matter of taste: AI agents now read your codebase too, and they work far better in small, well-named, well-tested code. The mess finally has an immediate price.

For about fifteen years we argued about clean code like it was a matter of taste. Small functions or big ones. Comments or no comments. Tabs or — well, you know. The arguments were real but the stakes were soft, because the only judge was another developer, and developers are forgiving. A human reading a messy file will sigh, scroll, grumble, and eventually figure it out. People route around bad code. That forgiveness is exactly why the arguments never ended: nothing was ever truly forced.

That’s over. Not because we finally agreed — we didn’t — but because your codebase quietly acquired a second reader, and this one doesn’t sigh and route around your mess. It just gets dumber.

If you’ve spent any real time pair-programming with an AI agent, you’ve felt this even if you couldn’t name it. You point it at a clean, well-factored module and it moves like it wrote the thing — finds the right file, makes the surgical change, runs the tests, done. You point it at the 3,000-line “utils” file that everyone’s afraid of, and it flails. It reads half of it, loses the thread, edits the wrong function, confidently breaks an invariant nobody documented. Same model. Same prompt. The only variable was your code.

That gap is the whole story. The agent is now a reader of your codebase, and unlike a human, its competence is directly downstream of how readable your code actually is.

A screen full of source code. Photo by Chris Ried on Unsplash

The agent reads differently than you do

To see why, you have to understand that an agent doesn’t read code the way you do. You open a file and your eyes saccade around, building a mental model, skimming the boring parts. An agent works under constraints that are almost physical:

  • It reads in chunks, and big files get truncated. If your file is 2,000 lines, it may only ever see a window of it at a time, reasoning about a function whose callers are off-screen.
  • Its attention degrades with context size. Stuff a million tokens in and the needle in the haystack gets harder to find — well before any official limit. More context is not more understanding.
  • It prefers grep over reading. It searches for a symbol, jumps to the hits, and reasons locally. Which means your names are load-bearing in a way they never were for a human skimming top to bottom.
  • Every action — every file read, every search, every edit — costs tokens and time. A codebase that forces the agent to read ten files to make one change is a codebase that makes the agent slow, expensive, and error-prone.

None of these are bugs to be patched away by the next model. They’re the shape of the tool. And once you internalize them, “clean code” stops being an aesthetic preference and becomes a list of concrete affordances for a reader that has a working-memory budget and charges by the lookup.

A developer at work on a laptop full of code. Photo by Caspar Camille Rubin on Unsplash

The same rules, suddenly with teeth

Here’s the part that should make every old-school clean-code preacher feel vindicated and a little uneasy at once: the practices that make an agent effective are, almost line for line, the ones we’ve been arguing about for years. What changed is the reason — and the fact that you now get punished immediately for ignoring them.

Small files and functions stopped being about human readability and became about fitting in the agent’s window. A 12-line function the agent can hold entirely in its head and reason about with full context. A 600-line one it reasons about through a keyhole.

Distinctive names stopped being a style nicety and became a retrieval mechanism. Call something handler or data or process and the agent’s grep returns forty irrelevant hits it has to spend tokens disambiguating. Call it chargeFailedInvoiceWebhook and it lands on the one place that matters. You are, quite literally, writing search keys for a machine.

Comments got their priorities flipped. The old dogma — “good code doesn’t need comments, it speaks for itself” — was always half-true: code says what it does, never why. A human can sometimes reconstruct the why from git blame and tribal memory. An agent can’t. It needs the WHY written down: this looks redundant but it guards against a race we hit in prod; don’t “simplify” it. The comment that explains intent and constraints isn’t clutter anymore. It’s the only thing standing between you and an agent “cleaning up” a load-bearing wall.

Explicit types stopped being a religious war and became free leverage. Every type you annotate is inference work the agent doesn’t have to do — and a guardrail that catches it when it guesses wrong. Typed code is just more legible to a statistical reader.

Runnable tests went from a virtue you talked about to infrastructure you can’t operate without. An agent’s superpower is the tight loop: change, run, see, fix. If your tests are headless, deterministic, and one command away, the agent closes that loop a hundred times an hour and catches its own mistakes. If they’re flaky, slow, or require a human to interpret, the agent is flying blind and so are you. This is the part people underestimate most: with agents, a fast test suite isn’t quality hygiene, it’s the control system.

None of this is new advice. That’s the point. It’s the oldest advice, finally load-bearing.

The artifacts nobody used to write

What is new is a small set of files that didn’t exist in the clean-code canon because they’re written for a reader that didn’t exist.

The big one is the conventions file — the CLAUDE.md, the rules file, whatever your tool calls it — sitting at the root of the repo. Think of it as the onboarding doc you never bothered to write for human hires because they’d absorb the conventions by osmosis over a few weeks. The agent has no few weeks. It starts cold on every task. So you write it down once, explicitly: how we name things, where things live, the command to run the tests, the three sharp edges that will cut you. The agent reads it on every query and behaves. Skip it and you’ll re-explain the same conventions forever, badly.

Right behind it: an architecture sketch in the README so the agent can anticipate where things are instead of spelunking; structured logs it can actually parse; a setup script that works on a clean machine so the agent can get the project running without a human in the loop. The through-line is the same — reduce the work the agent has to do to understand the shape of your system, because every bit of that work is tokens, latency, and a chance to go wrong.

The feedback loop is the gift

Here’s what I find genuinely exciting about all this, and it’s not the productivity. It’s that we finally have a forcing function.

For fifteen years, the cost of messy code was deferred and diffuse. You felt it months later, as “velocity,” in a retro, as a vague sense that the codebase was fighting you. The feedback loop was so slow and so easy to rationalize that teams could argue about clean code forever without ever being made to settle it. There was no judge with authority.

Now there is. The agent is a brutally honest, instantaneous code reviewer of your structure. Bad names, giant files, undocumented intent, a broken test command — you don’t find out in three months. You find out in the next thirty seconds, when the agent you’re paying to help you instead face-plants on a change a junior could have made. The mess has a price tag again, and it’s printed on every interaction.

That’s a tax, yes. But it’s also the thing the discipline always lacked: consequences that arrive fast enough to change behavior.

Clean code stopped being a matter of taste

So I’ve made my peace with the fact that the arguments are over, just not in the way any of us expected. We didn’t win them on the merits. We got a new reader who doesn’t care about our opinions and simply works better in clean code than in messy code, every single time, and tells us so immediately.

Write small. Name things like you mean it. Say why, not what. Type your interfaces. Keep the tests fast and the setup one command away. Put the conventions in a file the machine reads on every turn. Do it not because it’s elegant, but because the thing now writing half your code is only as good as the codebase you give it to read.

We spent fifteen years treating these habits as a question of discipline — something you did if you were conscientious and skipped when you were busy, with consequences vague enough to argue about forever. That framing is gone. Your codebase is no longer just where your software lives; it’s the working memory of the machine you’ve hired to help build it. Make it legible and that machine is sharp. Leave it a swamp and no model on any leaderboard will save you. The quality of your code is now, very literally, the ceiling on the quality of your help.