cd /news/ai-agents/how-to-stop-ai-coding-agents-repeati… · home › topics › ai-agents › article
[ARTICLE · art-170730] src=gethrbr.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

How to stop AI coding agents repeating the same mistakes

Harbor launched a tool that stores coding corrections as persistent rules and distributes them to Claude Code, Cursor, Codex and GitHub Copilot agents across a team, installable via `npx harborloop init`. Harbor reads coding sessions, review threads, Slack and docs to capture each decision as a rule, then supplies each agent with at most three ranked rules matched to the task and files it touches before every prompt. The product addresses the gap where agent memory stays personal to one repo on one machine and rules files such as CLAUDE.md, .cursor/rules, .github/copilot-instructions.md and AGENTS.md only hold what someone has manually written.

by read4 min views1 publishedNov 16, 2026
How to stop AI coding agents repeating the same mistakes
Image: Gethrbr (auto-discovered)

Blog

Published

To stop an AI coding agent repeating a mistake you already corrected, write the correction into the file it reads every session, with the reason. That works for one person in one agent. On a team, the correction also has to reach every teammate's agent, which is what Harbor does: it keeps each correction as a rule and hands it to Claude Code, Cursor, Codex and Copilot.

You tell Claude Code not to reset the database. It writes a migration instead. Next week a teammate's session resets the database anyway. Here is what works, and where it stops working.

On your own, in one agent #

Write the correction into the file your agent reads every session:

  • Claude Code:CLAUDE.md , or ask Claude Code to add it.
  • Cursor: a rule in.cursor/rules .
  • Copilot:.github/copilot-instructions.md .
  • Codex and most others:AGENTS.md .

If you work alone in one agent and keep that file current, this is enough, and you do not need Harbor. How to word the rule so it sticks is in how to make Claude Code remember your corrections.

Where it breaks on a team #

What Harbor does #

  • It picks up the correction. Harbor reads coding sessions, review threads, Slack and docs, and keeps each decision as a rule. You set the gate: every rule waits for a person, or only the ones that need one.
  • Every teammate gets it. A saved rule reaches teammates from their next session, in every repo the Space covers, on any machine.
  • Any agent. Claude Code, Cursor, Codex and Copilot get the same rules.
  • Only what fits. Before each prompt, the agent gets at most three ranked rules matched to the task and the files it touches, not the whole rulebook.
  • Before risky commands. Harbor shows the team's rule before a guarded action, judged for that exact call (guardrails ). It also asks before a command that spends paid AI budget.
  • Checked on every pull request. A GitHub App reviews each pull request against your rules and yourCLAUDE.md andAGENTS.md , and comments on the line that breaks one, with a link to the rule (code review ).

See what Harbor does for the whole loop.

Try it #

npx harborloop init

That connects Claude Code, Codex, Cursor and GitHub Copilot. There are also plugins for Claude Code and Codex (install). If you only want the pull request check, install the GitHub App and nothing goes on anyone's machine.

Questions #

How do I stop AI coding agents from repeating a mistake I already corrected?

Write the correction, with its reason, into the file your agent reads every session: CLAUDE.md for Claude Code, a rule in .cursor/rules for Cursor, .github/copilot-instructions.md for Copilot, and AGENTS.md for Codex and most others. On a team, the correction also has to reach every teammate's agent, which a file only does once someone adds it.

Why does a teammate's agent repeat a mistake mine was corrected on?

Agent memory is personal: auto memory keeps the lesson in one repo on one machine. A rules file holds only what someone wrote, and teammates on Cursor, Codex and Claude Code read different files. So the correction stays with the person who made it.

How does Harbor stop agents repeating mistakes?

Harbor reads coding sessions, review threads, Slack and docs, and keeps each decision as a rule through a gate you set. A saved rule reaches teammates from their next session in Claude Code, Cursor, Codex and Copilot, at most three ranked rules per prompt, and a GitHub App checks each pull request against those rules and your CLAUDE.md and AGENTS.md.

Can I get only the pull request check, without installing anything?

Yes. Install the Harbor GitHub App and turn on Code review. Nothing goes on anyone's machine. To connect agents too, run npx harborloop init, or use the plugins for Claude Code and Codex.

── more in #ai-agents 4 stories · sorted by recency
── more on @harbor 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-to-stop-ai-codin…] indexed:0 read:4min 2026-11-16 · —