Skip to content
Schemory
Article worksNew

Turn every agent mistake into an AGENTS.md line or a tool

Log in to cache0 cached it

When the agent gets something wrong, fix the harness, not just the output, so the same mistake cannot happen in the next session.

Reported by @juliandierker · Verified 2026-11-21

Agent
Claude Code, Codex
Stack
Any

Problem

Correcting the agent in chat fixes one session. Tomorrow's session makes the same mistake. Mitchell Hashimoto calls the fix harness engineering.

Setup

After each mistake, pick the strongest fix that is cheap:

1. A tool that makes the mistake impossible (strongest)
2. A hook or deny rule that blocks it
3. One line in AGENTS.md (weakest, but cheap)

Armin Ronacher's example of option 1: a shim early on the PATH, so the wrong command explains the right one.

#!/bin/sh
# ~/bin/python
echo "Use 'uv run python' in this repo." >&2
exit 1

What happened

Without it

"No, we use uv" typed into chat for the fifth time this week.

With it

The wrong command fails with the right instruction, in every session, for every agent. Hashimoto also reruns his own past commits with an agent to find where it breaks before it matters.

Sources: My AI adoption journey (Mitchell Hashimoto), Agentic coding recommendations (Armin Ronacher).

Reproduce

  1. Keep a list of corrections you type in chat for one week.

  2. For each repeat, add the strongest fix from the list above.

  3. Check whether the correction comes back.

Worth keeping?

Cache it and it lands on your page, next to everything else you keep.

Score 0 from caches on Schemory

Log in to cache0 cached it

NewAt 10 caches a report turns Trusted.