What a Seeded Repo Looks Like, and Why I Now Run Two Agents In It

Entry
No. 60
Date
Reading time
9 min
Status
Borne out
Author
Jeff Breece

Summary: I’ve written about seeding a repository for an agent and about the ledger it keeps. This is what that looks like after I rebuilt my homelab repo around both ideas, plus the next step I’ve been trying: one agent builds, a second one audits the exact commit it hands over, and I make the calls in between. The first audit of a branch with a fully passing test suite found seven things that had to be fixed. Here’s the structure, what the audit caught, and where the whole setup still falls short.

The problem I was seeding against

A coding agent starts each session knowing nothing, a bit like a contractor who shows up every morning having forgotten yesterday. It tends to believe whatever it reads first. In a repo that has grown for months, a spec, a dated audit and the running system can all say different things, and the agent usually can’t tell which one is true.

Mine had reached that point. It’s a private monorepo for a multi-host lab, where code in the repo runs somewhere else and nothing deploys on a commit, so a document that has gone stale can look exactly like a current one. To me, seeding a repo means making “which of these is true?” answerable without a person there to answer it.

Fact, intent and record

Most of what I did comes down to one split. Everything written in the repo falls into one of three kinds, and an agent should read each one differently:

Kind of writingWhere it livesHow an agent should read it
Current factCode, service units, manifests, one canonical doc per topicTrust it, then check it
IntentA board card, plus a spec for larger workWhat the change is for, which may not be what’s true now
RecordThe ledger, incidents, dated audits, test sheetsWhat was true or claimed on that day

A spec that says “the service runs on port 8003” is fine as a statement of what someone wanted. Read as a statement of what’s running, it can send an agent the wrong way.

What the repo looks like

Structurally, it looks something like this (trimmed a lot):

CLAUDE.md                   current fact and pointers, about 22 KB
AGENTS.md                   the safety rules
.claude/
  hooks/guard_bash.py       hard rules, run before every shell command
  rules/*.md                notes that load only for certain paths
  skills/, agents/          packaged procedures and reviewers
ledger/
  README.md                 the rules of the ledger
  2026/11/...               one immutable file per change
docs/
  SOURCES_OF_TRUTH.md       where each fact lives, and what only describes it
  reference/network-facts.md
  runbooks/                 how to operate it, about 100 files
  specs/                    design intent, each with a status line
  adrs/                     why decisions were made
  history/                  what used to live in CLAUDE.md
deploy/deployment-ledger.yml  what runs where, and what ships it
tests/                      including tests that read the docs

The piece I’d copy first is SOURCES_OF_TRUTH.md. It’s a table of each kind of fact, its one canonical source, and the mirrors that lag behind it. It also sets an order of trust for when two sources disagree: the running host, then code and manifests, then the canonical doc, then mirrors, then specs and history. When two sources conflict, the agent is supposed to raise it instead of quietly picking one. The file even rates each of my 20 ADRs as standing, overtaken or stale, because an accepted decision from August can read as current long after the mechanism behind it is gone.

CLAUDE.md got the biggest change. On October 31 I cut it down to current facts and pointers, and moved about 29 KB of old lessons into docs/history/. It’s around 22 KB now, because (I still think) many agents stop reading at about 32 KiB, and it carries a “last reconciled” date so a reader can see how old its claims might be. Notes that only matter in one part of the repo moved into seven path-scoped rule files, which load when an agent touches those paths.

The ledger works the way I described last time: one file per change, never edited, with corrections as new entries. Since that post it has gone from a proposal to something a test enforces. Each entry names its cards and commits and has the same five sections, and tests/ledger/ fails the build if an entry changes, if one has the wrong shape, or if an agent’s commit isn’t listed in any entry. There are 80 on main so far, after three days.

The board is the record of status. Non-trivial work gets a card before it starts and a comment afterward saying what was built and what the data forced. Specs and runbooks each have one job, too: a spec says what we wanted, with a status line saying how far that got, and a runbook says how to operate the thing today, so a real service change updates its runbook in the same work.

Rules that don’t depend on the agent remembering

Some of the most useful seeding only shows up when an agent gets something wrong, as a check it can’t talk its way past.

Docs are tested. Topology tests check that IP addresses, ports and hardware facts agree across docs, scripts and service units, so a stale doc can fail the build.

Hard rules are hooks. guard_bash.py runs before every shell command, and each refusal says why and what to do instead, so the next attempt doesn’t go sideways. Most of the rules exist because something once went wrong, like pkill -f matching and killing the shell that ran it. The hooks have their own test suite of about 70 checks.

Intent is human-owned. An agent can edit CLAUDE.md, AGENTS.md, .claude/ and the sources-of-truth guide, and stage the change, but the hook refuses an agent’s commit of those files. I commit them myself. Those files say how agents work here and what the lab is for, and I’d like a change to them to be a decision rather than a side effect of a session.

The hooks are there because written rules alone didn’t hold. This past week my agent tried sudo -n true on a lab host three times in one day, while a no-sudo rule was in force, and a forked sub-agent did the same thing. It’s a harmless command that answers one question: can this account become root with nobody there? A classifier stopped only one of those attempts. That’s why the hook now has a sudo rule, and I’m happier with a dumb text match there than with a model’s judgment.

Moving a file is a runtime change

In this repo, a path can also be a cron line, a service unit, a copy step in the Makefile or a test assertion, so a tidy-up can break something on a host without any deploy having run. So the re-org went slowly. Each candidate got checked against five surfaces, including the crontabs and unit files on the live hosts, and only things with no references at all moved first. The first pass was in August, with a proposal on October 31 and more phases the day after: every checkout a unit runs from went into the deployment ledger, leftovers moved to an attic one at a time on my say-so, and network facts moved into one document.

The organization doc records what didn’t move and why. That’s often the more useful note, since it can stop the next agent from “fixing” the same thing.

Two agents and a person

The new part is how the work runs. Right now I have two Claude Code sessions going, and the loop looks like this:

  1. The build agent works on its own branch in its own worktree, writes its ledger entries, and reports one thing when it’s done: a final commit hash and the result of a full make test run on that hash.
  2. The audit agent reads that exact commit and reports findings only. It doesn’t fix anything, and it doesn’t review earlier commits, since those could still change.
  3. I read the findings, make the calls that are mine, and paste the result back to the build agent. Then we go around again on just the fix commits.

The first round is a good example. The build agent handed over a branch of data-pipeline work, with a camping trip planner and a private money report on top. Its full suite passed, at about 1,900 Python tests and 1,300 UI tests. The audit found seven things that had to be fixed, plus seven smaller ones. A few of them:

  • The planner could tell me “you’re free” on a day I wasn’t. An all-day calendar event read as free, and so did the second day of a multi-day trip.
  • A rule for “no campsites open” could never fire in production, because the code only ever asked for open sites. Its test passed because the test’s fake ignored the query.
  • A private report had a check refusing to write into a git repo, and the check quietly passed if the target folder didn’t exist yet.
  • The documented way to turn the feature on wouldn’t have reached the timer that runs it.
  • The agent had added something nobody asked for: one of my voice companions would have spoken up every morning for up to six days in a row.

That last one is why I think the person stays in the loop. The other findings were bugs, but that one was a product decision, and neither agent should really be making it. I said no. In the second round, the build agent also traced the calendar problem to its root (the import drops the end date of all-day events), which it couldn’t fix from that branch, so it opened a new card and marked it as blocking the feature. I liked that a lot more than a clever workaround!

It’s also going further than one branch now. For a dashboard page, the audit agent wrote a shared contract first (a JSON schema and example files), then built the UI against it while the other agent builds the backend. I don’t know yet how that one ends, since the two haven’t met.

Where this still falls short

The auditor is wrong sometimes too. The same agent that found those defects also told me 6 of 12 dashboards had loaded when it was 9, and quoted a speed comparison that wasn’t like for like. It caught both on a reread and corrected them, but I’d only count on that about as much as I’d count on any other self-review.

The auditor misses things. The first audit passed a dashboard that couldn’t build through the documented start command, because a mount was missing. It only turned up later, by accident, while testing something else.

I’m the message bus. That same finding got posted as a comment on the card, and the build agent’s next round came back without it, since nobody had pasted it over. A comment on a card doesn’t reach an agent unless someone carries it, and today that someone is me. This is the part I’d most like to improve.

It’s the same model on both sides. Last time I wrote that the drift check should come from a different model family. Both of these sessions run the same Claude model, so what I have is independence of context (the auditor never saw the build happen), which is probably weaker. I don’t have a measurement of how much weaker. It still found real defects under a green suite, so I’m keeping it for now.

A ledger is still a self-report. Entries say what the agent says it did, so they have to be read against the commits.

What I’d pass on

If you want to try this on your own repo, I’d go in roughly this order:

  1. Write your own SOURCES_OF_TRUTH.md first. It’s one file, and writing it forces you to decide what’s true.
  2. Cut your instructions file down to current facts and pointers, and move the history out.
  3. Turn your two or three most important rules into hooks or tests, starting with whichever one an agent has already broken.
  4. Make the build agent report a hash and a test result, and have a separate session audit that exact commit, findings only.

Generally speaking, I don’t think any of this makes an agent trustworthy. What it does give me is a way to check the agent’s work, and it gives the agent something to check itself against other than its own memory.

The next thing I’d like to try is the test from my last post, but properly: take a finished feature, give a different model family the cards, the ledger entries and the test results, and compare what it flags with what my same-model auditor found. Many of us are now working in this format, and for a good reason, it works. Sharing what we learn is key in any era of transformation, this is my effort toward that goal.

Tags: agentic-aiarchitecturedevopsgovernanceresonancelab