adam bien's blog

The Codebase Is the Agent's Working Environment 📎

Agents generate code in seconds, so investing in code quality looks obsolete. My daily work with agents shows the opposite. Every session starts by reading the existing code, and its quality decides how productive the session is.

  • Agents amplify the local style. LLMs match the surrounding code. Clear conventions get reproduced, and so does degradation: in a codebase full of Managers and Impls, the agent generates the next one.
  • Simplicity saves context. Every additional layer, interface, or indirection is another file the agent has to read before it can change anything. The smaller and flatter the code, the more of the system fits into the context window, and the faster a human reviews the result.
  • Vertical slices localize the change. A prompt describes a feature, not a technical layer. One business component per responsibility keeps the change inside a single package: small context, and parallel agent sessions without collisions. Horizontal layering scatters every feature across the whole tree.
  • Verbosity creates semantic context. Spelled-out names, explicit signatures, annotations, and JavaDoc that states the intent are context the prompt no longer has to deliver. The same names are navigation: an agent finds a package named after a business responsibility without scanning the project. This complements simplicity: the structure stays minimal, and the names and declarations carry the meaning.
  • Every artifact needs a purpose. Agents treat whatever exists as intentional: they maintain dead code, extend speculative abstractions, and route new features through unused flexibility. Code without a purpose misleads the next session.
  • Standard patterns are in the LLM weights. Conventions like BCE are described in decades of books and articles, so agents apply them without explanation. A self-invented structure has to be taught in every session.
  • Tests are the feedback loop. An agent iterates autonomously only against executable verification; spec-driven workflows like SBCE use the test suite to decide when the work is done. Without tests, the agent cannot verify its own claims.
  • Drift is invisible to the agent. Every generated change looks reasonable in isolation, and the agent has no sense of a slowly degrading whole. Architectural review stays a human responsibility, and simple, short code is what keeps it feasible at agent speed.

Code quality was always an investment in the next developer who has to read the code; in agentic development, the next reader arrives with the next prompt.

The conventions from this post are packaged as installable skills for any coding agent at airails.dev.