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

"Read AGENTS.md" in CLAUDE.md does not load it: put @AGENTS.md on its own line

Published November 18, 2026

A line such as "Read AGENTS.md before starting any task" does not load AGENTS.md: Claude sees the file only if it decides to open it. When a repo has a CLAUDE.md, Claude Code reads CLAUDE.md files only by default, so the reliable fix is @AGENTS.md on its own line at the top of CLAUDE.md, which imports the file into every session.

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

The free fix, in one line

  • Replace the sentence with @AGENTS.md on its own line at the top of CLAUDE.md. Imports are expanded at launch, up to four hops deep.
  • Put anything that only Claude needs below the import.
  • Or make CLAUDE.md a symlink to AGENTS.md. Anthropic notes a Windows clone without core.symlinks checks a symlink out as a one-line text file.
  • Or change Claude Code’s Project instructions setting to claude-md-and-agents-md, which loads both files in every directory.
  • Check it in a session with /context: AGENTS.md should be listed under Memory files.
# CLAUDE.md
@AGENTS.md

## Claude only
- Use the Bash tool for git, never the web UI.

The numbers

MeasureValueSource
Root AGENTS.md files with a root CLAUDE.md beside them36.5% (weighted, 745 pairs)Harbor study, 18 Oct 2026
Of those CLAUDE.md files: ask Claude in a sentence to read AGENTS.md14.9%Harbor study, 18 Oct 2026
Never mention AGENTS.md at all16.4% (95% margin about 2.7 points)Harbor study, 18 Oct 2026
Import it with @AGENTS.md25.4%Harbor study, 18 Oct 2026
Are a symlink to AGENTS.md23.0%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: By default Claude reads AGENTS.md only when there is no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the working directory or above it. A CLAUDE.md that imports AGENTS.md gets both.
  • Claude Code memory docs, imports: CLAUDE.md files can import files with @path/to/import. Relative paths resolve from the importing file, and imports nest to a maximum depth of four hops.

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 reads the rules from both files at setup, so a rule that sat in AGENTS.md reaches the Claude Code session too, and its GitHub App checks each pull request against CLAUDE.md and AGENTS.md read from the base branch. 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

  • Does Claude Code read AGENTS.md?
  • Keep CLAUDE.md, AGENTS.md and .cursorrules in sync
  • The study behind the numbers
  • Claude Code strips HTML comments from CLAUDE.md, so a rule inside one never loads
  • Antigravity CLI skips AGENTS.md in subfolders and drops rule files without a valid trigger
  • Windsurf is now Devin Desktop: .devin/rules wins, and only one global_rules.md loads
  • CLAUDE.md and AGENTS.md drift apart in 7% of repos that copy one into the other: import instead
  • Every answer, by agent and problem

Questions

Does Claude Code follow "read AGENTS.md" written in CLAUDE.md?

Only if Claude decides to open the file. The sentence is an instruction, not an import, so whether AGENTS.md reaches the context depends on the model. @AGENTS.md on its own line is an import and always loads.

Does Claude Code read AGENTS.md if there is also a CLAUDE.md?

Not by default. With a CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in the folder you start in or above it, Claude reads the CLAUDE.md files only. Import AGENTS.md from CLAUDE.md, symlink it, or set Project instructions to claude-md-and-agents-md.

Should CLAUDE.md be a symlink or an import of AGENTS.md?

Either loads AGENTS.md. The import lets you add Claude-only lines below it and survives Windows clones; a symlink keeps one file but checks out as a one-line text file on Windows without core.symlinks.

How many repos get this wrong?

In our October 2026 sample of 745 repos with both files at the root, 14.9 percent asked Claude in a sentence and 16.4 percent never mentioned AGENTS.md, so in about 3 in 10 the AGENTS.md rules may never reach Claude.

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