Codex reads one file per folder, from the repo root down to where you work, and the closest wins. Claude Code reads AGENTS.md only when no CLAUDE.md sits in your folder or above it. So a team with several repos needs short rules in each repo, and one shared home for the rules every repo repeats.
Two agents look for instructions in different ways, and the difference decides whether a team's rules actually reach the agent. Everything about how the two tools load files below comes from their own documentation, read on December 3, 2026, with the sources at the end.
This page is for someone who runs two to ten repos with Claude Code, Codex or both, and wants one rule to be true in all of them. We make Almanac, a shared docs tool for people and agents, so weigh the last section with that in mind.
Codex checks its home folder first (~/.codex). It uses AGENTS.override.md there if it exists and is not empty, otherwise AGENTS.md, and only the first non-empty file at that level.
Then it starts at the project root, usually the Git root, and walks down to the folder you are working in. In each folder it takes at most one file, checking AGENTS.override.md, then AGENTS.md, then any names listed in project_doc_fallback_filenames. The files are joined from the root downward, so the one closest to your folder comes last and overrides the earlier ones. The combined size stops at 32 KiB by default, and Codex stops adding files after that. It builds this once per run, so restart it after you change a file.
Claude Code's own file is CLAUDE.md. It can also read AGENTS.md, but by default only when you have no CLAUDE.md, .claude/CLAUDE.md or CLAUDE.local.md in your working folder or any folder above it. If you have both an AGENTS.md and a CLAUDE.md, it reads the CLAUDE.md files only. Reading AGENTS.md directly needs Claude Code version 2.1.277 or later.
The way to use both is a CLAUDE.md that imports the AGENTS.md. An import is a line starting with @ and a path, relative to the file that contains it, and imports can nest up to four levels. Anthropic recommends keeping each CLAUDE.md under about 200 lines. An import that points outside your working folder asks for approval the first time a project uses it.
Three things follow from the two sets of rules. First, if a repo has only an AGENTS.md, Codex and Claude Code both read it, as long as nobody adds a CLAUDE.md or a CLAUDE.local.md. A personal CLAUDE.local.md quietly stops Claude Code from reading the team's AGENTS.md, which is easy to miss. Second, an AGENTS.md in a subfolder only applies when work happens there, so put rules for one service in that service's folder and not at the root. Third, the 32 KiB limit in Codex is shared by all the files in the chain, so a long root file leaves less room for the folder files.
The harder question is the rules every repo repeats, such as how to name a branch, how to write a commit message, or what never to touch. Our own judgment, not a vendor's: keep each repo's AGENTS.md to what is true of that repo, and write each shared rule down once, in one place, with each repo's file pointing to it. Copying the same paragraph into ten files means ten copies that drift.
Almanac can be that one place for shared rules. The shared rules live as a doc in a workspace, teammates who do not use git can comment on and edit them, and Claude Code, Codex, Claude and ChatGPT read them through the connector at https://almanac.io/mcp. A change to a key doc such as AGENTS.md always arrives as a suggested edit for a person to approve.
What Almanac does not do is change how Claude Code or Codex load a file in a repo. The loading rules above still apply, so each repo keeps its own short AGENTS.md. If your team has one repo and everyone uses git, you do not need Almanac for this: one AGENTS.md at the root and a CLAUDE.md that imports it is enough.
Claude Code: how Claude remembers your project
Yes, by default only when there is no CLAUDE.md in your working folder or above it, and from version 2.1.277. If you have both files, make the CLAUDE.md import the AGENTS.md.
The one closest to your working folder. Codex joins one file per folder from the repo root down, and later files override earlier ones, up to 32 KiB combined.
Keep each repo's AGENTS.md short and specific to that repo, and write each shared rule once in one place that every repo points to. Copies of the same text drift apart.
No to both. This Almanac, at almanac.io, is shared docs for people and AI agents, built on markdown files in GitHub.