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. Blog How to stop AI coding agents repeating the same mistakes 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 https://gethrbr.com/blog/ai-agent-keeps-making-the-same-mistake . Where it breaks on a team - Agent memory is personal. Auto memory keeps the lesson in one repo on one machine what each agent remembers https://gethrbr.com/blog/claude-code-memory-vs-codex-cursor-copilot . - Rules files hold what someone wrote. Monday's correction is not in CLAUDE.md until somebody adds it. Usually nobody does. - Agents read different files. One person on Cursor, one on Codex and one on Claude Code means three places to keep in step how to keep CLAUDE.md, AGENTS.md and .cursorrules in sync https://gethrbr.com/blog/keep-claude-md-agents-md-cursorrules-in-sync . - Review repeats itself. The same comment shows up on the third pull request this month turning review comments into agent rules https://gethrbr.com/blog/code-review-comments-as-agent-rules . 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 https://gethrbr.com/docs/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 your CLAUDE.md and AGENTS.md , and comments on the line that breaks one, with a link to the rule code review https://gethrbr.com/docs/code-review . See what Harbor does https://gethrbr.com/ 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 https://gethrbr.com/install . If you only want the pull request check, install the GitHub App https://gethrbr.com/docs/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.