{"slug": "how-to-keep-the-same-rules-in-claude-code-codex-and-cursor", "title": "How to keep the same rules in Claude Code, Codex and Cursor", "summary": "Writing rules once in a repo-root AGENTS.md file lets Codex and Cursor read them directly, while Claude Code reads AGENTS.md only when no CLAUDE.md exists or via an @AGENTS.md import line, according to a blog post published October 6, 2026. Across repositories no single file is read by all three tools — Claude Code uses ~/.claude/CLAUDE.md and ~/.claude/rules/, Codex uses ~/.codex/AGENTS.md or AGENTS.override.md, and Cursor uses User Rules plus files in ~/.cursor/rules — so the same rule lives in three places. For teams, the post lists admin settings in each tool, a shared rules repo synced by script, or one source all three agents reach via an MCP server or hooks, which it says Harbor provides through `npx harborloop init`.", "body_md": "Blog\n\n# How to keep the same rules in Claude Code, Codex and Cursor\n\nPublished: October 6, 2026\n\nYou 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.\n\nThe 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 three agents reach.\n\n## In one repo: one AGENTS.md\n\n- **Codex** reads`AGENTS.md` from the repo root down to the folder you started in. Our note on[why Codex ignores AGENTS.md](https://gethrbr.com/blog/why-codex-ignores-agents-md) covers the 32 KiB limit and the other ways it gets skipped.\n- **Cursor** reads`AGENTS.md` in the project root and in subfolders, and reads a`CLAUDE.md` the same way.\n- **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.\n\nTo 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](https://gethrbr.com/blog/agents-md-vs-claude-md) and [does Claude Code read AGENTS.md](https://gethrbr.com/blog/does-claude-code-read-agents-md).\n\n## Across your repos: one place per tool\n\nEach tool has rules that apply to every project on your machine, and each keeps them somewhere different:\n\n| Tool | Rules for every repo | Worth knowing | \n|---|---|---|\n| 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. | \n| Codex | `~/.codex/AGENTS.md` , or`AGENTS.override.md` beside it | Read before the project files. Only the first non-empty file there counts, and the override wins. | \n| Cursor | User Rules in Customize, then Rules, and files in ~/.cursor/rules | User Rules live on your account and sync, and Inline Edit ignores them. The files stay on the machine. | \n| Copilot CLI | `~/.copilot/copilot-instructions.md` | `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` can point it at a folder that holds an`AGENTS.md` . | \n\nNone 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.\n\n## Across a team's repos\n\nThree ways, each with a cost:\n\n- **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. 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.\n- **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.\n- **One source all three agents reach.** An MCP server or hooks that hand each session the rules from one place. This is what Harbor does.\n\n## Where Harbor fits\n\nHarbor 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. `npx harborloop init` installs hooks that Claude Code, Cursor and Codex 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.\n\nYou set the gate on what gets in: Manual holds everything for a person, Hybrid (the default) adds routine rules and holds the rest, and a rule that contradicts a live one always 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. Harbor is in early access; the [quickstart](https://gethrbr.com/docs/quickstart) shows the setup.\n\n## Questions\n\n### Is there one file Claude Code, Codex and Cursor all read?\n\nInside 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.\n\n### How do I share rules across repos in Claude Code?\n\nPut 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.\n\n### Where do global rules go in Codex?\n\nIn ~/.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.\n\n### How does a team share the same rules across Claude Code, Codex and Cursor?\n\nEither 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.", "url": "https://wpnews.pro/news/how-to-keep-the-same-rules-in-claude-code-codex-and-cursor", "canonical_source": "https://gethrbr.com/blog/share-memory-claude-code-cursor-codex", "published_at": "2026-10-06 00:00:00+00:00", "updated_at": "2026-10-06 19:17:59.788575+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "agent-protocols", "ai-tools"], "entities": ["Claude Code", "Codex", "Cursor", "Anthropic", "GitHub Copilot", "Harbor"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-to-keep-the-same-rules-in-claude-code-codex-and-cursor", "markdown": "https://wpnews.pro/news/how-to-keep-the-same-rules-in-claude-code-codex-and-cursor.md", "text": "https://wpnews.pro/news/how-to-keep-the-same-rules-in-claude-code-codex-and-cursor.txt", "jsonld": "https://wpnews.pro/news/how-to-keep-the-same-rules-in-claude-code-codex-and-cursor.jsonld"}}