The central practice of Harness Engineering. When an agent fails, you do not retry-and-forget. You engineer a permanent change to the harness so the exact mistake cannot recur. The harness only ratchets in one direction: tighter against observed failures.
The slogan, from Addy Osmani’s synthesis (May 2026):
Whenever an agent fails, you engineer a permanent solution so it never makes that exact mistake again.
And the corollary that gives the discipline its shape:
Every line in a good system prompt should trace back to a specific, historical failure.
What the ratchet looks like in practice
A worked example from Osmani’s article. An agent ships a PR with a commented-out test. The PR gets merged. The test no longer guards anything.
The naive response: “annoying, hopefully the next model is better.” The Ratchet response: this is input to the harness, not noise.
| Layer | Permanent change |
|---|---|
AGENTS.md / CLAUDE.md | Add: “Never comment out tests; delete or fix them.” |
| Pre-commit hook | Auto-flag any new .skip( or it.skip in the diff |
| Reviewer subagent | Add a check that blocks PRs containing commented-out tests |
| Eval suite | Add a regression test where the agent is given broken tests; passing means it fixes them, not skips them |
After this work, the agent cannot repeat that specific mistake without something else also breaking visibly. The failure has been turned into a constraint that compounds.
Why this is different from “just write better prompts”
The naive view: prompts are documents you draft once and tune. The harness-engineering view: prompts are artifacts of failure history. Each line is the petrified form of a real mistake.
This makes the rulebook radically smaller and sharper than the encyclopedic AGENTS.md files most teams accumulate:
- Every rule has a story. If you cannot point to the failure it prevents, the rule does not earn its place in the always-attached set (Agent Harness > What Belongs in the Always-Attached Set).
- Every rule has an exit condition. When a more capable model renders the constraint redundant, the rule comes out. The ratchet only tightens against current weakness; it does not accumulate forever.
- The right harness is not portable. Two codebases with different failure histories produce different harnesses. The shape is unique to the codebase the way a callus is unique to the work.
This is the load-bearing reason behind the Curse of Instructions failure mode: rule lists that grow without earning their place create adherence collapse.
The ratchet across the vault
The same mechanism appears under multiple names across the cluster, always pointing at the same shape:
| Page | Author / origin | The ratchet form |
|---|---|---|
| Skillify - Meta-Skill Pattern | Garry Tan | ”Every failure becomes a skill, every skill has evals, every eval runs daily.” |
| Golden Principles and Garbage Collection | OpenAI Codex team | Encode opinionated rules; recurring background agents scan for deviations and auto-merge refactor PRs. Human taste captured once, enforced continuously. |
| AGENTS.md Six Core Areas | GitHub 2,500-file study | Three-tier (Always / Ask first / Never) boundary system grown from observed failure types. |
| Agent-Computer Interface (ACI) | Anthropic | ”Mistake-proofing”: when a tool fails, the failure message tells the agent what to do instead. |
| Eval-Driven Agent Development | Anthropic | The 8-step roadmap: failures from real transcripts become regression evals. |
| Agent-Friendly Codebase | Vault concept | Read session transcripts, fix friction, repeat — the codebase version of the ratchet. |
Osmani’s article is the post that names the discipline; Tan’s Skillify Manifesto is the personal-AI version; the OpenAI Codex case study is the production-scale empirical anchor.
What the ratchet rules out
Three failure patterns the ratchet structurally prevents:
1. The “hope the next model fixes it” trap. Treating failures as ephemeral noise means the same failure recurs across every model upgrade because no permanent change was ever made. The ratchet refuses this: every observed failure produces a permanent change that survives model upgrades.
2. The “vibe-coding then rewrite” trap. The pattern Lalit Maganti documents in Building syntaqlite - Eight Years of Wanting, Three Months with AI: build fast, lose the codebase, throw it away, rewrite. The ratchet substitutes accumulated harness improvements for periodic burn-it-down.
3. The “AI slop Friday” trap. The OpenAI Codex team explicitly cites this: spending 20% of every week cleaning up AI-generated drift. The ratchet replaces it with continuous garbage collection (Golden Principles and Garbage Collection) — pay technical debt down in small, automated increments rather than in painful weekly bursts.
What the ratchet does not mean
Two failure modes of the discipline itself, worth naming explicitly:
Over-tightening. Adding a rule for every minor irregularity produces an unreadable rulebook that suffocates the model with constraints. The Curse of Instructions is the documented failure mode. Test: would a competent senior engineer reading the rulebook today recognise every rule as load-bearing? If not, prune.
Pattern-blind tightening. Reacting to the literal failure rather than its category. If the agent merged a commented-out test once, the rule is “no commented-out tests” (general), not “do not comment out auth_test.py line 47” (specific). Each rule should be the most general form that still prevents the class of failures the incident represents.
The earnings-and-redundancy contract
The cleanest formulation of the discipline:
Key
Constraints are added when you observe a real failure. Constraints are removed when a more capable model renders them redundant. The rulebook is a living document with a stable shape: small, sharp, every line load-bearing, every line traceable to history.
This is what makes harness engineering a discipline and not a one-size-fits-all framework. The framework is fixed; the discipline is the ongoing tightening and pruning against the actual failure history of the actual codebase.
A useful mental model: the harness ratchets like a financial budget. New line items appear when there is a real expense to control. Old line items get pruned when the underlying expense has gone away. What the budget covers shifts; the discipline of “every line earned, every line currently necessary” stays the same.
Application to this vault
The Ratchet applies to WikiLLM itself. Every rule in the project CLAUDE.md should trace back to a specific failure observed during ingest, query, or lint operations.
Concrete examples already in place:
- “Never modify files in
Sources/” — earned through the failure mode of “agent silently rewrites primary sources during summarisation” - “Always download images locally to
Attachments/” — earned through “vault breaks offline because images are external links” - “Never use double-quoted strings inside inline alias arrays” — earned through “Obsidian’s YAML parser drops aliases silently when this pattern is used”
- “Always use the short filename when linking; never include folder prefix” — earned through “Obsidian wikilinks resolve by filename, folder-prefixed links produce dangling references”
Each one is a petrified failure. None is decoration.
When a new failure shows up during an ingest or lint, the right move is not to manually fix the artifact and move on. The right move is to ask: what permanent change to the harness prevents this from happening again?
Related Concepts
- Harness Engineering — the discipline this practice belongs to
- Agent Harness — the runtime scaffolding the ratchet operates on
- Skillify - Meta-Skill Pattern — the personal-AI version: failures become skills with evals
- AI Style Guide — the ratchet applied to writing: every bad draft adds a blacklist item
- Golden Principles and Garbage Collection — the OpenAI production version: principles + GC agents
- Agent-Computer Interface (ACI) — mistake-proofing as the special case at the tool layer
- Curse of Instructions — what goes wrong when the rulebook grows without earning its place
- Eval-Driven Agent Development — failures-to-regression-evals as the eval-side complement
- AGENTS.md Six Core Areas — the rulebook structure; pairs with the Ratchet’s content discipline
- Agentic Coding - Risks and Discipline — why “slowing down” is structurally how the ratchet gets applied
- Writing Conflict-Free Instructions — keep new rules from contradicting existing ones
Open Questions
- How aggressively should the rulebook be pruned as models improve? There is no public discipline yet for the removal half of the ratchet, only the addition half.
- Can the ratchet itself be partially automated? An agent that reads its own session transcripts, identifies recurring failure types, and proposes harness changes for human approval.
- Is there a measurable health metric for a rulebook? “Average rules per failure prevented” or similar — a way to detect over-tightening early.
- Personal Agent Operating Rules — the personal-assistant version: “every correction is specification debt”, a correction counter, and an agent-maintained development backlog
- Knowledge Factory — the ratchet automated: agent flags and traces trigger a curator agent that writes the rule; the open question is who approves it
Sources
- How the Claude Code team thinks about verification: adds a filter to the ratchet (recur in 2+ PRs, detectable from a diff, survive three disproval agents, human approval) plus scheduled pruning; see Claude Code Team Verification Practices