Founder pricing: Pro at $9.99/mo forever for the first 50 members. 18 of 50 left Claim yours →
All posts

The agent-ready codebase: the half of the agent you control

The SanuDesk team 6 min read
codebase ai agents workflow

The agent had a fix drafted in ninety seconds. Then it went to verify. The test suite took eleven minutes, two tests fail on a good day anyway, and the one command that runs just the relevant file was documented nowhere. So it did what any rational cold reader does with a slow, noisy oracle: it stopped asking, and started guessing.

Same model, same prompt, different repo, and that run ends in two minutes with a verified diff. That is the uncomfortable, useful truth about coding agents: you cannot tune the model, but you own the repo. Half of every agent run was committed months before the session started.

What an agent-ready codebase actually means

An agent meets your code the way a contractor does: cold, on every single task. No tribal memory, no hallway context, no "ask Priya about billing." Whatever it needs, it has to pull from the repo in minutes. That compresses agent-readiness into three questions:

  • Orientation. How fast can a cold reader find the right file?
  • Verification. How fast can it check whether a change worked?
  • Boundaries. How does it learn what it must not touch?

This is the problem you face when learning a new codebase, replayed forever: the agent never gets to stop being new. Teams getting great results are rarely holding better prompts. They are holding repos that answer those three questions without a human in the room.

Fast feedback beats clean code

Ranked by leverage, the first investment is not beauty. It is the speed and honesty of your signals: tests, types, linters. An agent works by proposing a change and asking the repo what it thinks. When the answer lands in seconds and means something, the agent iterates toward correct. When the suite is slow or flaky, the agent economizes: it runs it less, or not at all, and replaces verification with confidence.

Three upgrades matter more than any refactor:

  • A scoped test command. One documented line that tests a single file in seconds. The full suite is for CI; the agent needs the tight loop. TDD with agents is built on exactly this.
  • Deterministic tests. A test that fails one run in ten does not cost you ten percent. It teaches every agent in the repo that red might mean nothing, which quietly licenses ignoring red.
  • Types and linters at the boundaries. A type error is feedback in two seconds without running anything. The stricter the contract, the more wrong changes die before they are ever proposed.

Anthropic's best-practices guide makes the same point from the tool side: an agent with a target it can verify against outperforms one working blind.

Structure a cold reader can navigate

Agents find code the way you did in week one: search, then read. That turns old virtues into multipliers:

  • Names that say what things do. A file called invoice-rounding.test.ts is findable by an agent holding the word "rounding". utils2.ts is findable by nobody.
  • Files small enough to read whole. A 2,000-line module does not fit in context next to the rest of the task, so the agent skims, and skimmed code is where invented helpers come from.
  • Dead code deleted, not parked. Your team knows to ignore the abandoned v2/ folder. A cold reader gives it equal weight and copies patterns from code that was never supposed to survive.
  • One convention, repeated. When every module handles errors the same way, pattern-matching works for you: the agent writes the fourth endpoint the way the first three look.

In a monorepo the same idea moves up a level: scope what the agent sees to the package the task names, so the structure does the focusing before the prompt has to.

Write down what the code cannot say

Commands, conventions, and boundaries living in one senior head need a file the agent actually reads: the scoped test command, which folders are generated, what must never change without a human. The emerging cross-tool standard is AGENTS.md, and writing a good one is twenty minutes that every future session collects interest on. Hold it to the same cold-read test as everything else here: could a contractor, given only the repo, get to work?

Where agent-readiness goes wrong

The costs are real, so spend them where they pay:

The six-week cleanup that ships nothing. Agent-readiness is a direction, not a prerequisite. If the repo must be perfect before agents touch it, you have found a respectable way to procrastinate. Fix the friction the last run actually hit, ship, repeat.

Polishing what agents do not feel. Renaming variables while the suite stays flaky is detailing the paint while the engine misfires. Fix signals before structure, structure before instructions: a fast, honest suite covers for mediocre naming far better than the reverse.

The forty-page instruction file. Instructions rot faster than code because nothing fails when they drift. Signals do not rot: a test is green or it is red. Prefer one enforced check to ten written rules.

Calling it free. This work costs senior attention now and pays back over weeks: an investment, not a hack. The consolation is that nothing here is agent-only. The properties that help a cold-reading agent are the ones new hires, and you at 2am, have always needed.

Watch the friction, then work the queue

Agent-readiness is discovered, not designed: you find the friction by watching real runs stall. That observation loop is what SanuDesk is built for. It is a desktop app that tiles your Claude Code, Codex and Gemini sessions into one grid, so when three agents hesitate at the same spot (the slow suite, the mystery folder) you see a pattern instead of losing it behind tabs. The Kanban board gives each papercut somewhere to go: file it as a card, and since repo improvements make ideal agent tasks, deploy the card straight to a fresh session and review the diff when it parks in the review lane. The upkeep runs as Loops on a schedule: a weekly flaky-test hunt, a dead-code sweep, a check that the instruction file still matches reality, every run journaled. It is bring-your-own-model, driving the agent subscriptions you already pay for, and the grid and board are in the free plan (details on pricing).

Score your repo with one real task

Skip the maturity model. Hand an agent one small, real task today and write down four numbers while it works:

  1. Minutes until it edits the right file.
  2. Seconds to run the narrowest relevant test.
  3. Questions it asked, or guessed at, that ten lines of AGENTS.md would have answered.
  4. Files it touched that it should not have.

Each number is a repair order: structure and naming, the feedback loop, instructions, boundaries, in that order. Fix the worst one, rerun the same class of task next week, and watch the scorecard move. That is the whole practice. The repo is the half of the agent you control, and it is the half that compounds.

Download SanuDesk free to watch your agents work side by side, or see how the grid, the board and Loops fit together on the features page.

Run your own fleet of agents

SanuDesk is a free desktop app that tiles your Claude Code and Codex sessions and gives every project a Kanban board your agents work from.