Manuscript Offprint
arXiv:2610.32578Lessons Outlive Their Failures: A Case Study of Rules for AI Coding Agents
Abstract
AI coding agents increasingly work inside a harness: rule files such as AGENTS.md, on-demand skills, runtime hooks and automated checks. Most studies of harnesses look at a single point in time or at short benchmark runs. I report a six-week case study of my personal system of record, a plain-markdown repository that three AI agent tools edited daily under one shared rule set. I built a ledger of 118 agent failures, their fixes and whether they came back. I also tested the system's monthly LLM documentation audit against 47 known stale statements and 20 planted errors. Finally, I replayed five past failures in isolated git clones, with and without their fixes. All results come from one repository with three runs per condition, so I report them as exploratory. Stale documentation (drift) was the largest failure class (48 of 118), although 35 of those were found on one audit day. A single audit run found about half of the known drift (Claude Sonnet 5.5 mean: 50%), and at least 93% of its findings were correct. On Sonnet 5.5, the agent finished four of the five replayed tasks. In three of those four, the failure did not happen, with or without its fix. Only the stale-count failure came back without its check, and the check stopped it in every run. On older models, an agent drafted an em-dash once while the em-dash lint check was active, and the check rejected it. A written rule on run-time estimates did not change Sonnet 4.5's overestimates. These results suggest that harness lessons can outlive the failures they were written to fix, while drift persists and still needs mechanical checks. Tools that evolve a harness add lessons faster than they retire them, so they should re-test their rules from time to time and retire the obsolete ones.
1 Introduction
An AI coding agent does not act on its language model alone. It works inside a harness: the instructions it loads at session start, the skills it loads on demand, the hooks that run around its tool calls, and the checks that run before a commit is accepted [12, 43, 46]. Rule files in the repository, such as AGENTS.md and CLAUDE.md, have become the standard way to give these instructions [1, 26]. Recent studies describe what these files contain [8, 9, 18], how they grow over time [4, 6], and how they affect task cost and completion [13, 24, 48].
Two gaps remain. First, almost all existing studies are cross-sectional: they mine snapshots of open-source repositories or measure single-turn benchmark runs. Galster et al. call for longitudinal and experimental studies of harnesses in daily use [12]. Second, people who maintain a harness respond to agent failures by adding lessons. A lesson is either a prose rule that the model reads or an executable check that the runtime enforces. Recent frameworks automate this loop: Harness keeps a growing library of lessons across tasks [45], and Harness-R1 writes executable harness patches from failure traces [34]. Yet little is known about what happens to a lesson after it enters the harness. Does the failure come back? Is the lesson still needed after the model is upgraded?
To answer these questions, I studied one harness in daily use for six weeks. The system is my personal system of record: one git repository of plain markdown files and Python scripts that holds my job search, my language learning and my life administration. Three agent runtimes (three different AI agent tools) edit this repository daily under one shared rule set. From the start of the study period, I enforced a logging policy: every repeatable agent failure and its fix had to be recorded with the reason. The commit history and change logs therefore record every harness change made through a commit or a log entry.
I investigate three research questions:
RQ1 Which agent failures occur, which come back after a fix, and what side effects do the fixes have?
RQ2 How much stale documentation (drift) does an automated LLM audit find?
RQ3 Does a past fix still change agent behaviour when the original failure is replayed, and does this depend on the model version?
The paper makes three contributions. First, a ledger of 118 agent failures, coded in two LLM passes whose disagreements I resolved, with daily measurements of how much rule text the harness holds (Section 4). Second, a test of how much drift an LLM documentation audit finds, against an answer key of 47 real stale statements and 20 planted errors. Third, a replay of five past failures in throwaway git clones, with and without their fixes, on several model versions (a counterfactual replay). The results (Section 5) point to one main conclusion: lessons can outlive their failures. A behavioural failure is a mistake in what the agent does, such as quoting an outdated decision. On the current model, I could replay one behavioural failure with its written rule removed, and it did not recur. Two other failures did not occur even without their fixes. Documentation drift, by contrast, comes from how the repository changes, not from how the agent behaves. It came back again and again as the repository changed, a single LLM audit pass caught only half of it, and code checks were still needed to block it.
Do rules work? Evidence on the effectiveness of prose rules is mixed. Lulla et al. report reduced execution time and token consumption when an AGENTS.md file is present [24]. Conversely, Gloaguen et al. find that repository context files do not consistently improve task resolution rates while increasing token costs by more than 20% [13]. Zhang et al. observe that the only standalone rules that improved performance were explicit prohibitions, and that randomly sampled rules performed comparably to human-curated ones [48]. Converting natural-language instructions into executable verification checks increases compliance from 67.0% to 88.3% in ContextCov [36], while runtime policy enforcement in AgentSpec prevents the vast majority of unsafe tool invocations [41]. My counterfactual replay examines this same contrast between prose rules and executable code checks inside a lived production repository.
Automated harness evolution. Several recent systems automate the refinement of harnesses. Harness iteratively adapts harness configurations per task and accumulates a persistent library of lessons for future runs [45]. Lin et al. demonstrate in Agentic Harness Engineering that performance gains stem primarily from tool design, middleware, and memory rather than system-prompt edits [22]. Kang et al. identify harness-level forgetting, in which a new harness modification degrades previously working behaviour, and guard each update with a regression check [19]. Wang et al. further show that automated harness evolution frequently overfits to training benchmarks and fails to outperform simple baselines on held-out tasks [42]. Existing automated harness systems add lessons or patches and check them against earlier behaviour under a fixed model. To my knowledge, none evaluates whether accumulated lessons remain necessary after the underlying language model is updated.
Agent memory and documentation staleness. Agent memory architectures store past episodes as retrievable text [15, 29, 30, 38], yet Chao et al. demonstrate that LLM agents struggle to recognise when stored facts have become outdated [7]. In software engineering, detecting outdated code element references [39], stale comments [16], and code-documentation inconsistencies [20] is a long-standing problem. Because an agent treats its harness and repository documentation as ground-truth instructions, documentation drift can directly induce agent errors.
Agent failures and the closest study. Prior work has established failure taxonomies for multi-agent pipelines [5] and evaluated destructive tool actions or false completion reports in red-team sandboxes [32, 35, 49]. Interactive permission prompts carry their own human factors cost: users approve 93% of prompts, and automated classifiers still miss some over-eager edits [17]. Field studies indicate that coding agents increase short-term commit velocity [14, 27], while Cursor adoption also brings persistent increases in static-analysis warnings and code complexity [14]. The closest study to mine is Vasilopoulos [40], who describes building a codified context infrastructure with an always-loaded constitution, retrieval hooks, and on-demand specifications across 283 sessions in a single-developer codebase. Vasilopoulos reports that this infrastructure prevented repeated failures in four case studies. The present study differs by tracking failure recurrence by fix type, evaluating automated drift detection against a ground-truth answer key, and replaying historical failures across model versions.
3 The system I studied
The system under study is a private git repository of plain markdown documents and small Python scripts. It is my single system of record for job applications, CV generation, language study and administrative deadlines. Three agent runtimes work on the repository: Claude Code and Antigravity interactively on a laptop, and a headless server agent, one that runs without a chat window, for scheduled background jobs. Git is the only synchronisation layer between the laptop and the server, with a local systemd timer pulling and pushing changes every few minutes.
Figure 1 shows the six stages of the shared harness in the order they act during work. At session start (Stage 1), every runtime loads AGENTS.md, the always-loaded rule file, and a session hook adds upcoming deadlines from a central table. During a task (Stage 2), the agent loads any of 11 task-specific workflow files (SKILL.md files) on demand. One of these skills, focus-guard, tells the agent to stop and ask before non-essential tooling work when a deadline in DEADLINES.md is close. I call it the deadline focus rule. Before every shell command (Stage 3), a pre-tool guard hook (guard.py) inspects the command and blocks destructive operations in all three runtimes. After file edits in Claude Code (Stage 4), a post-edit hook (coupled.py) reminds the

Figure 1: Architecture of the harness. Stages run left to right in the order they act. Blue stages are written instructions that the model reads. Orange stages are triggered by code: Stages 3 and 5 block an action whatever the model does, and Stage 4 only prints a reminder. The dashed orange-and-blue stage is a scheduled script that runs a read-only LLM audit. Bottom: the add-only lesson loop, through which failures become new rules or code checks after my approval.
agent of documentation files that usually need a matching update. At commit time (Stage 5), a pre-commit linter (lint.py) checks every commit before git accepts it. It runs 17 deterministic checks on file sizes, cross-file counts, dead links, forbidden punctuation and secret patterns. I call each of these a lint check. Finally, once a month (Stage 6), a scheduled script starts a headless read-only agent that audits the documentation against the file tree and git history. Stages 3 and 5 are deterministic code guardrails that act regardless of model compliance. Stage 4 is a code-triggered reminder whose effect depends on the model reading it, and Stages 1 and 2 rely on the model following written instructions.
Two explicit governance policies shaped how the repository evolved:
-
Promote the lesson: whenever an agent makes a mistake that could plausibly recur, the fix must be encoded as either a prose rule or an executable check, and logged with its rationale in the area change log.
-
Records are appended, rules are asked: agents have standing permission to append log entries, vocabulary items, or job leads, but any edit to a rule file, skill, or check requires my explicit approval in the conversation.
The harness had no automated mechanism to retire old lessons; rules were pruned only once during a manual simplification pass (Section 5).
The repository was created on 28 July 2026 and had 929 commits by 15 October 2026, of which 336 were automated sync commits. The first weeks had little activity: 17 commits between 28 July and 8 August, then a four-week pause. So I study the six weeks from 4 September, when I introduced AGENTS.md, to 15 October 2026. This window contains 912 commits and 115 of the 118 recorded failures. Two incidents predate it, and one was first seen on 19 October during second-pass coding.
4 Method
I use an autobiographical, single-case design that follows one system over time [23, 28, 33, 37]. It combines three studies, one for each of RQ1 to RQ3.
4.1 The failure ledger and rule growth (RQ1)
To build the failure ledger, a table with one row per failure, I searched the git commit log, the area change logs, two documentation audit reports and my daily diary up to 15 October 2026. A keyword filter and a first structured extraction pass with Claude Sonnet 5.5 identified the candidate incidents. For each incident, the ledger records the date it was first seen, its failure category, how it was detected, the fix, the fix type (rule, hook, lint check, script, configuration or none), and whether a failure of the same kind recurred before 15 October 2026. I marked an incident as not recurring (“Did not”) only if at least seven days had passed since its fix. If fewer than seven days had passed, or if the records gave no evidence either way, I marked it Unknown.
To check how reliable this coding was, I wrote a codebook with ten categories, that is, written rules for assigning each incident to a class. A blind second coding pass (Claude Opus 5.5) then coded all incidents again. It saw only the incident summaries written in the first pass and the fix descriptions, not the first labels. The second pass also judged recurrence for a seeded random sample of 30 incidents, working directly from the git history and logs. The two passes disagreed on 49 fields: 32 on category, 9 on fix type and 8 on recurrence. I resolved each one with the codebook rules. Then I checked a random sample of 30 resolved entries by hand against plain-English incident descriptions. Finally, I wrote a script that counts the words in AGENTS.md and in all rule text combined (AGENTS.md, nested rule files and on-demand skills) at the end of each day in the git history.
4.2 How much drift an LLM audit finds (RQ2)
The repository’s monthly documentation audit runs a headless agent with a fixed prompt and read-only file and git tools. I measured its recall, the share of known stale statements it finds, and its precision, the share of its findings that are correct. For this, I made an isolated clone of the repository at commit 769dc91 on 14 October 2026, just before three commits that fixed a batch of stale documentation. The answer key holds 47 real stale statements. Each was in the audit’s scope, already existed at the snapshot, and was corrected by one of those three commits. Eleven of the 47 are borderline. One of the three commits fixed what the first monthly audit had found, so an earlier LLM audit had already found 22 of the 47 items. This favours drift that an LLM audit can detect.
I also planted 20 synthetic drift errors of seven kinds: cron schedules (3), dead file paths (6), item counts (4), renamed identifiers (3), a modified governance rule (1), a deadline date (1) and described script behaviour (2). Each planted error contradicted another document, the directory tree or the git history. Git could have shown the agents which files I had changed. To hide this, I marked those files with git update-index --skip-worktree. Then git status and git diff showed a clean working tree. I ran the audit three times on each of three models: Claude Haiku 5.5, Claude Sonnet 5.5 and Claude Opus 5.5. Opus handed its file reading to Haiku subagents, smaller helper agents that it starts itself. An Opus evaluation pass scored each audit report against the 67-item key. As a spot check, five key items and six match scores were verified against the snapshot. Then I reviewed the key, the match scores and the extra findings before computing precision. A finding counts as correct if it matches a key item, a planted error, or a true stale statement outside the key. Precision is the number of correct findings divided by all findings.
4.3 Replaying past failures with and without their fixes (RQ3)
To test whether past fixes still change agent behaviour on current and older models, I chose five past failures. Each had a clear task that triggered it and a self-contained fix commit:
-
Stale skill counts: forgetting to update hardcoded skill counts in documentation after creating a new skill (fix: pre-commit lint Check 12).
-
Superseded decision: quoting an outdated architectural verdict from an earlier log entry when a newer entry reversed it (fix: a prompt rule requiring agents to check the newest log entry first).
-
Forbidden punctuation: writing an em-dash in a drafted cover letter despite a prompt prohibition (fix: pre-commit lint Check 9 blocking em-dashes in letters).
-
Destructive git reset: running git reset --hard after a stopped rebase and wiping uncommitted notes (fix: the guard.py pre-tool hook).
-
Run-time overestimation: giving inflated multi-hour estimates for fast mechanical tasks (fix: a prompt rule that sets 1 to 5 minutes as the normal run-time estimate and asks for the real time when an estimate is off by or more).
For each failure, I built two throwaway git clones with no network remote. Condition A is the exact repository state just before the fix. Condition B is the same state with only that fix added (cherry-picked, in git terms). Both clones got the same neutral commit message, so the git log could not reveal the condition. I ran each original task headless three times per condition on Claude Sonnet 5.5 (30 runs). To test whether model upgrades explain why failures did not recur, I repeated the em-dash and run-time estimate scenarios (three runs per cell) on two older models, Claude Sonnet 4.5 and Claude Sonnet 5, and on a second vendor's runtime, Gemini 3.8 Flash in Antigravity.
4.4 Guardrail counts from session logs
To measure how often the runtime guardrails fired in normal work, I parsed 74 local Claude Code session transcripts recorded between 20 September and 14 October 2026. These transcripts contain personal data, so I extracted only counts of hook runs and blocked shell commands. No transcript text is quoted or released.
5 Results
5.1 Failures and rule growth (RQ1)
Table 1: The ledger of 118 agent failures by category, after I resolved the coding disagreements (4 September to 15 October 2026, plus two earlier incidents and one first seen on 19 October). Recurred: a failure of the same kind happened again after the fix. Did not: none happened in at least seven days after the fix. Unknown: for 53 incidents, fewer than seven days passed between the fix and 15 October; for the other 18, the records give no evidence either way. Two codebook classes with one incident each (malformed output, crash) are merged in the last row.
| Category | Failures | Share | Recurred | Did not | Unknown |
|---|---|---|---|---|---|
| Stale documentation (drift) | 48 | 40.7% | 13 | 0 | 35 |
| Wrong fact stated by an agent | 20 | 16.9% | 10 | 1 | 9 |
| Runtime or provider failure | 14 | 11.9% | 4 | 1 | 9 |
| Other | 14 | 11.9% | 5 | 2 | 7 |
| Sync and concurrency | 6 | 5.1% | 3 | 0 | 3 |
| Destructive or risky action | 6 | 5.1% | 1 | 1 | 4 |
| Rule violation | 4 | 3.4% | 2 | 1 | 1 |
| Secret or privacy risk | 4 | 3.4% | 1 | 2 | 1 |
| Malformed output or crash | 2 | 1.7% | 0 | 0 | 2 |
| Total | 118 | 100.0% | 39 | 8 | 71 |
Table 1 summarises the 118 failures, and Table 2 shows how well the two coding passes agreed. On the scale of Landis and Koch [21], agreement is substantial for failure category
Table 2: Inter-pass agreement between the initial extraction pass and the blind second coding pass (Cohen's [10]). The second pass surfaced the 118th failure during its log review, so is computed over the 117 shared rows.
| Coded field | Evaluated rows | Raw agreement | Cohen's κ |
|---|---|---|---|
| Fix type (6 classes) | 117 | 92.3% | 0.89 |
| Failure category (10 classes) | 117 | 72.6% | 0.65 |
| Recurrence (30-row random sample) | 30 | 73.3% | 0.56 |
| Subset where both passes gave Yes or No | 11 | 100.0% | 1.00 |
, almost perfect for fix type and moderate for recurrence . Most category disagreements involved the catch-all class other (18 of 32). The boundary between stale documentation and wrong facts accounted for 5. Every disagreement on recurrence had one pass marking “Unknown” while the other cited concrete evidence. On the 11 sampled rows where both passes gave a definite Yes or No, they agreed on all 11. In my check of 30 randomly selected rows, all 30 resolved category and fix-type labels matched the incident records. Of the 118 incidents, 23 were fixed by adding or editing a prose rule, 38 by executable code (hooks, lint checks, scripts or service configurations), and 57 by correcting the affected document or record directly, without a new harness lesson.

Figure 2: Top: repository commits per calendar week (ISO week numbers). Bottom: recorded failures per week by category, with the mechanical guardrails added each week. W42 runs to 15 October 2026. Its spike comes from running two full-repository documentation audits on 14 October. Three incidents fall outside the plot: two before 4 September and one found on 19 October during second-pass coding.
Drift is the largest failure class and keeps returning after new checks. Stale documentation accounts for 48 of the 118 failures (40.7%) and recurred throughout the six weeks. Each new pre-commit check targeted one form of staleness. Within one to nine days, a different form appeared. On 24 September I added a check for coupled files, files that must change together. Next came stale skill and script counts, fixed by new checks on 3 October. Then came references to retired script names, fixed on 9 October. On 14 October I added the post-edit hook and ran two LLM audits. They found 38 more stale statements, which I recorded as 35 drift incidents (Figure 2). Each code check removed the narrow pattern it encoded. Statements that no check covered kept going out of date whenever the workflows they described changed.
Guardrails introduce their own operational costs. The ledger shows three kinds of guardrail cost:
-
False positives: guard.py matches raw command strings with regular expressions, so it blocked a harmless documentation edit that only quoted a forbidden command inside a commit message or search string. The same false positive recurred weeks later during this study.
-
Fix-induced failures: To stop laptop agents from editing out-of-date local copies, I added a background systemd sync timer. That timer kept running git pull --rebase --autostash, a command that saves local edits, pulls and re-applies them, while agent sessions were active. The sync log shows 197 autostash events. Some of them caused file conflicts mid-session until 14 October, when I added a lock check that pauses background syncs while an agent is active. This interference parallels the harness-level regression described by Kang et al. [19].
• Enforcement gaps: The guard regex for git reset --hard matched the subcommand directly after git, missing invocations that passed global flags first (such as git -C <path> reset --hard). Similarly, when an agent purged a personal identifier from a tracked file on 24 September, it recorded the identifier itself inside the change-log entry documenting the purge, a location the secret scanner did not check. Despite these gaps, session telemetry shows that guard.py blocked 13 of 19 recursive deletion commands (rm -rf) and all four attempted force-pushes.

Figure 3: Daily word count of the always-loaded rule file (AGENTS.md) versus total rule text across the harness (including on-demand skills and directory-specific AGENTS.md files). A third-party skill (about 10,000 words) present for two days is excluded because it held no system lessons.
Capping the main rule file coincided with growth in on-demand skills. Figure 3 tracks the amount of rule text over the 41 days. The always-loaded AGENTS.md file grew nearly fourfold, from 916 words on Day 0 to a peak of 3,543 words during Day 14 (18 September). That day, I added a pre-commit lint check that caps the size of AGENTS.md. Its word count fell to 1,927 words by the end of Day 14 and to 1,435 words by Day 41. Total rule text did not shrink when the cap came in. Rules moved into on-demand SKILL.md files and nested directory rules, as standard vendor guidance advises [3, 31]. Total rule text grew 3.5-fold, from 4,921 words on Day 0 to a peak of 17,366 words on Day 18. On Day 20 (24 September), I simplified the rules by hand: I merged repeated clauses and cut long explanations. This cut total rule text by 32% to 11,877 words. Right after that, steady growth resumed and added another 27% by Day 41, to 15,122 words. This matches Chakrabarti's cross-repository finding that rule text keeps accumulating [6].

Figure 4: Recall of the monthly LLM documentation audit across three models on real drift (47 ground-truth items) and planted errors (20 synthetic items). Bars show the mean of three separate runs; dots show individual runs. *Opus 5.5 delegated file reading to Haiku subagents.
5.2 How much drift an LLM audit finds (RQ2)
Figure 4 shows the recall of the read-only LLM audit on the 14 October snapshot. Claude Sonnet 5.5 did best. A single Sonnet 5.5 audit found 49.6% of the 47 real drift items on average (22 to 25 items per run). Together, the three Sonnet 5.5 runs found 63.8% (30 of 47 items). Claude Haiku 5.5 averaged 26.2% and varied widely (7 to 18 items). Claude Opus 5.5 averaged 41.1% (16 to 21 items). In these runs, Opus handed file reading to Haiku subagents. This may explain why Opus scored below Sonnet 5.5, but I did not test it. All nine runs, on all three models, missed 12 of the 47 real drift statements. Over all nine runs together, the audits found 30 of the 37 drift items that contradicted another current file in the repository, 2 of the 5 items that only git history could show, and 3 of the 5 items visible from both sources.
The planted errors were much easier to find. Mean recall was 65.0% on Haiku 5.5, 80.0% on Sonnet 5.5 and 83.3% on Opus 5.5. Pooled over all nine runs (180 item checks), detection depended strongly on the kind of error:
- Structural and cross-file mismatches: mismatched cron schedules (27 of 27, 100%), renamed identifiers (25 of 27, 93%), dead file paths (43 of 54, 80%), modified rule text (7 of 9, 78%), and wrong item counts (26 of 36, 72%) were detected reliably because a directory listing or paired table directly contradicted them.
• Semantic and temporal drift: inaccurate descriptions of script behaviour (6 of 18, 33%) and an outdated deadline date (3 of 9, 33%) were missed in two-thirds of runs.
Precision was high in every run. Across all nine runs, the audits raised only 8 false alarms (precision 0.93 to 1.00 per run). They also found 9 genuine stale statements that my answer key had missed.
5.3 Replaying past failures on several models (RQ3)
Table 3 shows the replay results on Claude Sonnet 5.5. Sonnet 5.5 finished four of the five tasks. Of these four, only one failure still occurred without its fix: stale skill counts. In Condition A, without lint Check 12, all 3 runs added the new skill but left one or two hardcoded skill counts out of date elsewhere in the documentation. In Condition B, with Check 12, the pre-commit linter blocked the first commit attempt and printed the exact file lines and the true count on disk. The agent then corrected every stale number and committed (0 of 2 failures). A third run declined the task under the deadline focus rule.
The other three finished scenarios did not reproduce in any run on Sonnet 5.5, with or without the fix (0 of 3 in both A and B). Asked about a policy decision that a newer log entry had reversed, Sonnet 5.5 read the latest entry first in all 6 runs, without needing the rule. Drafting
Table 3: Replay of five past failures on Claude Sonnet 5.5 (three runs per condition). Each cell gives the number of runs in which the failure occurred: without the fix (Condition A) and with only the fix added (Condition B).
| Historical failure scenario | Fix mechanism | No fix (A) | With fix (B) |
|---|---|---|---|
| 1. Stale skill counts after adding a skill | Pre-commit lint check | 3 of 3 | |
| 2. Quoting a superseded log decision | Prompt rule | 0 of 3 | 0 of 3 |
| 3. Em-dash in a drafted cover letter | Pre-commit lint check | 0 of 3 | 0 of 3 |
| 4. Destructive reset after stopped rebase | Pre-tool guard hook | 0 of 3 | 0 of 3 |
| 5. Run-time estimate at least actual | Prompt rule |
A third run in Condition B declined the task due to the deadline focus rule (Section 3).
In all six runs, Sonnet 5.5 triggered the deadline focus rule and declined to execute the task (after giving a brief 5-minute estimate or no estimate). On Gemini 3.8 Flash, the focus rule declined 3 of 6 runs, and none of the 3 executed runs overestimated the run time (Table 4).
Table 4: Cross-model replay of two failure scenarios (three runs per cell). Em-dash counts committed cover letters containing an em-dash; Estimate counts run-time estimates exceeding twice the actual execution time.
| Model and runtime | Em-dash (lint check) | Estimate (prompt rule) | ||
|---|---|---|---|---|
| A (no fix) | B (fix) | A (no fix) | B (fix) | |
| Claude Sonnet 4.5 (Claude Code) | 1 of 3 | 0 of 3 | 2 of 3 | 2 of 3 |
| Claude Sonnet 5 (Claude Code) | 0 of 3 | declined | declined | |
| Claude Sonnet 5.5 (Claude Code) | 0 of 3 | 0 of 3 | declined | declined |
| Gemini 3.8 Flash, medium (Antigravity) | 0 of 3 | 0 of 3 | ||
In one Condition B run, Sonnet 5 drafted a letter containing an em-dash; the pre-commit lint check rejected the commit, and the agent removed the character before committing. Executed runs only: the deadline focus rule declined 1 run in Condition A and 2 in Condition B.
cover letters, it wrote no em-dash in any of the 6 runs. In this scenario, the prose ban on em-dashes was present in both conditions, so the scenario tests only the lint check, not whether the prose rule is still needed. Facing a stopped git rebase and uncommitted local notes, no run tried git reset --hard. In all 6 runs, the model ran git status and git diff, saved the uncommitted changes to a patch file and resolved the repository cleanly, so guard.py never had to fire. No run reached the destructive command, so this scenario does not test whether the guard is still needed.
The fifth scenario was run-time estimation. The agent read the date from the host clock (19 October 2026), so the deadlines in the snapshot's DEADLINES.md looked imminent. Sonnet 5.5 started the repository's focus-guard skill and declined the task in all 6 runs. This scenario therefore gives no measurement of the estimation rule on Sonnet 5.5.
Table 4 shows the em-dash and run-time estimation scenarios replayed on older Claude models and on Gemini 3.8 Flash. The older Sonnet models (Sonnet 4.5 and Sonnet 5) still wrote em-dashes in 2 of 12 cover letter drafts. One was in Condition A on Sonnet 4.5, and it was committed. The other was in Condition B on Sonnet 5, where the pre-commit lint check rejected it and the agent fixed it. Sonnet 5.5 and Gemini 3.8 Flash together wrote no em-dash in 12 drafts. For run-time estimation, Sonnet 4.5 did the task instead of declining it. It overestimated the run time by at least in 2 of 3 runs in Condition A and in 2 of 3 runs in Condition B, so the prompt rule made no difference. Gemini 3.8 Flash declined 3 of the 6 estimation runs under the same focus rule. In the 3 runs it did, no estimate exceeded twice the actual time (1 to 3 minutes estimated against 1.5 to 6 minutes actual). On the older models, then, the lint check stopped the one em-dash that reached a commit attempt (Sonnet 5). The prose rule did not change the estimates on Sonnet 4.5, the only older model that did the estimation task.
6 Discussion
Lessons may outlive the model failures that motivated them. On the current model, three of the four finished failures did not occur in my replay, with or without their fixes. Three runs per condition cannot show that a failure is gone, only that it did not occur in those runs. And as Section 5 notes, the em-dash and reset scenarios do not test whether their lessons are still needed. Only the superseded-decision scenario removed a prose rule and reached its trigger. The harness may carry prose rules and hooks against mistakes that newer models avoid on their own in this setup. This complements the continuous rule growth that Chakrabarti documents [6] and that Figure 3 shows. Lessons are cheap to add after an incident, but nothing signals when a model upgrade has made them obsolete. Harness rules should therefore record the model version that motivated them and carry a date for a re-test. Counterfactual git replay is a cheap retirement test: 30 headless sessions across five scenarios took 10 minutes and cost about $3.55 in API-equivalent tokens.
Drift comes from how the repository changes. In the one drift scenario I replayed, the stale-count failure recurred in all three unguarded runs on Sonnet 5.5. I did not replay drift on other models. Drift is also the largest class in the ledger (40.7%), and a single LLM audit pass misses half of it. A formatting quirk or a rash shell command is a matter of agent behaviour, whereas drift follows from keeping natural-language documentation next to files that keep changing. Every added skill, renamed script or updated policy silently makes statements in other files wrong. Agents struggle to notice when stored context has become stale [7], and LLM audits miss most drift that only git history shows. An invariant is a fact that must always hold, such as a count that matches the files on disk. For any invariant that can be written in code, a deterministic pre-commit check therefore remains the only reliable defence.
Code checks worked where a written rule did not. Three runs per cell give an exploratory signal, not a high-powered statistical comparison. Still, the cross-model replay agrees with larger benchmark studies in which executable checks beat prompt guidance [22, 36]. Whenever a check was active and an agent produced an out-of-date skill count (Sonnet 5.5) or a forbidden em-dash (Sonnet 5), the pre-commit linter rejected the commit with a specific error message. The agent then fixed the violation at once. By contrast, the prompt rule on time estimates did not reduce overestimation on Sonnet 4.5.
What this means for tools that update rules automatically. Self-evolving harness frameworks such as Harness and Harness-R1 automate the adding of lessons [34, 45]. My findings point to two additions for such systems:
-
Automated lesson retirement: when a base model is upgraded, the harness should replay the stored trigger task for each lesson without that lesson active, archiving prompt rules that no longer change outcomes.
-
Checks before a new lesson goes live: fixes can cause false positives or interfere with operations (such as the 197 background autostash runs that interfered with active sessions). A candidate harness edit should therefore pass both human approval and a regression check, a test that earlier behaviour still works [19], before it is deployed.
The same rules with a second vendor's model. Although the harness was written mainly in Claude Code sessions, Gemini 3.8 Flash in Antigravity followed the same AGENTS.md rules and on-demand skills without changes in the two scenarios I replayed on it, including the deadline focus skill. This suggests, but does not establish, that a markdown harness can govern agents across model providers and client runtimes.
7 Threats to validity
Single-user system. All data come from one repository that I designed, maintained and studied myself [28, 37]. A written codebook and a blind second coding pass support consistent classification ( and 0.89). They do not remove the selection bias of studying one system, and the findings cannot be generalised statistically to software repositories with many developers.
Researcher roles. I designed the logging policy, wrote most fixes, chose the replay scenarios, approved the answer key and resolved every coding disagreement. The blind second coding pass and the planted errors reduce, but do not remove, the risk that my expectations shaped these data. I did not measure the recall of the keyword search that seeded the ledger.
Under-reporting in the ledger. I constructed the failure ledger from git commits, change logs, and audit reports recorded during daily work. Minor agent mistakes that I corrected conversationally in chat without creating a log entry or commit are absent from the dataset.
Short observation window and one heavy audit day. The study covers six weeks. Incidents fixed in the final week therefore had fewer than seven days to recur. I marked them Unknown, as I did incidents with no evidence either way. Recorded failure counts also depend on how hard I looked. The two full-repository LLM audits on 14 October found 38 stale statements on a single day, which I recorded as 35 drift incidents (Figure 2). Without that day, drift accounts for 13 of 83 incidents.
Few runs, and LLMs as measuring tools. The audit benchmark and the replay both use three runs per cell. LLMs also play several roles in this study: coding assistants, audit scorers and replayed agents. In Table 3, 3 of 3 failures against 0 of 2 gives a one-sided Fisher's exact . That is a directional signal, short of statistical significance.
Other explanations for the replay results. When a past failure does not reproduce in replay, I cannot fully separate two causes: a newer model, or a reconstructed prompt that missed a subtle trigger from the original session. Also, the original incidents happened on Claude Opus models and in Antigravity, while the main replay used Claude Sonnet and Gemini Flash. Finally, each replay clone checked out a past commit, but the agent runtime read the host system clock (19 October 2026). This made past deadlines in DEADLINES.md look imminent. The focus-guard skill then declined non-essential tooling work in 7 of the 30 Sonnet 5.5 replay runs (3 in Condition A, 4 in Condition B), in all 6 Sonnet 5 estimation runs and in 3 of 6 Gemini estimation runs. Future replays should run under a faked system clock (for example libfaketime) to remove this problem.
Ground-truth key completeness. The 47-item audit answer key was defined by the stale statements corrected on 14 October. It therefore under-counts true repository drift by at least the 9 additional valid stale statements that the nine audit runs uncovered.
8 Conclusion
For six weeks of daily use, I studied my personal system of record. A shared rule file, on-demand skills, runtime hooks and pre-commit checks governed it. In that time I recorded 118 agent failures. Documentation drift was the largest failure class (40.7%, most of it found on one audit day). It came back after each new check, and single LLM audit passes missed about half of it. I replayed five past failures in isolated git clones on a current model. The agent finished four of the tasks. In three of them, the failure did not reproduce in three runs per condition, with or without the fix. The one drift scenario recurred in every unguarded run, and its pre-commit lint check stopped it every time. As language models improve, harnesses may accumulate rules against mistakes the models no longer make, while structural drift continues. People and tools that maintain harnesses should therefore record which model version required each lesson, enforce structural invariants in executable code, and regularly replay and retire obsolete prompt rules.
Data availability
Because the studied repository contains private personal records, the raw repository and session transcripts cannot be made public. An anonymised replication package containing the adjudicated 118-row failure ledger (with dates converted to study day numbers and domain paths abstracted), the audit recall scores, and the replay and analysis scripts is available from the author upon request. A public template of the harness architecture, stripped of all personal data, is available at https://github.com/avtak/divan.
References
[1] Agentic AI Foundation. AGENTS.md. Format specification website, stewarded by the Agentic AI Foundation under the Linux Foundation, 2026. URL https://agents.md. Accessed 19 October 2026.
[2] Anthropic. Hooks reference. Claude Code documentation, 2026. URL https://code.claude.com/docs/en/hooks. Accessed 19 October 2026.
[3] Anthropic. How Claude remembers your project. Claude Code documentation, 2026. URL https://code.claude.com/docs/en/memory. Accessed 19 October 2026.
[4] Guangzong Cai, Ruiyin Li, Peng Liang, Zengyang Li, and Mojtaba Shahin. Rule Taxonomy and Evolution in AI IDEs: A Mining and Survey Study, 2026. URL https://arxiv.org/abs/2606.12231.
[5] Mert Cemri, Melissa Z. Pan, Shuyi Yang, Lakshya A. Agrawal, Bhavya Chopra, Rishabh Tiwari, Kurt Keutzer, Aditya Parameswaran, Dan Klein, Kannan Ramchandran, Matei Zaharia, Joseph E. Gonzalez, and Ion Stoica. Why Do Multi-Agent LLM Systems Fail?, 2025. URL https://arxiv.org/abs/2503.13657.
[6] Kushal Chakrabarti. Why Does CLAUDE.md Keep Growing? Catastrophic Remembering in Agentic Coding, 2026. URL https://arxiv.org/abs/2608.11095.
[7] Hanxiang Chao, Yihan Bai, Rui Sheng, Tianle Li, and Yushi Sun. STALE: Can LLM Agents Know When Their Memories Are No Longer Valid?, 2026. URL https://arxiv.org/abs/2605.06527.
[8] Worawalan Chatlatanagulchai, Kundjanasith Thonglek, Brittany Reid, Yutaro Kashiwa, Pattara Leelaprute, Arnon Rungsawang, Bundit Manaskasemsak, and Hajimu Iida. On the Use of Agentic Coding Manifests: An Empirical Study of Claude Code, 2025. URL https://arxiv.org/abs/2509.14744. Published in Proceedings of the 26th International Conference on Product-Focused Software Process Improvement (PROFES) 2025.
[9] Worawalan Chatlatanagulchai, Hao Li, Yutaro Kashiwa, Brittany Reid, Kundjanasith Thonglek, Pattara Leelaprute, Arnon Rungsawang, Bundit Manaskasemsak, Bram Adams, Ahmed E. Hassan, and Hajimu Iida. Agent READMEs: An Empirical Study of Context Files for Agentic Coding, 2026. URL https://arxiv.org/abs/2511.12884.
[10] Jacob Cohen. A Coefficient of Agreement for Nominal Scales. Educational and Psychological Measurement, 20(1):37–46, 1960. doi: 10.1177/001316446002000104.
[11] Helio Victor F. dos Santos, Vitor Costa, Joao Eduardo Montandon, Luciana Lourdes Silva, and Marco Tulio Valente. Configuration Smells in AGENTS.md Files: Common Mistakes in Configuring Coding Agents, 2026. URL https://arxiv.org/abs/2606.15828. SCAM 2026.
[12] Matthias Galster, Seyedmoein Mohsenimofidi, Jai Lal Lulla, Muhammad Auwal Abubakar, Christoph Treude, and Sebastian Baltes. Harness Engineering for Agentic AI Coding Tools: An Exploratory Study, 2026. URL https://arxiv.org/abs/2602.14690. Based on a paper in AIware 2026.
[13] Thibaud Gloaguen, Niels Mündler-Sasahara, Mark Niklas Müller, Veselin Raychev, and Martin Vechev. Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?, 2026. URL https://arxiv.org/abs/2602.11988.
[14] Hao He, Courtney Miller, Shyam Agarwal, Christian Kästner, and Bogdan Vasilescu. Speed at the Cost of Quality: How Cursor AI Increases Short-Term Velocity and Long-Term Complexity in Open-Source Projects, 2026. URL https://arxiv.org/abs/2511.04427. 23rd International Conference on Mining Software Repositories (MSR '26), April 13–14, 2026, Rio de Janeiro, Brazil.
[15] Yuyang Hu, Shichun Liu, Yanwei Yue, Guibin Zhang, Boyang Liu, Fangyi Zhu, Jiahang Lin, Honglin Guo, Shihan Dou, Zhiheng Xi, Senjie Jin, Jiejun Tan, Yanbin Yin, Jiongnan Liu, Zeyu Zhang, Zhongxiang Sun, Yutao Zhu, Hao Sun, Boci Peng, Zhenrong Cheng, Xuanbo Fan, Jiaxin Guo, Xinlei Yu, Zhenhong Zhou, Zewen Hu, Jiahao Huo, Junhao Wang, Yuwei Niu, Yu Wang, Zhenfei Yin, Xiaobin Hu, Yue Liao, Qiankun Li, Kun Wang, Wangchunshu Zhou, Yixin Liu, Dawei Cheng, Qi Zhang, Tao Gui, Shirui Pan, Yan Zhang, Philip Torr, Zhicheng Dou, Ji-Rong Wen, Xuanjing Huang, Yu-Gang Jiang, and Shuicheng Yan. Memory in the Age of AI Agents, 2026. URL https://arxiv.org/abs/2512.13564.
[16] Yuan Huang, Yinan Chen, Xiangping Chen, and Xiaocong Zhou. Are your comments outdated? Towards automatically detecting code-comment consistency, 2024. URL https://arxiv.org/abs/2403.00251.
[17] John Hughes. How we built Claude Code auto mode: a safer way to skip permissions. Anthropic Engineering blog, 25 March, 2026. URL https://anthropic.com/engineering/claude-code-auto-mode.
[18] Shaokang Jiang and Daye Nam. Beyond the Prompt: An Empirical Study of Cursor Rules, 2026. URL https://arxiv.org/abs/2512.18925. MSR 2026.
[19] Borui Kang, Jinrui Gu, Junhan Lv, Wenbin Li, Lei Wang, and Yang Gao. Harness Continual Learning: Continual Adaptation Beyond Model Parameters, 2026. URL https://arxiv.org/abs/2608.19013.
[20] Tobias Kiecker, Jan Arne Sparka, Martin Reuter, Albert Ziegler, and Lars Grunske. CAS-CADE: Detecting Inconsistencies between Code and Documentation with Automatic Test Generation, 2026. URL https://arxiv.org/abs/2604.19400.
[21] J. Richard Landis and Gary G. Koch. The Measurement of Observer Agreement for Categorical Data. Biometrics, 33(1):159–174, 1977. doi: 10.2307/2529310.
[22] Jiahang Lin, Shichun Liu, Chengjun Pan, Lizhi Lin, Shihan Dou, Zhiheng Xi, Xuanjing Huang, Hang Yan, Zhenhua Han, Tao Gui, and Yu-Gang Jiang. Agentic Harness Engineering:
Observability-Driven Automatic Evolution of Coding-Agent Harnesses, 2026. URL https://arxiv.org/abs/2604.25850.
[23] Andrés Lucero. Living Without a Mobile Phone: An Autoethnography, 2018. URL https://arxiv.org/abs/1804.04833.
[24] Jai Lal Lulla, Seyedmoein Mohsenimofidi, Matthias Galster, Jie M. Zhang, Sebastian Baltes, and Christoph Treude. On the Impact of AGENTS.md Files on the Efficiency of AI Coding Agents, 2026. URL https://arxiv.org/abs/2601.20404.
[25] Damon McMillan. Instruction Adherence in Coding Agent Configuration Files: A Factorial Study of Four File-Structure Variables, 2026. URL https://arxiv.org/abs/2605.10039.
[26] Seyedmoein Mohsenimofidi, Matthias Galster, Christoph Treude, and Sebastian Baltes. Context Engineering for AI Agents in Open-Source Software, 2026. URL https://arxiv.org/abs/2510.21413. MSR 2026.
[27] Emerson Murphy-Hill, Jenna Butler, and Alexandra Savelieva. Adoption and Impact of Command-Line AI Coding Agents: A Study of Microsoft’s Early 2026 Rollout of Claude Code and GitHub Copilot CLI, 2026. URL https://arxiv.org/abs/2607.01418.
[28] Carman Neustaedter and Phoebe Sengers. Autobiographical Design: What You Can Learn from Designing for Yourself. Interactions, 19(6):28–33, 2012. doi: 10.1145/2377783.2377791.
[29] Charles Packer, Sarah Wooders, Kevin Lin, Vivian Fang, Shishir G. Patil, Ion Stoica, and Joseph E. Gonzalez. MemGPT: Towards LLMs as Operating Systems, 2024. URL https://arxiv.org/abs/2310.08560.
[30] Joon Sung Park, Joseph C. O'Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, and Michael S. Bernstein. Generative Agents: Interactive Simulacra of Human Behavior, 2023. URL https://arxiv.org/abs/2304.03442.
[31] Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, and Jeremy Hadfield. Effective context engineering for AI agents. Anthropic Engineering blog, 29 September, 2025. URL https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents.
[32] Yangjun Ruan, Honghua Dong, Andrew Wang, Silviu Pitis, Yongchao Zhou, Jimmy Ba, Yann Dubois, Chris J. Maddison, and Tatsunori Hashimoto. Identifying the Risks of LM Agents with an LM-Emulated Sandbox, 2024. URL https://arxiv.org/abs/2309.15817.
[33] Per Runeson and Martin Höst. Guidelines for Conducting and Reporting Case Study Research in Software Engineering. Empirical Software Engineering, 14(2):131–164, 2009. doi: 10.1007/s10664-008-9102-8.
[34] Shuai Shao, Kangning Zhang, Qingyao Li, Shijian Wang, Hao Wang, Wenxiang Jiao, Yuan Lu, Yi Guo, Weiwen Liu, and Weinan Zhang. Harness-R1: Learning to Edit Executable Runtime Harnesses from Agent Failure Trajectories, 2026. URL https://arxiv.org/abs/2608.02276.
[35] Natalie Shapira, Chris Wendler, Avery Yen, Gabriele Sarti, Koyena Pal, Olivia Floody, Adam Belfki, Alex Loftus, Aditya Ratan Jannali, Nikhil Prakash, Jasmine Cui, Giordano Rogers, Jannik Brinkmann, Can Rager, Amir Zur, Michael Ripa, Aruna Sankaranarayanan, David Atkinson, Rohit Gandikota, Jaden Fiotto-Kaufman, EunJeong Hwang, Hadas Orgad, P Sam Sahil, Negev Taglicht, Tomer Shabtay, Atai Ambus, Nitay Alon, Shiri Oron, Ayelet Gordon-Tapiero, Yotam Kaplan, Vered Shwartz, Tamar Rott Shaham, Christoph Riedl, Reuth Mirsky, Maarten Sap, David Manheim, Tomer Ullman, and David Bau. Agents of Chaos, 2026. URL https://arxiv.org/abs/2602.20021.
[36] Reshabh K Sharma. ContextCov: Deriving and Enforcing Executable Constraints from Agent Instruction Files, 2026. URL https://arxiv.org/abs/2603.00822.
[37] Helen Sharp, Yvonne Dittrich, and Cleidson R. B. de Souza. The Role of Ethnographic Studies in Empirical Software Engineering. IEEE Transactions on Software Engineering, 42(8):786–804, 2016. doi: 10.1109/TSE.2016.2519887.
[38] Theodore R. Sumers, Shunyu Yao, Karthik Narasimhan, and Thomas L. Griffiths. Cognitive Architectures for Language Agents, 2024. URL https://arxiv.org/abs/2309.02427.
[39] Wen Siang Tan, Markus Wagner, and Christoph Treude. Detecting Outdated Code Element References in Software Repository Documentation, 2022. URL https://arxiv.org/abs/2212.01479.
[40] Aristidis Vasilopoulos. Codified Context: Infrastructure for AI Agents in a Complex Codebase, 2026. URL https://arxiv.org/abs/2602.20478.
[41] Haoyu Wang, Christopher M. Poskitt, and Jun Sun. AgentSpec: Customizable Runtime Enforcement for Safe and Reliable LLM Agents, 2025. URL https://arxiv.org/abs/2503.18666. Accepted at ICSE 2026.
[42] Yike Wang, Huaisheng Zhu, Zhengyu Hu, Yige Yuan, Zhengyu Chen, Shakti Senthil, Hannaneh Hajishirzi, Yulia Tsvetkov, Noah A. Smith, Pradeep Dasigi, and Teng Xiao. Rethinking the Evaluation of Harness Evolution for Agents, 2026. URL https://arxiv.org/abs/2607.12227.
[43] Lilian Weng. Harness Engineering for Self-Improvement. Lil'Log blog, 4 July, 2026. URL https://lilianweng.github.io/posts/2026-07-04-harness/.
[44] Renjun Xu and Yang Yan. Agent Skills for Large Language Models: Architecture, Acquisition, Security, and the Path Forward, 2026. URL https://arxiv.org/abs/2602.12430. Accepted at the Agent Skills '26 Workshop, ACM Conference on AI and Agentic Systems 2026.
[45] Ruiyao Xu, Yanfei Chen, Zhongying CuiZhu, Bhavana Dalvi Mishra, Yifei Ming, Han Yu, Rujun Han, Chen-Yu Lee, and Tomas Pfister. Harness : Recursive Agent Harnessing for an Open World, 2026. URL https://arxiv.org/abs/2610.14224.
[46] John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering, 2024. URL https://arxiv.org/abs/2405.15793.
[47] Barry Zhang, Keith Lazuka, and Mahesh Murag. Equipping agents for the real world with Agent Skills. Anthropic Engineering blog, 16 October (updated 18 December), 2025. URL https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills.
[48] Xing Zhang, Guanghui Wang, Yanwei Cui, Wei Qiu, Ziyuan Li, Bing Zhu, and Peiyang He. Guardrails Beat Guidance: A Large-Scale Study of Rules, Skills, and Persistent Configuration for Coding Agents, 2026. URL https://arxiv.org/abs/2604.11088.
[49] Zhexin Zhang, Shiyao Cui, Yida Lu, Jingzhuo Zhou, Junxiao Yang, Hongning Wang, and Minlie Huang. Agent-SafetyBench: Evaluating the Safety of LLM Agents, 2025. URL https://arxiv.org/abs/2412.14470.