Skip to content
For your teamWhat one developer teaches an agent, a teammate’s agent can use.How it worksWhere a lesson starts and how it reaches every agent.Code reviewYour team’s knowledge, checked in every PR.SecurityWhat it sends, what it changes and how to leave.Book a call30 minutes with Roei, if you want a hand. Never required.
On your ownYour corrections follow you across agents and repos.Install itnpx harborloop init, in your repo.Every commandWhat the CLI does, and how to take it off again.
DocsPricingSign in
Start free →
For teamsFor individualsHow it worksCode reviewSecurityDocsPricingSign inStart free →
Home/Blog

Blog

  • Supermemory alternatives
  • PR review against AGENTS.md
  • Claude Code second brain
  • Why Copilot ignores it
  • Cursor Team Rules
  • Rules vs skills
  • Claude Tag vs Claude Code
  • GitHub Copilot Memory
  • Codex memories
  • Cursor memories
  • Claude Code auto memory
  • Claude Code team memory
  • Supermemory Company Brain alternatives
  • 3,905 files checked
  • Why Codex ignores it
  • Mem0 alternatives
  • Codex skills
  • Karpathy's LLM wiki
  • Auto mode
  • Memory or documentation?
  • Best company brain tools
  • Claude Code and AGENTS.md
  • Claude Code skills
  • Claude Code hooks
  • claude-mem
  • Claude Code best practices
  • Karpathy CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Cursor rules
  • copilot-instructions.md
  • Why Claude ignores it
  • CLAUDE.md length
  • Committing CLAUDE.md
  • Agent memory compared
  • CLAUDE.md vs skills vs hooks
  • Make Claude Code remember
  • Review comments to rules
  • Slack decisions
  • Company brain
  • Context engineering, Claude 5
  • Context rot, stale rules
  • AGENTS.md research
  • ADRs for agents
  • Memory poisoning
  • Best MCP memory servers
  • Shared memory across agents
  • Growing CLAUDE.md
  • Which rules got used

Blog

Share memory and rules across Claude Code, Codex and Cursor

Published: November 8, 2026

You told Claude Code the refund window is 60 days on annual plans. Cursor did not hear you. Codex will invent 30. Each agent reads its own files, and none of them reads the others' memory.

The short answer: inside one repo, write the rules once in AGENTS.md. Codex and Cursor read it, and Claude Code reads it when there is no CLAUDE.md, or through an @AGENTS.md line in one. Across repos, no single file is read by all three. Each tool has its own place for rules that apply everywhere, and each covers only you. For a team, it is an admin setting in each tool, or one source all your agents reach. For what each one stores on its own, see what each agent remembers.

In one repo: one AGENTS.md

  • Codex reads AGENTS.md from the repo root down to the folder you started in. Our note on why Codex ignores AGENTS.md covers the 32 KiB limit and the other ways it gets skipped.
  • Cursor reads AGENTS.md in the project root and in subfolders, and reads a CLAUDE.md the same way.
  • Claude Code reads AGENTS.md in a project with no CLAUDE.md. If you keep a CLAUDE.md for Claude-only notes, Anthropic's docs suggest an @AGENTS.md line at its top. A symlink, ln -s AGENTS.md CLAUDE.md, also works, but Claude will not edit through it, and on Windows the import is the safer choice.

To check, run /context in Claude Code and look under Memory files, or run codex debug prompt-input to see what Codex sends. More in AGENTS.md vs CLAUDE.md and does Claude Code read AGENTS.md.

Across your repos: one place per tool

Each tool has rules that apply to every project on your machine, and each keeps them somewhere different:

ToolRules for every repoWorth knowing
Claude Code~/.claude/CLAUDE.md and ~/.claude/rules/Both load alongside a project's files. ~/.claude/CLAUDE.md can import a file kept anywhere with @~/path, with no approval prompt.
Codex~/.codex/AGENTS.md, or AGENTS.override.md beside itRead before the project files. Only the first non-empty file there counts, and the override wins.
CursorUser Rules in Customize, then Rules, and files in ~/.cursor/rulesUser Rules live on your account and sync, and Inline Edit ignores them. The files stay on the machine.
Copilot CLI~/.copilot/copilot-instructions.mdCOPILOT_CUSTOM_INSTRUCTIONS_DIRS can point it at a folder that holds an AGENTS.md.

None of these is read by the other tools, so the same rule still lives in three places: a file Claude imports, a file Codex reads, and a setting in Cursor. And every one of them is yours alone. Each teammate sets up their own, and they drift the day someone edits one.

Sharing what the agents learn: one memory server in all three

Rules files hold what you wrote down. What each agent learns on its own stays in that agent: Claude Code's auto memory, Codex memories and Copilot Memory are each read by one tool, and Cursor removed its Memories in 2.1. To share what was learned, point all three at the same MCP memory server. Each tool has a project file for it, so the setup can be committed with the repo. The server URL below is a placeholder; use your server's, and keep tokens in environment variables, never in the file.

Claude Code writes .mcp.json at the repo root:

claude mcp add --transport http memory --scope project https://memory.example.com/mcp

# .mcp.json
{
  "mcpServers": {
    "memory": { "type": "http", "url": "https://memory.example.com/mcp" }
  }
}

Cursor reads .cursor/mcp.json in the project (or ~/.cursor/mcp.json for every project):

{
  "mcpServers": {
    "memory": {
      "url": "https://memory.example.com/mcp",
      "headers": { "Authorization": "Bearer ${env:MEMORY_TOKEN}" }
    }
  }
}

Codex reads .codex/config.toml in a trusted project (or ~/.codex/config.toml):

[mcp_servers.memory]
url = "https://memory.example.com/mcp"
bearer_token_env_var = "MEMORY_TOKEN"

Three things decide whether this works in practice:

  • The agent has to call it. An MCP tool is pulled, not pushed: the agent searches memory only when it decides to. Add one line to AGENTS.md, such as “Search the memory server before starting a task, and save any decision we settle,” and expect it to be skipped on some tasks.
  • Each tool asks first. Claude Code asks before it uses a server from .mcp.json, and Codex reads a project .codex/config.toml only in a project you have trusted. Each teammate approves once.
  • Three files, one server. The files differ in format, so a change of URL or name is three edits. Keep them in the same pull request.

Which servers are built for a team, and what each stores, is in the best MCP memory servers for teams. For a single developer on Claude Code only, claude-mem is the common choice.

Across a team's repos

Three ways, each with a cost:

  • An admin setting in each tool. Claude Code reads a managed CLAUDE.md placed on every machine, or set from the claude.ai admin console on Team and Enterprise plans. More on what Claude Code shares. Codex takes managed developer instructions in requirements.toml. Cursor has Team Rules on Teams and Enterprise, which an admin can enforce. Copilot has organization instructions on Business and Enterprise, for Copilot Chat on GitHub.com, code review and the cloud agent. That is four consoles, four formats and the right plan in each.
  • A shared rules repo, synced into each tool. A script copies one source into every file above. It works, but you are back to copies, kept in step by a script.
  • One source all your agents reach. An MCP server or hooks that hand each session the rules from one place. This is what Harbor does.

Where Harbor fits

Harbor keeps one set of rules for the team, learned from where you already decide: Slack threads, pull request reviews and docs, plus what agent sessions record. Sign up, name your workspace, then run npx harborloop init: it installs hooks that Claude Code, Cursor, Codex and Copilot already know how to run, and each session then starts with the rules that apply to this repo and this task, not the whole file. Any MCP client can reach the same rules through Harbor's MCP server, and harbor doctor checks that they are reaching the agents you think they are.

You set the gate on what gets in: Manual holds everything for a person, Hybrid (the default) puts routine rules live on trial and holds the rest, and in every mode a secret, an install step or a clash Harbor cannot settle waits for a person. For each rule, Harbor counts how often it was served and how often an answer cited it. A cite is evidence a rule was used, not proof it was followed. Setup is self-serve, and the quickstart shows the steps.

Questions

How do I share memory between Claude Code and Cursor?

Point both at the same MCP memory server. Claude Code reads it from .mcp.json (claude mcp add --transport http memory --scope project <url>), Cursor from .cursor/mcp.json, and Codex from .codex/config.toml in a trusted project. Each agent still decides when to search it, so add a line to AGENTS.md asking it to.

Is there one file Claude Code, Codex and Cursor all read?

Inside a repo, AGENTS.md: Codex and Cursor read it, and Claude Code reads it when there is no CLAUDE.md, or through an @AGENTS.md line in one. For rules across all your repos, no: Claude Code reads ~/.claude/CLAUDE.md, Codex reads ~/.codex/AGENTS.md, and Cursor keeps User Rules in its settings.

How do I share rules across repos in Claude Code?

Put them in ~/.claude/CLAUDE.md or ~/.claude/rules/, which load in every project on your machine. ~/.claude/CLAUDE.md can import a file kept anywhere with @~/path, without an approval prompt.

Where do global rules go in Codex?

In ~/.codex/AGENTS.md, or ~/.codex/AGENTS.override.md, which wins when it exists. Codex reads it before the project files and uses only the first non-empty file at that level.

How does a team share the same rules across Claude Code, Codex and Cursor?

Either an admin setting in each tool (a managed CLAUDE.md, Codex requirements.toml, Cursor Team Rules, Copilot organization instructions), each on its own plan, or one source every agent reaches through hooks or an MCP server, such as Harbor.

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 works
  • Every agent
  • Code review
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

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

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Does Claude Code read AGENTS.md?
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Make Claude Code remember

Compare

  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborStart free