Writing
Agents

Directing AI coding agents on a 1,000-commit codebase

Building a production system alone with AI agents: written rulings, bounded questions, night builds, and the checks that keep them honest

PublishedOct 16, 2026
Reading10 min
TopicAgents
The problem in one sentence

AI agents write code faster than anyone can read it, so the scarce thing is no longer code. It is decisions that stay decided.

Over four months I built a confidential OSINT and HUMINT system (open-source and human intelligence) on my own, with AI coding agents doing most of the typing. By mid-October it held about 1,000 commits, 170,000 lines of TypeScript in the API, 780 API test files and 161 database migrations. In its last twelve days it went from version 1.0.1 to 1.10.0.

None of that is the interesting part. Agents make volume cheap. What they do not do on their own is remember why: why the system refuses this, keeps that, or asks a model instead of computing. Lose the why and every new session re-litigates it, or worse, quietly reverses it.

So my job changed. I wrote fewer lines and more decisions. Here is what held up.

01Record rulings in your own words, and make agents quote them

Every product decision I make is written down dated and verbatim, in a single page that agents read before they touch the system. Each entry has four parts:

  • my words, quoted exactly;
  • what the ruling settles, in plain terms;
  • what it cost before the ruling, measured where possible;
  • where it was applied: the branch or change that built it.

The page opens with one rule for the agents: quote, then apply. Never paraphrase a ruling into a rule and cite the rule.

That rule exists because paraphrase drifts. Early on I listed four things a model step might do, as examples. They ended up in a design record as a limit, and more than once work stalled on "per the design record, the model may not do this". Nobody had decided that. A paraphrase had become a ceiling.

Rulings change, and the page shows it. A reversed ruling keeps its original text, followed by "Changed on [date]" and the new words, so an agent can see both what was decided and what replaced it.

02Set an order of authority, and put tests below it

Agents need to know what wins when two sources disagree. Mine is:

  1. 01the product document and the rulings page;
  2. 02the design records;
  3. 03the tests.

A test suite is not an authority. Tests encode yesterday's brief, and the brief moves weekly. A failing test says something changed; it does not say the change is wrong. When a test pins behaviour a ruling has since overruled, the agent rewrites the test, and the rewrite says which ruling overruled it.

A green suite is not evidence either. Twice in one day the whole suite passed while running stale compiled code: once from an old build of a shared package, once in the integration test pool. Since then, the claim that matters gets checked against the database, not just the test output.

03Make agents ask good questions

An agent that guesses on a product decision costs you a reversal later. An agent that asks a vague question costs you a meeting. The fix is the shape of the question:

  • bounded: two to four options, not "what do you think?";
  • with a recommendation, marked as such;
  • with the cost of being wrong, stated for the recommended option.

A real one, rewritten without names:

A data broker lists an account on a person's record, but the handle does not look like their name and nobody can open the page. What should the system do?

Keep it, marked unverified (recommended). Cost if wrong: a stranger's account prints, marked unverified, until something contradicts it.

I answered in one line. Most of my rulings take a line or two, and some were given from my phone.

The answers come back pitched at the right level too. Agents are told to explain things the way you would to a technical executive new to the project: lead with the consequence, spell out every project-specific term, and say what was verified and what is only believed.

04Run night builds, and keep the morning for decisions

Agents work through roadmap items overnight. The output in the morning is not a wall of diffs. It is:

  • what was built, as merged changes, each with a commit message scored for risk;
  • a short list of decisions the agents could not take alone, each in the question shape above.

I answer the list in the morning, and the answers become the next night's work. The rulings page grows almost every day, and each entry is a question that will never be asked again.

When two streams of work must not collide, they get separate git worktrees. One agent rebuilt the web app's design in its own checkout while the main checkout ran a long proof run.

05Use councils, then verify the crux yourself

For anything load-bearing, such as an architecture change or a document that will be published, I run a council: several named perspectives, each doing the whole analysis, then reading and contesting the others. A separate fact-check round once ruled a first draft unpublishable and killed a statistic nobody could source.

Councils work. And on one review their central claim was wrong twice: once from a reviewer, once from the agent coordinating them. Both errors were caught the same way, by reading the database instead of the summary.

The lesson I wrote down: a claim that reaches a second agent unverified reaches a third as fact. Whoever coordinates checks the crux directly, at the source, before anything is built on it.

The same honesty applies to documents. Corrections are made in the open: the wrong claim is struck through and followed by "Corrected on [date]: this was wrong because…", so the next reader, human or agent, sees what changed and why.

06Never estimate in time

This one is written into the instructions every agent reads.

Wall-clock estimates carry almost no information in agent-driven work, and they actively mislead. One item was priced at several days. It turned out to be a pure function and two call sites. The estimate had silently bundled two different jobs: "stop creating bad rows" and "clean up the bad rows already created".

So agents describe the shape of the work instead: which files, which decisions, what must be migrated, what can break. The shape tells you whether to do it now. A number of days never did.

07Measure before you change the machine

Agents will happily swap a model, tune a prompt or loosen a threshold on a hunch. Hunches need a price tag and a test.

  • Before moving the hard decisions to a bigger model, I paid $18 to replay 20 hard cases on both. The bigger one put nothing false on a record; the smaller one did so 12 to 22 times. The same replay showed that grouping questions into one call changed verdicts far beyond normal noise, so every question kept its own call. (More in Comparison or recognition?)
  • After an agent audited one full run and found 89 issues, my question was: "Why isn't the system doing this audit itself?" That is now on the roadmap: a run that reviews its own output and plans its own fixes.

What this changes about the job

Directing agents is not prompting harder. It is the work of a product owner and a staff engineer at once:

  • deciding, and writing the decision so it survives the next session;
  • shaping questions so they can be answered in a minute;
  • refusing evidence that has not been checked at the source;
  • keeping a record that a newcomer, human or agent, can trust.

The code is cheap now. The judgement around it is not.

The check

00 / 08

If you run AI agents on a real codebase, ask:

Every "no" is a place where yesterday's decision will be quietly undone.

Lucas Merlette · Oct 16, 2026Back to top
Related project
Confidential OSINT engineAn AI research engine for confidential investigations.Read the case study
Next article
Data · 8 minHandles are an unstable key