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

Share CLAUDE.md rules across repos with ~/.claude/rules, a symlinked .claude/rules, or a managed CLAUDE.md

Published November 18, 2026

Claude Code has three documented ways to share rules across repositories: ~/.claude/rules/ and ~/.claude/CLAUDE.md for one person on one machine, a shared rules folder symlinked into each repo’s .claude/rules/, or a managed CLAUDE.md that IT deploys to every developer machine. None of them reaches a teammate on Codex or Cursor.

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

Pick by who needs the rules

  • Just you, every repo: put rules in ~/.claude/rules/*.md or ~/.claude/CLAUDE.md. They load in every project on that machine.
  • The team, chosen repos: keep a shared rules repo and symlink it into each repo’s .claude/rules/. Claude asks once per project to approve external imports, and only rules without a paths field load.
  • The whole company: deploy a managed CLAUDE.md with MDM or Ansible. Developers cannot exclude it with claudeMdExcludes.
  • Or import a shared file from each CLAUDE.md with an absolute path, such as @/opt/team-rules/rules.md; imports take relative and absolute paths.
  • Network paths do not work: a symlink to a UNC share or a path under /net is not followed.
# macOS managed CLAUDE.md
/Library/Application Support/ClaudeCode/CLAUDE.md
# Linux and WSL
/etc/claude-code/CLAUDE.md
# Windows
C:\Program Files\ClaudeCode\CLAUDE.md

The numbers

MeasureValueSource
Import depthUp to four hopsClaude Code memory docs
Root AGENTS.md files with a CLAUDE.md beside them, two files to keep per repo36.5% (weighted)Harbor study, 18 Oct 2026
Public CLAUDE.md files on GitHub839,680Harbor 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, share rules across projects: The .claude/rules/ directory supports symlinks, so you can maintain a shared set of rules and link them into multiple projects. Linked rules outside the working directory load only after you approve external imports for the project.
  • Claude Code memory docs, organization-wide CLAUDE.md: Organizations can deploy a centrally managed CLAUDE.md that applies to all users on a machine, distributed with MDM, Group Policy or Ansible. It cannot be excluded with claudeMdExcludes.

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. A rule saved once reaches every teammate’s session in every repo, in Claude Code and the other three agents, with nothing to symlink or deploy. Rules can be scoped to a Space, so a payments rule reaches only the people on that Space. 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

  • Sync AGENTS.md and CLAUDE.md across repos
  • Claude Code team memory
  • Should you commit CLAUDE.md?
  • Codex shares instructions across repos only through ~/.codex/AGENTS.md, one person at a time
  • Copilot organization instructions reach every repo, but only on GitHub.com and in code review
  • Gemini CLI reads AGENTS.md only if context.fileName lists it; Antigravity CLI reads it by default
  • Share Windsurf rules across repos with ~/.devin/rules, and with other agents through AGENTS.md
  • Every answer, by agent and problem

Questions

How do I share one CLAUDE.md across all my repositories?

For yourself, ~/.claude/CLAUDE.md or ~/.claude/rules/ loads in every project. For a team, symlink a shared rules folder into each repo’s .claude/rules/ or import it with @path. For a company, deploy a managed CLAUDE.md.

Where does the managed CLAUDE.md go?

macOS: /Library/Application Support/ClaudeCode/CLAUDE.md. Linux and WSL: /etc/claude-code/CLAUDE.md. Windows: C:\Program Files\ClaudeCode\CLAUDE.md. Managed settings can also carry the text in a claudeMd key.

Do symlinked rules in .claude/rules load automatically?

Not when the target is outside the working directory. Claude Code asks once per project to approve external imports, and after that only rules without a paths field load.

Does a shared CLAUDE.md reach teammates on Codex or Cursor?

Not on its own. Codex reads CLAUDE.md only if it is listed in project_doc_fallback_filenames. Put shared rules in AGENTS.md and import it from CLAUDE.md to cover both.

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