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/Answers

Answers

Ignores its rule file

  • HTML comments in CLAUDE.md
  • "Read AGENTS.md" does not import
  • Antigravity ignores AGENTS.md
  • Windsurf ignores rules

Rule file too long

  • AGENTS.md too long for Codex
  • Antigravity rule size limit
  • Copilot instructions length
  • Cursor rules too long

Rules drift from the code

  • CLAUDE.md and AGENTS.md drift
  • Directory trees in rule files

Share rules across repos and agents

  • Share CLAUDE.md across repos
  • Share AGENTS.md in Codex
  • Copilot org instructions
  • Gemini CLI and AGENTS.md
  • Share Windsurf rules

Memory between sessions

  • Gemini CLI memory

Answers

CLAUDE.md and AGENTS.md drift apart in 7% of repos that copy one into the other: import instead

Published November 18, 2026

A CLAUDE.md that copies AGENTS.md drifts: in our sample of 745 repos with both files at the root, 7.0 percent held a copy that had already drifted and another 6.6 percent a copy still in step, waiting to. Replace the copy with @AGENTS.md on the first line of CLAUDE.md, so there is one file to edit and Claude Code imports it every session.

For Claude Code. Vendor facts are from the pages linked below, read on November 18, 2026.

Fix a drifted pair

  • Diff the two files: diff <(sort CLAUDE.md) <(sort AGENTS.md) shows lines only one of them has.
  • Decide which line is true for each difference, from the code, not from either file, and keep it in AGENTS.md.
  • Replace CLAUDE.md with @AGENTS.md and only the Claude-specific lines below it.
  • To keep it from coming back, add a CI step that fails if CLAUDE.md stops starting with @AGENTS.md, or generate both files with ruler or rulesync.
head -1 CLAUDE.md | grep -qx "@AGENTS.md" || { echo "CLAUDE.md must import AGENTS.md"; exit 1; }

The numbers

MeasureValueSource
CLAUDE.md beside AGENTS.md: a copy that drifted7.0% of pairs (54 sampled)Harbor study, 18 Oct 2026
A copy still in step6.6% of pairs (45)Harbor study, 18 Oct 2026
Imports it with @AGENTS.md25.4% (207)Harbor study, 18 Oct 2026
Is a symlink to AGENTS.md23.0% (177)Harbor study, 18 Oct 2026
Root AGENTS.md files with a CLAUDE.md beside them36.5% (weighted)Harbor study, 18 Oct 2026

Study figures are weighted estimates from 1,935 CLAUDE.md and 1,970 AGENTS.md files sampled from public GitHub repositories on 18 October 2026, with GitHub's own counts for the totals. Every figure is in the study's CSV, and the method is in the study.

What the docs say

  • Claude Code memory docs, AGENTS.md section: With a CLAUDE.md in the working directory or above, Claude reads CLAUDE.md files only, unless CLAUDE.md imports AGENTS.md or the Project instructions setting loads both.

Where Harbor fits

Harbor connects Claude Code, Codex, Cursor and GitHub Copilot (the CLI and VS Code agent mode; the cloud agent is not supported yet) through hooks and an MCP server. It keeps one set of team rules and serves the same ones to every agent, so there is no second copy to drift. When a push deletes the file a rule is about, the rule is retired, or flagged if other repos still use it. Each rule shows how often it was served and how often an answer cited it. A citation is evidence a rule was used, not proof it was obeyed.

Read next

  • Keep CLAUDE.md, AGENTS.md and .cursorrules in sync
  • "Read AGENTS.md" does not import it
  • The study behind the numbers
  • Leave the directory tree out of CLAUDE.md and AGENTS.md: it goes stale and the agent can list files itself
  • Claude Code strips HTML comments from CLAUDE.md, so a rule inside one never loads
  • Share CLAUDE.md rules across repos with ~/.claude/rules, a symlinked .claude/rules, or a managed CLAUDE.md
  • Every answer, by agent and problem

Questions

How do I keep CLAUDE.md and AGENTS.md in sync?

Do not keep two copies. Put the rules in AGENTS.md and make CLAUDE.md start with @AGENTS.md, or make it a symlink. If you need generated per-agent files, use ruler or rulesync with a check in CI.

How often do CLAUDE.md and AGENTS.md drift apart?

In our October 2026 sample of 745 repos with both files at the root, 7.0 percent of the CLAUDE.md files were copies that had drifted: they held some of the AGENTS.md lines but missed at least five.

Which file wins when they disagree?

In Claude Code, the CLAUDE.md, because by default it does not read AGENTS.md at all when a CLAUDE.md exists. Codex reads AGENTS.md. So the same repo gives Claude and Codex different rules.

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
  • Copilot Memory and Dreaming

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
  • vs Trail-code

Company

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