Your Coding Agent Follows What You Wrote Down. What It Misses Is Scope
In karasu, the architecture-diagram tool I develop with Claude Code, I keep design decisions as ADRs (Architecture Decision Records), failure patterns as a test perspective library (TPL), and coding rules for the agent u
In karasu, the architecture-diagram tool I develop with Claude Code, I keep design decisions as ADRs (Architecture Decision Records), failure patterns as a test perspective library (TPL), and coding rules for the agent under .claude/rules.
In the eight months since March, that record has grown to 497 ADRs, 192 TPL entries, and 21 rule files.
In July I designed an evaluation to check whether all this context actually raises quality, and promised to write again when I had results.
This time I ran it: I kept the code fixed, rolled only the record back to its April and July versions, and gave a coding agent the same issues 75 times.
What I learned
- Write down the decisions a change will step on. Volume alone does not help. The agent followed written decisions almost every time: across 75 runs it broke a decision that was in the record and clearly applied only 5 times. Most violations were against decisions that had not been written yet. Meanwhile, the record growing from 289 to 497 ADRs between July and November did not show up in the violation counts.
- Write how far each decision reaches. Most of the violations that remained at every point were not the agent ignoring a decision. The decision never said what it covered, so the agent read it narrowly and the reviewer read it broadly. The agent and I happened to read these the same narrow way, so the gap never caused trouble in day-to-day work.
- Treat disagreement between readers as a sign of a missing scope. When the reviewer and the implementation read the same decision differently, that decision is a candidate for one with no stated scope. I found these only by looking back; I'm going to try using the disagreement to find them sooner.
How I measured
I fixed karasu's code at its November 12 version and swapped only the record for its version at three points.
"The record" here is the ADRs, the TPL, .claude/rules, CLAUDE.md, and the documents that describe how development proceeds.
| Point | ADRs | TPL | rules |
|---|---|---|---|
| April 30 | 140 | 0 | 6 |
| July 31 | 289 | 94 | 11 |
| November 12 | 497 | 192 | 21 |
The requests were four real karasu issues plus one mechanical issue as a negative control, each run from design through implementation with headless Claude Code on Claude Opus 5.5.
Five requests × three points × five trials made 75 runs, at a cost of $315.
Scoring used the quality characteristics from ISO/IEC 25010 that documents should guard: functional appropriateness (violations of the relevant ADRs and rules), functional completeness (TPL perspectives missed), and security (rejected risks reintroduced).
Functional correctness (do the tests pass) was the negative control.
Two LLM judges scored the runs blind to the point in time: Claude Sonnet 5.5 on all 75, Claude Fable 5.2 on two per condition (κ = 0.51 to 0.60).
The answer key is what karasu knows today, which matters below.
Written decisions were followed
Correctness, completeness, and security did not move.
Every run passed the checks the original code passed, and neither judge found a security risk.
Only functional appropriateness moved, and only under the April record.
Average violations per run:
| Request | April | July | Third point |
|---|---|---|---|
| #3179 collapse the diagnostic banner | 3.8 | 0.8 | 0.8 |
| #3031 focus canvas | 9.2 | 6.2 | 6.4 |
| #3655 diagnostics for qualified endpoints | 2.8 | 2.4 | 1.0 |
| #3280 i18n for translate warnings | 0.6 | 0.6 | 0.2 |
| #3613 negative control | 0.8 | 0 | 0 |
April was the worst for all five, clearly so for #3179 (permutation test, p = 0.008).
From July to the third point, no request showed a difference, even though more than 200 ADRs and nearly 100 TPL entries were added in between.
So I looked at each violation.
Of the 86 April violations, 64 were against decisions that did not exist in the April record yet: the rule to use shadcn components, the rule against fireEvent in tests, the changeset rule.
An agent cannot follow a decision nobody has written.
For the 66 violations (across all three points) where the file did exist, I checked what that version said at the time, the judge's reasoning, and the implementation that actually shipped.
| Category | April | July | Third point | Total |
|---|---|---|---|---|
| Unclear scope (the decision does not say how far it reaches) | 8 | 10 | 11 | 29 |
| Not a violation under that version | 11 | 3 | 5 | 19 |
| Judge misread | 3 | 4 | 6 | 13 |
| Actually broke it | 0 | 1 | 4 | 5 |
"Not a violation under that version" means the rule changed later.
The April UI rule was about toolbar buttons, and the agent used the toolbar-btn class exactly as it said; today's rule says to use shadcn Button.
Counting those in, 75 of the 86 April violations were against decisions that had not been written yet or said something different then.
The agent did not get better at following decisions as the record grew.
What changed was what was written.
Write how far a decision reaches
Even under the newer records, about two violations per run remained on average, and the largest group among violations of written decisions was unclear scope.
The ADR marked as violated most often was ADR-607: the detail panel state lives in one place, so two panels never show at once.
The ADR explicitly rejects "close the other panel by hand when opening one."
In the focus canvas request, 13 of 15 runs kept the canvas in its own state and closed the detail panel by hand when it opened.
The implementation that actually shipped has the same shape.
I had seen the detail panel and the focus canvas as different things that might sit side by side, and I never imagined the canvas would collide with ADR-607.
The agent read the canvas as something other than a detail panel.
The judge read it as the same kind of panel.
ADR-607 does not say which reading is right.
The dialog rule showed the same pattern 9 times.
It asks for shadcn Dialog in modal dialogs, and the focus canvas is not modal, but the judge applied the rule to the letter anyway.
The language side had a version of this too.
In #3655, 10 runs added a new error that rejects <->, which had been silently accepted as ->.
The judge held 6 of them against the ADR that says to state language-version changes in the changeset, and let the other 4 pass.
My ruling is that <-> was never in the spec and rejecting it is a bugfix, not a language change; I hadn't even known it was getting through.
But no ADR said how to treat input that is outside the spec yet accepted, and the boundary between a language change and a diagnostics change was spread across five ADRs.
Looking back, when I started on version 2.0 of the syntax after shipping karasu 1.0, it was unclear which version of the syntax the agent was interpreting, and the back-and-forth was a real struggle.
That missing boundary probably had something to do with it.
None of these caused trouble in everyday work, because the agent and I read them the same narrow way.
They became visible only when a reader showed up who reads everything broadly and to the letter.
I would not have left them alone if I had known.
Use disagreement to find missing scope
The question, then, is how to notice a mismatch you never imagined.
This time I found these only because I spent time looking back.
A decision where the judge and the shipped implementation read things differently is a candidate for one with no stated scope.
That looks like a way to find these without waiting for a retrospective, and it is what I'll try next.
I'm starting by writing down how far ADR-607 and the dialog rule reach (karasu#3932).
Limits
- Five runs per condition show direction, not effect size
- The blinding is imperfect: the judge can guess the point in time from the filenames of ADRs the agent wrote
- The violation review was done by Opus 5.5, the same model as the agent; I ruled only on the #3655 cases
- Only the agent's path was measured, not tests written from the TPL or human review
How I kept the old records from leaking (cutting Git history, rewriting code comments, keeping the agent off GitHub) and the second experiment I dropped will go in a separate piece.
Takeaways
Measured, I can't say quality rises as the record grows.
The record only had an effect through what was written in it.
What decides whether it helps is whether the decisions a new change will step on are written down, and whether they say how far they reach.
The full write-up, with more detail on the setup, is on my blog.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.