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
  • Sync rules across repos
  • Why Codex ignores it
  • Keep rule files in sync
  • 3,905 files checked
  • Why Copilot ignores it
  • Cursor Team Rules
  • Cursor rules
  • copilot-instructions.md
  • Claude Code and AGENTS.md
  • AGENTS.md research

CLAUDE.md and context engineering

  • Why Claude ignores it
  • Test a CLAUDE.md rule
  • One CLAUDE.md for all projects
  • Context engineering, Claude 5
  • CLAUDE.md length
  • Which rules got used
  • Context rot, stale rules
  • Growing CLAUDE.md
  • Claude Code best practices
  • Karpathy CLAUDE.md
  • Committing CLAUDE.md

Built-in agent memory

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

Team knowledge and shared conventions

  • Claude Code team memory
  • Who owns CLAUDE.md
  • Claude Code second brain
  • Shared memory across agents
  • Stop repeated mistakes
  • Hand off between agents
  • 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
  • claude-mem alternatives
  • Supermemory alternatives
  • Mem0 alternatives
  • claude-mem
  • Best MCP memory servers
  • Supermemory Company Brain alternatives

Blog

How do I use the same CLAUDE.md in all my projects?

Published November 18, 2026

Put the rules in ~/.claude/CLAUDE.md. Claude Code loads that user file in every project on your machine, alongside each repo's own CLAUDE.md. The other agents each have their own: ~/.codex/AGENTS.md for Codex, User Rules for Cursor, personal instructions for Copilot Chat on GitHub.com. None of them reaches a teammate.

That is the short answer. Below: where each agent keeps its user-level file, how to keep one copy for Claude Code and Codex, how to share a set with only some repos, and what goes wrong when the home file and the repo file disagree. Facts are from each vendor's docs, read on 18 November 2026.

Where each agent keeps rules for all your projects

AgentWhereWhat it covers
Claude Code~/.claude/CLAUDE.md, plus any .md files in ~/.claude/rules/“Personal preferences for all projects”, shared with “only you” (memory docs)
Codex~/.codex/AGENTS.md, or AGENTS.override.md there if it exists. CODEX_HOME moves the folderEvery session, read before the project files (AGENTS.md guide)
CursorUser Rules, under Customize, then RulesAll projects, in Agent (chat) only. Rules do not affect Tab (rules docs)
GitHub CopilotPersonal instructions, from your profile picture in Copilot ChatEvery Copilot Chat conversation on the GitHub website, and nowhere else (GitHub docs)

In VS Code, Copilot has user-level instruction files as well; its custom instructions page lists the locations your setup supports.

What goes in the home file, and what does not

The home file is for you, not for the repo: your shell aliases, “explain the plan before a large edit”, the test data you like, the way you want commit messages written. A rule the whole team should follow belongs in the repo's file, where a teammate's agent reads it and a reviewer sees it change. If it lives only in your home folder, your agent follows it and theirs never hears of it.

When the home file and the repo file disagree

Nobody wins cleanly. Claude Code loads user rules before project rules, and the memory docs say “neither set overrides the other: if a user rule and a project rule conflict, Claude may follow either one, so keep the two consistent.” Each agent orders the layers its own way:

AgentOn a conflict
Claude CodeBoth load; Claude may follow either
CodexFiles closer to the working directory come later in the prompt, so the repo file overrides the home file
CursorTeam Rules, then Project Rules, then User Rules; earlier sources take precedence
Copilot (GitHub.com)Personal instructions take the highest priority, then repository, then organization

So a personal “use npm” beats the repo's “use pnpm” in Copilot Chat, loses to it in Codex and Cursor, and is a coin toss in Claude Code. Keep the home file to things no repo has an opinion on, and the question never comes up.

One home file for Claude Code and Codex

Keep a single file and point both agents at it. In Claude Code, an import in a user-scope file loads without the approval dialog, because it is a file you wrote yourself:

# one file you edit, read by both agents
mkdir -p ~/.codex
# append, so an existing ~/.claude/CLAUDE.md is kept
echo '@~/agent-rules.md' >> ~/.claude/CLAUDE.md
# only if ~/.codex/AGENTS.md does not exist yet
ln -s ~/agent-rules.md ~/.codex/AGENTS.md

# check each one sees it
codex --ask-for-approval never "Summarize the current instructions."
# and in Claude Code: /context all, under Memory files

Codex's docs say nothing about symlinks either way, which is why the snippet ends with its check: the summary should echo your global guidance first. If it does not, copy the file instead. Write the import as @~/agent-rules.md, not as a sentence. In our scan of 1,935 public CLAUDE.md files, 6.4 percent point at AGENTS.md in a sentence instead of importing it (the study, data). A sentence works only if Claude decides to open the file; an import puts the text in context.

One case where this breaks: in Cowork sessions on the desktop, Claude Code skips an import in a user file that points outside the session's working directory, and skips a ~/.claude/CLAUDE.md that is itself a symlink. That is why the snippet imports rather than links on the Claude side.

Rules for some of your repos, not all

For a set that belongs to a few projects, such as your company's backend repos, Claude Code lets .claude/rules/ hold a symlink:

# a set of rules for some of your repos, not all of them
ln -s ~/shared-claude-rules .claude/rules/shared

Two catches, both from the memory docs:

  • A link that points outside the project counts as an external import, so the rules do not load until you approve external imports for that project, once, in a dialog at the start of a session.
  • After approval, only linked rules without a paths field load. A path-scoped rule behind a link stays off.

If you work across several worktrees of one repo, note that a gitignored CLAUDE.local.md exists only in the worktree you made it in. The docs' fix is an import from home, such as @~/.claude/my-project-instructions.md, in the project's file.

What a home file cannot do

  • It stays on one machine. A new laptop, a cloud agent or a teammate starts without it.
  • It is one more copy to keep current. Four agents means four places, unless you link them as above.
  • It holds what you remembered to write. A correction you typed in a session last week is not in it unless you added it.

For rules a whole team shares across many repos, the answers are a sync job or each vendor's admin setting, compared in how to sync AGENTS.md and CLAUDE.md across repos.

Where Harbor fits. For one person on one machine, the home file is enough, and Harbor adds little. Harbor is for the team version of the question: it keeps the team's rules in one place and serves them to each person's Claude Code, Codex, Cursor and Copilot sessions, scoped by repo through Spaces, so no file has to be copied to each machine or repo. Your own home file keeps working beside it. Setup is in the quickstart.

Questions

How do I make a CLAUDE.md apply to all my projects?

Write it at ~/.claude/CLAUDE.md, or as .md files in ~/.claude/rules/. Claude Code loads both in every project on your machine, alongside each repo's own CLAUDE.md. They are personal: no teammate's agent reads them.

Is there a global AGENTS.md for Codex?

Yes. Codex reads AGENTS.md from its home folder, ~/.codex unless CODEX_HOME points elsewhere, and reads AGENTS.override.md there instead if it exists. The global file comes first, so project files later in the prompt override it.

What happens when my global CLAUDE.md conflicts with the project one?

Both load, and neither overrides the other. Anthropic's docs say Claude may follow either rule, so keep the two consistent. Codex lets the closer file win, Cursor puts Team, then Project, then User Rules, and Copilot on GitHub.com puts personal instructions first.

Can Claude Code and Codex share one global rules file?

Yes. Keep one file, import it from ~/.claude/CLAUDE.md with a line like @~/agent-rules.md, and link or copy it to ~/.codex/AGENTS.md. Then ask Codex to summarize its current instructions and run /context all in Claude Code to check both see it.

More on CLAUDE.md and context engineering

  • Why does Claude ignore my CLAUDE.md?
  • How do I test if Claude Code follows a CLAUDE.md rule?
  • Context engineering for Claude 5: what changes for teams
  • How long should CLAUDE.md be? Under 200 lines (median 81)

See which rules each agent was served and cited →

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