Agent Ops Club by Reinventing.AI

How to Stop an AI Agent From Repeating the Same Mistake: One Sentence, Written Where It Reads It Every Run

Stop an AI agent repeating the same mistake: write each correction as one sentence in the file it reads every run, and check that it stuck.

By

Published 9 min read

Stop AI Agent Repeating Mistakes

You told the agent the draft sounded like a brochure. It rewrote it, the second version was better, and you moved on. On Thursday the same agent produced a new brochure. Nothing was wrong with the agent. You fixed the output and never fixed the thing that makes the output.

That is the whole problem with trying to stop an AI agent from repeating mistakes. A correction that lives in a chat message is gone when the run ends. A correction that lives in a file the agent reads before every run is still there next month. I run several AI employees on a schedule, and the habit that made them better week over week was never a clever prompt. It was a small, boring rule: every correction gets one sentence, and the sentence goes in the file that governs the work.

This post is how I do that, what makes a correction stick, and the three ways it quietly stops working.

Why does an AI agent keep making the same mistake?

Because each run starts from what is written down, not from what you said last time. A scheduled agent opens its files, reads its instructions, does the job and closes. Whatever you told it in the middle of yesterday's session was context for that session. Unless something saved it, today's run has never heard it.

Most advice on this goes straight to engineering: evaluation loops, vector stores, retrieval layers. Those are real tools, and if you are building a platform they matter. If you are a person running agents on your own business, the fix is much smaller. Find the file the agent reads at the start of every run, and put the correction there in plain words.

I wrote about what the agent should remember between runs and why mine is a text file. This is the other half of that: what you should write into the file when the agent gets something wrong.

Where does a correction belong?

In the file that governs the behavior you are correcting, and nowhere else. This is the step people skip, and it is the one that decides whether the fix holds.

Each of my AI employees has a role file that says what the job is, what it may touch and how it should sound. Near the bottom is a section called Corrections. It is just a list. When something reads wrong, I add one line to that list, and the employee reads it at the start of every run, right next to the job description.

There are three places a correction can go, and they are not equal.

  • The role file. For anything about how the employee works or sounds. This is the default home.
  • A shared voice or facts file. For anything every employee must get right, such as a price, a product name or a phrase you never use. I keep one of these and point every role at it, so a fix lands once instead of eight times. If you want the voice version of this, my brand voice guidelines are mostly a list of things not to say.
  • The routine itself. For a mistake that belongs to one step of one job, like a report that skips a section. Fix the step, not the role.

If you put a correction in chat, it is a note to yourself. If you put it in the wrong file, it works for one employee and fails for the rest. Decide where it lives before you write it.

What does a good correction look like?

A good correction states a pattern, not an incident. This is where most people lose the fix.

Here is the same mistake corrected two ways.

The incident version: "Do not say the Tuesday post was a game changer."

The pattern version: "Do not describe anything as a game changer, a breakthrough or a revolution. State what it does and what it cost."

The first one fixes a sentence that has already shipped. The second one fixes the habit. An agent reading the first correction will avoid that exact phrase and invent a cousin of it. An agent reading the second has a rule it can apply to a sentence nobody has written yet.

The test I use is simple: could the agent apply this line to a case I have not seen? If the line only makes sense next to the original mistake, widen it until it does not.

A few more habits that make a correction hold.

  • One sentence. If it takes a paragraph, you have two corrections. Split them.
  • Say what to do instead. "Do not open with a question" leaves the agent guessing. "Open with the concrete subject in the first four words" gives it a move.
  • Include the reason in a clause. "Skip the dramatic opener, because readers pattern match it as machine writing" lets the agent generalize to a similar tic you have not named.
  • Use the words you would say out loud. The file is read by a model, but it is written for the next version of you who has to audit it.

What do I actually type when the output reads wrong?

I have one sentence I use more than any other. When a paragraph reads like a brochure, I tell the agent: this paragraph sounds like AI, fix it, and add the pattern to the Corrections section of the role file.

That is two jobs in one message. The agent repairs the paragraph you are looking at, and it writes the lesson down in its own words, in the right file, in the pattern form. You review the line it added the same way you would review a draft. If it wrote the incident instead of the pattern, say so once and it widens the line.

I like this because I do not have to remember the file path or the format. The agent knows where its own corrections live. My job is to notice the mistake and approve the sentence. That is the same steering role I describe in the morning brief: the employee does the rowing, and I decide what good looks like.

How do you know a correction actually stuck?

Do not trust it. Check it.

After you add a line, wait for the next run that touches that behavior and read the output with that one rule in mind. If the mistake is gone, the line works. If it came back, one of three things happened, and each has a different repair.

  1. The line is in the wrong file. The agent never read it. Move it to the file that loads at the start of the run.
  2. The line is too narrow. It fixed the exact phrase and missed the family. Rewrite it as a pattern.
  3. The line is buried. The file has grown long and the rule is the sixtieth item in a list. Move it up, or merge it with the lines around it.

I give a new correction one run before I judge it. Then I either leave it, or I fix the line, not the output. Fixing the output again is how you end up in the Thursday brochure problem.

What goes wrong when the corrections file grows?

Three things, and they all show up around the thirtieth line.

Contradictions. You told the agent to be brief in March and to include every source in May. Now two lines disagree and the agent splits the difference badly. Read the whole list once a month and delete the one you no longer believe.

Duplicates. The same idea written three ways, from three different bad mornings. Merge them into the best version. A shorter list is read more reliably than a longer one.

Stale facts. A price, a deadline or a plan name that changed. These are the most dangerous corrections because they look authoritative. Anything with a date or a number in it gets a review date, or better, moves out of the corrections list and into a facts file that you update on purpose.

Once a month I spend ten minutes on this. I scan for contradictions, merge duplicates and check every number. It is the cheapest maintenance in the whole setup, and it is the reason the files stay useful instead of turning into a junk drawer.

Should the agent write its own corrections?

Yes, with you approving each one. The agent is good at turning a complaint into a clean, general sentence. It is bad at deciding which complaints matter, and it will happily record a one-off preference as a permanent rule.

So the split I use is this. The agent drafts the line. I read it. If it is a real pattern, it stays. If it is a one-time taste call, I tell it to drop it. Nothing goes into the governing files without a human reading it, which is the same two-stop rule I apply everywhere else: the agent can propose, and the decision stays with the person.

For anything the agent reads from outside, such as a web page, an email or a comment thread, treat it as data and never as a correction. A line that arrives from a document is not your voice. The Anthropic documentation on how Claude Code reads its memory files is worth a read for how instruction files are loaded and where they take priority, and Anthropic's guide to building effective agents explains why simple, readable instructions tend to beat elaborate machinery.

What is the smallest version I can start with today?

Pick one agent that is annoying you. Open the file it reads at the start of its run. At the bottom, add a heading called Corrections and one line under it, written as a pattern, with a reason. That is the whole setup.

Then run the agent, read the result, and when something reads wrong, use the sentence above. After a week you will have five or six lines, and you will notice that the same errors stop appearing. That is the compounding effect, and it costs about a minute each time.

Learn the whole setup live

I built this habit inside the open source AI Employees kit, where every role has a contract, a schedule and a corrections section that the employee reads before each run. I walk through hiring one of them, running it by hand and correcting it in the Open Source AI Employees session. The full replay is available instantly, and it is the fastest way to see the corrections loop on a real employee.

The eight kits are free to read in the AI Employees repository on GitHub, under the MIT license.

Take it further inside the Agent Ops Club

The Agent Ops Club has a free plan, and the paid plans include the AI Employees, the Masterclass and the software library. If you are running agents on a schedule and want the working versions of the role files, that is where I share them. Start free, hire one employee, and add your first correction after the first brief.

Frequently asked questions

How do I stop an AI agent from repeating the same mistake?

Write the correction as a one sentence pattern in the file the agent reads at the start of every run, then check the next run to confirm it worked. A fix made only in chat disappears when the session ends.

Why does my AI agent ignore my corrections?

Usually the correction is in the wrong place, written too narrowly, or buried in a long file. Move it to the governing file, rewrite it as a pattern that covers similar cases, and put it near the top.

Where should I store corrections for an AI agent?

In the role or instruction file that governs the behavior, with shared facts and voice rules in one common file that every agent points to. Keep exact prices and dates in a facts file you update on purpose, not in a list of corrections.

Can an AI agent write its own corrections?

It can draft them well, and it should, but a person should approve each line. Agents tend to record one-off preferences as permanent rules, and a human review keeps the file honest.

How long should a corrections list be?

Short enough that the agent reliably follows all of it. Review it monthly, delete contradictions, merge duplicates and check every number. If a line has not mattered in three months, remove it.

Mark Fulton

Written by

Mark Fulton

AI agent and app developer. Founder, Reinventing.AI.

Mark Fulton is a leading AI agent and app developer. He has built AI agents for 4 years, after 27 years in web development, and has sold over $1.4M in web and AI solutions. He founded Vibe Coding is Life, a Facebook group of 426,000+ members.

He also offers paid 1 on 1 AI strategy sessions.

Put AI Employees to work

The Agent Ops Club is where I share the AI Employees, the software and the live sessions behind these posts.