Build1 distinct publisher3 min readUpdated
Codex now has a documented precedence chain: one global file, then one file per directory from repo root down to your working directory, capped at 32 KiB. Determinism is the useful part.
The Engineer · Build desk
Compiled by The EngineerSomething wrong?How this is made
OpenAI's Codex documentation now specifies exactly how the agent discovers, orders and merges AGENTS.md files before it does any work [1]. That converts a pile of per-repo prompt files into something a platform team can standardize, diff and review, because the resolution order is stated rather than inferred.
The chain is built once per run, which in the TUI usually means once per launched session [2]. First comes global scope: in the Codex home directory (`~/.codex` by default, or wherever `CODEX_HOME` points), Codex reads `AGENTS.override.md` if present, otherwise `AGENTS.md`, and takes only the first non-empty file at that level [3]. Then project scope: starting at the project root, typically the Git root, Codex walks down to the current working directory, and in each directory checks `AGENTS.override.md`, then `AGENTS.md`, then any names listed in `project_doc_fallback_filenames`, including at most one file per directory [4]. If no project root is found, only the current directory is checked [5]. The files are concatenated from the root down, joined by blank lines, so files nearer the working directory win by appearing later in the combined prompt [6]. Empty files are skipped, and Codex stops adding files once the combined size reaches `project_doc_max_bytes`, 32 KiB by default [7].
Three consequences matter more than the syntax. First, the working directory is part of your configuration. The walk terminates at the current directory [8], so instruction files in directories below wherever the session was launched never load [3]. The same repository therefore produces different instructions depending on where a developer or a CI job starts Codex.
Second, an override shadows locally, not globally. OpenAI's sample tree shows `services/payments/AGENTS.md` ignored because an `AGENTS.override.md` sits beside it [9], but the root file is still concatenated ahead of it [4]. Committing an override into a service directory permanently suppresses that directory's AGENTS.md, which is a different behavior from the documented use of a global `AGENTS.override.md` as a temporary override you delete to restore shared guidance [15].
Third, the byte cap has a direction. Thirty-two KiB is 32,768 bytes for the entire chain [1], and because files are added root-first until the limit is hit, what gets dropped on overflow is the most specific guidance, not the most general [2]. OpenAI's advice is to raise the limit or split instructions across nested directories when you reach the cap [10]. For a platform team, the first thing to budget is the global file, since every repository inherits it.
The documented verification step is worth wiring into onboarding: run Codex with `--cd` into the specialized directory and ask it to list the instruction sources it loaded, expecting the global file first, the repository root AGENTS.md second, and the nested override last [11]. For GitHub code review, rules go in a `## Code Review Rules` section of the AGENTS.md closest to the code they govern, with repository-wide checks at the root and service-specific checks nested [12]. OpenAI advises keeping those rules concise, stating the behavior to flag plus any safe path or exception, and leaving formatting and lint checks to CI [13]. Repos already using another filename, such as `TEAM_GUIDE.md`, can add it to the fallback list [14].
Watch two things: whether `AGENTS.override.md` starts appearing in committed trees, where its shadowing is permanent rather than temporary [15][4], and whether teams notice the 32 KiB ceiling only after their most specific rules quietly stop loading [2].
Follow any of these and your For You feed starts watching them — no settings page required.
Ranked by verification strength, evidence, and original report placement.
Codex stops searching once it reaches the current directory, so the documentation advises placing overrides as close to specialized work as possible.
In OpenAI's sample repository tree, services/payments/AGENTS.md is ignored because an AGENTS.override.md exists in the same directory.
Running `codex --cd services/payments --ask-for-approval never "List the instruction sources you loaded."` is expected to report the global file first, the repository root AGENTS.md second, and the payments override last.
Codex reads AGENTS.md files before doing any work, and the documentation describes layering global guidance with project-specific overrides so each task starts with consistent expectations regardless of repository.
Codex builds an instruction chain when it starts, once per run; in the TUI this usually means once per launched session.
Global scope: in the Codex home directory (defaults to ~/.codex unless CODEX_HOME is set), Codex reads AGENTS.override.md if it exists, otherwise AGENTS.md, and uses only the first non-empty file at this level.
Evidence-backed comparisons of source perspectives and observed adoption signals. Read the methodology
Which Builder, Operator, and Investor concerns the observed source mix emphasized—not a truth score.
Evidence, demonstrated adoption, hype gap, incentives, and confidence are assessed independently, each on its own current evidence. How these are measured.
Authoritative but single-source vendor specification
The mechanics are stated precisely and first-hand by the vendor that implements them — scope order, per-directory filename order, concatenation direction, the 32 KiB default, and the config keys — which is strong evidence for what is documented. It is capped well below the top because there is exactly one source, no independent reproduction of the truncation or load order, and no version pinning for the described behavior.
No usage or deployment data supplied
The cluster contains only a vendor documentation page. It reports no install counts, repository counts, enterprise deployments, benchmark runs, or third-party reports of teams layering AGENTS.md files, so adoption cannot be scored without inferring facts the source does not provide.
Mechanics well specified, determinism claim unverified
The source is procedural and largely free of promotional language, so the gap is small. It is mildly positive because the framing of auditable, deterministic agent configuration rests on documented intent plus an opt-in log, with no independent verification, no version guarantees, and no described operator warning when the byte cap silently drops the most specific guidance.
First-party product documentation
OpenAI is documenting its own agent and steering users toward its configuration format and its GitHub code review product, so it has a clear interest in presenting the instruction chain as predictable and in encouraging teams to encode policy in AGENTS.md files. The incentive is ordinary developer-documentation self-interest rather than a contested claim about a rival, which keeps it short of the top of the range.
Confident on documented behavior, thin beyond it
For what Codex is documented to do, confidence is reasonably high: the source is authoritative and internally consistent, and the derived points follow directly from the stated ordering rules. Overall confidence is held to the low sixties because a single publisher supplies everything, adoption is unmeasurable from this material, and real-world behavior across Codex versions and non-TUI entry points is untested here.
product
A 2x LLM bill is not a bug report: token spend is an observability problem1 distinct publisher
build
Codex can now ask and keep going, which deletes the only checkpoint you were getting for free1 distinct publisher
build
Codex learns to click: the coding agent stops typing patches and starts operating the machine1 distinct publisher
build
Claude Code now outruns Copilot roughly two to one in JetBrains' survey of 15,000 developers1 distinct publisher
Distinct publishers with included, body-backed reporting in this cluster.
1 article · August 19, 2026