Agent mistake → fix the harness, not the prompt
The single most important principle from harness engineering: when an AI agent makes a mistake, don’t fix the prompt or try a better model. Fix the environment.
Four mechanisms, escalating in robustness:
- CLAUDE.md — for simple problems (wrong commands, wrong APIs). One line per bad behavior. “Each line in that file is based on a bad agent behavior, and it almost completely resolved them all.” — Hashimoto
- Linters with remediation — custom linters whose error messages contain instructions the agent can follow. Not just “error on line 5” but “fix by doing X.”
- Structural tests — ArchUnit-style checks that validate dependency direction, file sizes, naming conventions. Automated guardrails, not manual review.
- Sensors in hooks — what the author actually runs. A syntax check on every edit (under a second) and an end-of-turn gate (lint, types, tests) that will not let the turn end while the receipt is red. Measured against planted defects, it caught 11 of 24, so a green receipt means “passed”, not “correct”. See harness-engineering-summary.
This creates a ratchet: mistakes can only happen once. Each failure permanently improves the harness. Over time, the repository becomes a progressively better environment for agents.
The anti-pattern: manually cleaning up “AI slop.” OpenAI found that 20% of time (Fridays) went to cleanup — doesn’t scale. Automation or bust.
The many-agents version of this is the gate in project-swarm: the worker never declares a task done, a script checks the diff and the repo’s tests and the gate decides (experimental, November 2026).
What others found since (Oct 2026)
- At 30,000 merges a day, the job is saying no. Anthropic’s source-control team (Oct 2026) went from about 2,500 merges a day in May to 30,000+ in September. Engineers often spent their time telling Claude no, because agents break core constraints to fit a familiar pattern, and reviewers moved to reading the intent of a change rather than every line (reported). A “no” that repeats is a harness rule not yet written.
Connections
- harness-engineering-summary — origin: core principle from harness engineering synthesis
- solo-methodology — the ratchet effect is what makes solo dev viable: compound improvements
- kill-iterate-scale — same philosophy: predetermined rules remove human judgment from repetitive decisions
cheap-model-delegation-boundary — this principle applied to cost rather than correctness: Portal does not ask the agent to use the cheap model for big files, it BLOCKS the read with a PreToolUse hook and redirects it.
- running-production-with-agents-2026 — the same ratchet seen from production SRE: teams that remove the capability (a deploy target that cannot expose an app, a governor on agent tool calls) instead of writing a rule, and our gaps against that