Harness evals: finding agent rules that stopped working

in Harness engineering

Every rule, hook and skill you add to an AI agent setup stays forever, and nothing tells you which ones stopped paying or whether last week's edit changed how agents work.

  1. Why does a harness need a self-test?
  2. What did we build?
  3. How does the retire check decide what to cut?
  4. What did the first real run say?
  5. Did the tdd skill edit change anything?
  6. Can you trust the counter?
  7. When does it run?
  8. How was it built?
  9. What is still missing?
  10. Summary

Why does a harness need a self-test?

Because a harness only grows. Mine is the set of rules, hooks and skills that every Claude Code chat loads: a global prompt file, guard hooks that block risky commands, and skills like tdd that tell an agent how to work. Each one was added to fix a real mistake, and nothing in the setup asks whether it still does.

The global prompt has a hard size limit, checked by a test: 15,676 bytes. It was at 15,310, so 366 bytes were left, about one more rule. A skill edit has the opposite problem. I change tdd and hope agents now write tests first, but I never check.

So the plan had one question per problem. What can I cut? Did that edit help? And then: run it once for real and write down what it said. This post is that run.

Tool Used for
Python 3 standard library both checks, no extra packages
Claude Code hooks the guards being measured
Claude Code transcripts (.jsonl) the record of every past chat
taskman the board where findings and decisions go
mow the multi-agent run that built it
Claude Opus 5.5 / Fable builders / reviewers

What did we build?

Two command-line checks and a line in the end-of-chat ritual. retire_check.py lists harness pieces to cut, each with a reason. skill_edit_check.py compares real chats before and after a skill's last edit. Both have a cheap --due mode that the wrap-up step runs at the end of every chat.

global prompt366 B left retire checkwhat to cut, and why guard hooksreplayed on old calls wrap-upruns both checks chat transcripts3,185 files skill-edit checkbefore vs after
Figure 1. The two checks and what they read.

Neither check decides anything. A cut is the operator's call, and so is a label on a sample. Both tools print counts, rates and ids only, never text from a transcript, so their output can go in a tracked file.

How does the retire check decide what to cut?

It reads three sources and lists anything that looks like it no longer earns its bytes:

  • Lessons already guarded. A rule in the global prompt whose lesson a hook now enforces. If the hook covers it, the prose copy is a candidate.
  • Rules that never fire. Prose rules whose probe found no case in past chats.
  • Guards that never fire. Each Bash guard hook is replayed over the last 90 days of real Bash calls. A guard with 0 denies or asks is a candidate.

A keep list holds the ones I already ruled to keep, each with a reason and the model it was ruled on. When the model changes, they come back for a second look, since a rule a model needed may not be needed by the next one.

The first real run listed a guard I knew was alive. cam-lane-guard showed 0 fires in 90 days, while the runtime had used it to deny 3 calls that same week. The replay could never fire it: the guard checks a field that only subagent calls carry, and the replay sends none. The review gate caught it, and the fix counts a deny the runtime already recorded, matched by the guard's own reason text. A guard the replay can't fire, and that has no recorded deny, now prints as not measurable with the reason, never as a cut. I wrote about the same trap in a guard you never saw fire.

After the fix the run read 3,185 transcripts and 118,804 Bash calls in the window. 10 hooks print as not measurable.

What did the first real run say?

One candidate, and I kept it. The lesson was "search the board before building, and claim the row you find" (L123). Its guard is a hook that names other chats' commits and board rows touching the file you just edited.

The rule for a cut is that the guard covers the rule wherever the rule applies. This one doesn't. It only nudges and never blocks, and it misses a duplicate that names no file. So the rule stays in the prompt, and its reason went on the keep list. A re-run showed 0 candidates and 3 hidden by the keep list. Headroom stayed at 366 bytes.

A keep with its reason written down means the check won't ask again until the model changes.

Did the tdd skill edit change anything?

Maybe a little, and the number is softer than it looks. The tdd skill was edited on 2026-09-29. The skill-edit check split real chats into 21 days before and 21 days after that edit:

Side Chats Loaded tdd Coding chats Ran tests before the first code edit
Before 163 2 (1.2%) 33 16 (48.5%)
After 640 22 (3.4%) 111 62 (55.9%)

Compare the rates, not the counts: the after side has about four times as many chats. A "coding chat" is one that edited a source file; "test-first" means a test command ran before that first edit. The next section is why 55.9% is an upper bound.

Can you trust the counter?

Only after you check it against hand labels, and this one had a blind spot. The check drew a seeded sample of 20 chats it called test-first and 10 it called not. An agent proposed a label for each, with a reason: was the counter's call right? I confirmed or overruled each one, and confirmed all 30.

Measure Result
Precision (positives that were right) 18/20
Miss rate (negatives that were wrong) 4/10

All 6 wrong calls had one cause. The counter treats a throwaway scratch script as a source edit. A chat that only wrote a helper script in a temp folder counts as a coding chat, so it lands in the base of both rates. None of the 4 "misses" was a test run the counter failed to spot.

Symptom Cause Fix
A chat with no code change counts as a coding chat scratch scripts count as source edits skip temp and scratch paths (filed)
The same chat appears twice in one sample one chat saved under two transcript files count by chat, not by file (filed)
A chained command looked like a false test run I judged from a 140-character preview read the whole command; every one did run a test

That last row was the orchestrating agent's mistake, caught before any label went in. From now on a fresh reviewer agent labels the sample and I only see the score. It has to be an agent that did not build or run the counter, or it is grading its own work. I made the same point about evals in the eval that found a prompt bug.

When does it run?

At the end of every chat, in report-only mode. The wrap-up step runs both checks with --due. Each takes under 0.3 seconds, because it reads one file at most and replays nothing.

Wrap-up Operator chat ends run both --dueunder 0.3 s each ✕ due? nothing printed add to open threadsline + next command run full checkabout 40 s rule on eachcut or keep --ack / --recordquiet till it changes yes no report 1 2 3 4 5
Figure 2. How a due review reaches the operator.
  1. The chat ends and wrap-up runs both --due checks.
  2. Nothing is due: nothing prints.
  3. Something is due: the line and the next command go into the report's open threads, and wrap-up stops there.
  4. I run the full check, rule on each item, and record the review with --ack or --record.

Retire is due when headroom drops under 1,024 bytes and below what it was at the last review, or when the model changes. A skill reading is due from 21 days after a skill edit until the edit is 60 days old. Wrap-up never acks, records or files a task for a due line, because each of those needs my ruling. Right now one line is due: a reading for the recover skill.

How was it built?

As one mow run: three waves, five lanes, a review gate after each wave. mow is our multi-agent workflow: a plan becomes one brief per lane, builder agents work in their own git worktrees, and separate reviewer agents check each wave's combined diff. I described the pattern in Supervisor agents catch what worker agents miss.

W1Aretire checkBskill-edit checkCstop ruleW2Dwrap-up + pre-pushW3Zreal run W1Aretire checkBskill-edit checkCstop ruleW2Dwrap-up + pre-pushW3Zreal run
Figure 3. The run's three waves and five lanes.

Wave 1 built the two checks and the adversarial tester's stop rule in parallel. The reviewers found 5 warnings, the false guard candidate among them, and one test that could not fail. A fix round closed all five; the builders proved each new test could go red by breaking the code it guards (14 such mutants, all caught). Wave 2 wired the checks into wrap-up and pre-push; its one warning was that a due line could be filed as a task, and a one-sentence fix closed it. Wave 3 was the real run with me. A final ship-check by a fresh agent found 0 critical issues.

The run took 2 h 25 min of active time and about 1.1 million tokens. One lane stopped on a network outage; its edits were still in its worktree, and resuming it by message finished the work.

What is still missing?

Three flaws in the counter, all found by the real run and filed for the scheduled fix routine:

  • Scratch scripts count as source edits, which inflates both test-first rates.
  • One chat saved as two files is counted twice.
  • The retire check lists a lesson whose guard only nudges, when the cut rule needs a guard that blocks.

Nothing was cut, so the prompt still has 366 bytes left.

Summary

  • A harness that only grows needs a check that lists what to cut, each with a reason, and a keep list so the same review isn't repeated.
  • Replaying guards over past calls misses any guard that keys on fields the replay doesn't send; count the denies the runtime already recorded.
  • A before/after rate around a skill edit means little until you label a sample: here precision was 18/20, and every wrong call had one cause.
  • Keep the checks cheap enough to run at every wrap-up, and leave every cut and label to a person or a fresh reviewer.
  1. Fix the scratch-script count first, then take the tdd reading again. Until then 55.9% is an upper bound.
  2. Make the retire check skip lessons whose guard only nudges.
  3. Take the due recover reading, with a fresh agent labelling the sample.