Method
Teach your AI once
I don't correct my agents twice. Every lesson goes into a rulebook my agents read before my first word, or a playbook they load when the job comes up. A lesson usually becomes a rule in under a minute, and the mistake stops.
On the morning of October 8 my laptop froze and restarted with about twenty agent threads awake. An agent thread is one ongoing conversation with an AI that does the work itself, running programs and editing files on my laptop. Each one had started its own copy of the same background helper programs, and together they ran the Mac out of memory.
At 10:58 I sent my first message about it, and eight minutes later I typed, "This needs to be a global change." Within a minute the fix was in, and the rule was in the rulebook my agents read before they start. The list of helper programs every agent loads went from 13 to 5, and 19 days later it's still at 5.
That's the habit this article is about. I don't correct my agents twice. Every lesson goes into the system.
I run about twenty agent threads across three companies. If each of them had to learn my rules from scratch, I'd spend my days repeating myself. Instead, every new agent starts with what all the others learned.
- 42s
median from my message to a written rule
- 3×
growth of my rulebook in four weeks
- 58→0
video-render commands on my laptop, after one rule
- 2in 3
agent threads that load a playbook I wrote
What most people get wrong
Most people correct an AI in the chat. It works, for that conversation. Then the conversation ends, and the lesson ends with it.
Anthropic, which makes the Claude Code agent, says it directly in its documentation: "Each Claude Code session begins with a fresh context window."1 In plain words, every new agent starts with no memory of the last one. The next agent makes the same mistake, and you explain it again.
Tap a step for the evidence
Correct it in chat
Make it a rule
The fix is a file the agent reads every time it starts. Claude Code loads one called CLAUDE.md, and OpenAI's Codex reads one called AGENTS.md before it does anything.12 It's tempting to fill it with a summary of your project.
Two studies from 2026 tested whether these files help. One found they generally didn't raise task success and added more than 20% to the cost, and that project overviews in them didn't help.3 But agents did follow the instructions in them, and the files were useful for practices an agent wouldn't guess.
The other found the agents' median runtime was about 29% lower with a file than without, with similar task completion.4 So a summary of your project doesn't help much. Specific rules about how you work get followed, and that's all my rulebook is.
One rulebook, one lesson at a time
My global rulebook is a single file that every Claude Code agent reads first, in every project; Codex gets a shorter copy of the core rules. On September 28 it was 975 words. Four weeks later it was 3,013, and every addition came from something that went wrong or a decision I made.
Tap a day for what went in
Tap a number for what changed after
Most sections carry the date they were written, and the biggest ones name the incident behind them. A few lines, word for word:
Tap a line for why it's there
None of these are clever. Each one comes from something that went wrong or a call I made, written down so it doesn't happen again.
Seconds, not sprints
The speed matters more than it sounds. If writing a rule took an afternoon, I'd put it off. It usually takes less than a minute, so I never do.
Tap a row for details
On October 13 an agent proposed a setup that was easier for people than for agents. I told it to save, in my words, "that we need to set things up in a way that makes it easier for Agents to do the work." Twenty-one seconds later the rulebook had a new section called "Agent-first setup."
It isn't only the rulebook. Across both AI tools I use, I found 109 times I asked an agent to keep a lesson. Four in five were written down within half an hour, and two in five within a minute.
Playbooks for whole jobs
A rule covers one decision. A playbook covers a whole job.
Both Claude Code and Codex support playbooks, which they call "skills": a folder with a file that names the job, says when to use it and lists the steps. Only the name and the when-to-use line load when an agent starts, and the steps load when the job comes up.5 So an agent can carry dozens of playbooks and load only the one it needs.
I've built 78 of them, more than 30,000 lines in all. They cover how to use my signed-in browser, how to turn a request into a task card, how to diagnose problems in our backend and how to render a video in the cloud. About two in three of my agent threads load at least one.
When I wrote one for keeping my status page current, 59 threads had used it within five days, because the rulebook tells each of my main agent threads to use it. Another took 72 seconds to write, from a message asking for a short playbook that routes my Slack messages to the agent that owns each topic.
Both tools now read the same open format, so 19 of my playbooks are a single file that Claude Code and Codex share.56 When I teach Anthropic's agent, OpenAI's agent learns it too. Where I kept two copies instead, two of the eight have already drifted.
Rules with teeth
A rule in a file is guidance, not a lock. Anthropic says so in its own docs: the agent treats these files "as context, not enforced configuration."1 So the rules that must never break are also code.
Three examples. A guard refuses any Slack message an agent tries to send through anything but the two Slack connections I set up for sending. A queue lets only one heavy job, like a build or a test run, use the laptop at a time.
And when an agent says I approved something in another thread, a small script has to find my exact words there before the agent acts. In its first nine days it ran about 185 times, and at least 16 times it found no match and the agent stood down.
Does it stick?
A rule only counts if the mistake stops. These three did.
Tap a mistake for the dates
Agents ran 58 video-render commands on my laptop from October 1 to 11, and the disk filled up during one of the renders. After "Renders go to the cloud" went in, there were none for 16 days, while 138 render jobs ran on cloud machines instead. Thirty-eight Slack messages went out through the wrong connection up to the morning after the Slack rule went in, and none in the 19 days since.
And the morning my laptop froze, the list of helper programs every agent starts went from 13 to 5. Nineteen days later it was still 5.
The best sign is that I have to ask less. In June, about one message in 44 asked an agent to save a lesson. In October it was one in 390.
Tap a month for the count
Messages asking an agent to save a lesson, per 1,000 messages I typed
The agents now write lessons down without being asked. Since September 21 my Claude Code agents have written to the rulebook, memory files, playbooks and other standing files more than 1,200 times, and only about 16 of those followed a "remember this" from me.
Why it works
None of this is new. It's how high-stakes fields already learn.
Google's site reliability engineers write a blameless report after every serious failure, and each report ends in action items that someone reviews. Their book puts it simply: "You can't 'fix' people, but you can fix systems and processes."7
Surgery has the checklist. When eight hospitals in eight cities adopted a 19-item checklist, deaths after surgery fell from 1.5% to 0.8%.8 When Ontario required one across 101 hospitals, the results barely moved, and the lead author suggested a mandate without buy-in may be the problem.9
A checklist works when the team actually uses it, every time. That's the part agents are good at: they read the rulebook at the start of every session, without being reminded.
Toyota builds quality in by detecting problems and "preventing them from recurring."10 AI researchers keep finding the same thing in their own agents: systems that write down lessons, or keep a growing library of skills, beat earlier agents on research benchmarks.1112
The fine print
- Rule times run from my message to the written rule, read from my agents' logs. A second pass re-derived five of the eleven, with a median of 40.5 seconds.
- Lessons were found by searching my messages for phrases like "remember this" and reading every match, so they're a sample, not every lesson I gave.
- The before-and-after numbers show what changed after each rule. They aren't controlled experiments.
What you can do
- Keep one rules file that every agent reads. CLAUDE.md for Claude Code, AGENTS.md for Codex. Keep it short and specific.
- End every correction with "make that a rule." Then check that it landed.
- Date each rule and name what caused it. Six months from now, you'll want to know why it's there.
- Turn any job you've explained twice into a playbook. The steps, the traps, and how to check the result.
- Back the rules that must never break with code. A guard, a hook or a script. A file asks; code makes sure.
Rules are how the rest of my system stays reliable as it grows. The 206× experiment shows what that system produces for an hour of my time. Helm and the art of context switching are how I run twenty jobs at once, and the signed-in browser is how my agents work behind the login.
Sources
- Anthropic, "How Claude remembers your project," Claude Code documentation. code.claude.com ↩
- OpenAI, AGENTS.md guide, Codex documentation. learn.chatgpt.com ↩
- Gloaguen et al., "Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?" 2026. arxiv.org/abs/2602.11988 ↩
- Lulla et al., "On the Impact of AGENTS.md Files on the Efficiency of AI Coding Agents," 2026 (124 pull requests in 10 repositories; median runtime 28.6% lower with the file). arxiv.org/abs/2601.20404 ↩
- Anthropic, "Equipping agents for the real world with Agent Skills," October 2025. anthropic.com ↩
- OpenAI, skills guide, Codex documentation. learn.chatgpt.com ↩
- Lunney and Lueder, "Postmortem Culture: Learning from Failure," in Site Reliability Engineering (Google, 2016), chapter 15. sre.google ↩
- Haynes et al., "A Surgical Safety Checklist to Reduce Morbidity and Mortality in a Global Population," New England Journal of Medicine, 2009. doi.org/10.1056/NEJMsa0810119 ↩
- Urbach et al., "Introduction of Surgical Safety Checklists in Ontario, Canada," New England Journal of Medicine, 2014. doi.org/10.1056/NEJMsa1308261 ↩
- Toyota Motor Corporation, "Toyota Production System." global.toyota ↩
- Shinn et al., "Reflexion: Language Agents with Verbal Reinforcement Learning," 2023. arxiv.org/abs/2303.11366 ↩
- Wang et al., "Voyager: An Open-Ended Embodied Agent with Large Language Models," 2023. arxiv.org/abs/2305.16291 ↩