"Did the agent actually receive my instruction file?" is a reasonable question with an unreasonable answer. For OpenAI's Codex CLI the documentation offers two ways to check. One is a log of which files were loaded. The other is to ask the agent — and an open issue in the project's own tracker demonstrates that the agent answers that question confidently and wrongly.
What the documentation specifies
Discovery is precise. A global file lives in the Codex home directory, which defaults to ~/.codex unless CODEX_HOME is set; there Codex reads AGENTS.override.md if present, otherwise AGENTS.md, and uses only the first non-empty file at that level. For the project, it starts at the project root — typically the Git root — and walks down to the current working directory, checking each directory for AGENTS.override.md, then AGENTS.md, then any names configured in project_doc_fallback_filenames, including at most one file per directory. With no project root found, only the current directory is checked.
Files are concatenated from the root down, joined with blank lines. Conflict handling is positional rather than principled: files closer to the current directory "override earlier guidance because they appear later in the combined prompt". Codex stops searching at the current directory, so nothing below it is read.
Loading happens "once per run; in the TUI this usually means once per launched session", and the chain is rebuilt on every run, so "there is no cache to clear manually". If instructions look stale, the guidance is to restart.
There is a size limit: project_doc_max_bytes, 32 KiB by default. The documented behaviour is that Codex "skips empty files and stops adding files once the combined size reaches the limit". Troubleshooting advice is to raise the limit or split large files across nested directories.
Notably absent from the documentation: whether the instruction text is re-transmitted with each model request, and any mention of prompt caching.
The two documented checks
A log. codex -c log_dir=./.codex-log opts into a plaintext TUI log, and ./.codex-log/codex-tui.log can then be read to audit which instruction files were loaded. A session JSONL file is also mentioned, though no flag for enabling session logging is given. Importantly, this is presented as an audit of which files loaded — not as a dump of the bytes the model received.
Asking the agent. The documentation suggests running the agent with approvals off and asking it to summarise the current instructions, or to list the instruction sources it loaded, and states what a correct answer looks like — that it reports the global file first and the repository root file second.
That second check is the one to look at closely.
The open bug under the recommended check
An issue filed in May 2026 against CLI version 0.131.0, still open, reproduces the documented procedure exactly: put one instruction in the global file, a different one in the working directory's file, then ask.
Asked to summarise the current instructions, the agent summarises both — so both files did load.
Asked to list the instruction sources it loaded, it names the working-directory file and omits the global one.
Asked to list the instruction files it loaded, likewise: the working-directory path, no mention of the global file.
Asked where a specific instruction came from — one that exists only in the global file — it names the workspace file, and quotes the instruction exactly.
The last step is the damaging one. The answer is specific, sourced and quoted, and it is wrong about provenance. A user following the documented verification procedure would conclude their global file is not being read, or that their workspace file contains something it does not, and would act on that. A separate open request asks for proper source attribution and provenance in the first place, which tells you this is not considered solved.
So the recommended check detects presence correctly and reports origin incorrectly, and nothing in the documentation warns you which of the two you are getting.
What the check would be for: silent truncation
An issue open since March 2026, against 0.108.0-alpha.3, reports that the instruction file is silently truncated at 32 KB — roughly 600 to 800 lines — with instructions past that point "dropped and never sent to the model" and "no warning anywhere in the TUI, /stats, exec, or VS Code extension". The reporter's expectation is modest: warn at startup so the user can trim the file or raise the configured limit. The comparison drawn is to another coding agent that displays a prominent warning when its instruction file is too large.
A second issue, filed in August 2026 with line-level source references and re-verified before filing, adds three behaviours it says are implemented but documented nowhere:
The 32 KiB default caps the combined project-directory chain, not each file.
Files load root-first, so when the budget runs out the truncation hits the deepest, most specific file first — cut mid-file, with only a tracing warning emitted.
The global file is exempt from the budget entirely and loads in full with no length check.
Its worked example is the Codex repository's own instruction file: 22,519 bytes, about 70 percent of the default budget. A contributor working in a nested directory gets root plus a 564-byte nested file, leaving roughly 9,685 bytes of headroom before silent leaf-first truncation begins. Nothing warns an author that growing the root file shrinks the budget for every nested file in the tree.
A third open issue reports that the limit's semantics are documented as per-file on one page and cumulative on another, with the code being cumulative.
Put these next to the documented behaviour — Codex "stops adding files once the combined size reaches the limit" — and the gap is clear. The documentation describes a whole-file inclusion rule. The source, per the issue, implements a mid-file cut on the most specific file in the chain.
Why this pattern is worth naming
Three properties combine badly:
The failure is silent. Truncation produces no user-visible warning in any surface.
The symptom is indistinguishable from model unreliability. An instruction that was never sent looks exactly like an instruction that was ignored, and the natural conclusion is that instruction files "don't really work".
The documented diagnostic is unreliable in precisely the dimension you would use it for. Asking the agent which file a rule came from is the obvious move, and it is the move an open issue says returns confident fiction.
That combination means the common practitioner advice — keep the instruction file short — is right for a reason most people do not know. It is not primarily about token cost. It is about staying clear of a cumulative cap whose truncation is silent, leaf-first, and invisible to every documented check.
Tradeoffs in the design
A cumulative budget rather than per-file. Bounds total prompt growth, at the cost of coupling every file in the tree: a root-file edit silently changes what nested files get.
Root-first load order with leaf-first truncation. Later text overrides earlier text in the combined prompt, so loading root-first makes specificity win — but it also means the budget is spent on the least specific guidance and exhausted on the most specific.
The global file exempt from the cap. Protects personal rules from project-file growth, and means the one file most likely to go unaudited has no size bound at all.
Positional conflict resolution. No ordering rules to document and no resolution logic to maintain, at the price of there being no defined answer to "which rule wins" beyond prompt position.
Rebuild per run rather than cache. Removes a staleness class and a cache-clearing command, and makes mid-session edits a restart.
Failure modes
An instruction near the end of a large file is never sent, and the agent appears to disobey.
Growing a root instruction file silently truncates nested files elsewhere in the repository that nobody edited.
A rule is traced to the wrong file by the agent's own report, and the wrong file gets edited.
A personal global file grows without bound because no cap applies to it, and nothing audits it.
Two files at different depths disagree; nothing reports the conflict and the outcome depends on prompt position.
A mid-session edit is made and not picked up, with no message saying so.
A review checklist
What is the combined byte size of your instruction chain for the directory you actually work in — root file plus every file down to it? Compare it to the configured cap, not to a guess.
How much headroom is left before the deepest file starts being cut? Compute it; nothing will tell you.
Is your global instruction file audited by anything? It is exempt from the cap.
Is your verification method a log of loaded files, or the agent's own report of where a rule came from? Only the first is deterministic, and the second has an open provenance bug.
When an agent ignores a rule, is "it was truncated and never sent" on your list of hypotheses before "the model is unreliable"?
Do you have a rule stated in two files at different depths? Write it once.
If you raised the cap, did you record why, and does anyone know the limit is cumulative?
Related entries
R443 — the same question in another agent, where the per-request cost is undocumented and unmeasurable; here the cap is documented and the truncation is not.
R395 — an instruction-file reload rule that is documented and widely misread, where the operative act turns out to be exiting rather than starting fresh.
R438 — pairwise precedence documented without a global ordering, the same positional-conflict pattern.
R424 — splitting the instruction file by which rules a binary can actually enforce.
R314 — keeping the instruction file short by routing to skills fetched on demand, which this gives a second, stronger reason for.
R203 — rules that drift and intent that is lost, seen from the specification side.