Skip to content
How it learnsFrom coding sessions, reviews, Slack and docs.Only what fitsEach session gets the few rules its task needs.Pull request reviewEvery PR checked against your team’s rules.Keep it trueA gate, conflicts, disputes and stale rules, handled.HandoffsCarry the work to another session or a teammate.SecurityWhat it sends, what it changes and how to leave.
Engineering teamsOne agent or several: what one person learns, every session uses.PR review onlyInstall the GitHub App. Nothing on anyone’s machine.Teams that mix agentsClaude Code, Cursor, Codex and Copilot, the same rules.On your ownYour corrections follow you across repos, machines and agents.Book a call30 minutes with Roei, if you want a hand. Never required.
DocsPricingSign in
Connect your agents →
For teamsOn your ownPR review onlyHow it learnsOnly what fitsPull request reviewKeep it trueSecurityDocsPricingSign inConnect your agents →
Home/Blog

Blog

AGENTS.md, Cursor rules and Copilot instructions

  • AGENTS.md vs CLAUDE.md
  • Keep rule files in sync
  • Sync rules across repos
  • 3,905 files checked
  • Why Copilot ignores it
  • Cursor Team Rules
  • Why Codex ignores it
  • Cursor rules
  • copilot-instructions.md
  • Claude Code and AGENTS.md
  • AGENTS.md research

CLAUDE.md and context engineering

  • Why Claude ignores it
  • CLAUDE.md length
  • Which rules got used
  • Context rot, stale rules
  • Growing CLAUDE.md
  • Claude Code best practices
  • Context engineering, Claude 5
  • Karpathy CLAUDE.md
  • Committing CLAUDE.md

Built-in agent memory

  • Agent memory compared
  • GitHub Copilot Memory
  • Make Claude Code remember
  • Claude Tag vs Claude Code
  • Codex memories
  • Cursor memories
  • Claude Code auto memory
  • Memory or documentation?

Team knowledge and shared conventions

  • Claude Code team memory
  • Stop repeated mistakes
  • Shared memory across agents
  • Hand off between agents
  • Claude Code second brain
  • Company brain
  • Slack decisions
  • Memory poisoning
  • Karpathy's LLM wiki
  • ADRs for agents

Skills, hooks and permissions

  • Rules vs skills
  • Claude Code hooks
  • Codex skills
  • Auto mode
  • CLAUDE.md vs skills vs hooks
  • Claude Code skills

AI code review and PR guardrails

  • PR review against AGENTS.md
  • Review comments to rules

Memory tools and alternatives

  • Best company brain tools
  • Unblocked alternatives
  • Supermemory alternatives
  • Best MCP memory servers
  • claude-mem alternatives
  • Supermemory Company Brain alternatives
  • Mem0 alternatives
  • claude-mem

Blog

How to stop AI coding agents repeating the same mistakes

Published November 16, 2026

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

  • Agent memory is personal. Auto memory keeps the lesson in one repo on one machine (what each agent remembers).
  • 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).
  • Review repeats itself. The same comment shows up on the third pull request this month (turning review comments into 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). 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).

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 on Team knowledge and shared conventions

  • Claude Code team memory: what is shared, what is not
  • Share memory and rules across Claude Code, Codex and Cursor
  • How to hand off a task between Claude Code, Codex and Cursor
  • A second brain for Claude Code, and where it stops

How Harbor keeps a team’s knowledge →

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it learns
  • Only what fits
  • Pull request review
  • Keep it true
  • Handoffs
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • Install
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Share Claude Code memory with a team
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Make Claude Code remember

Compare

  • All comparisons
  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen
  • vs MemPalace
  • vs Sentra

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborConnect your agents