What this thread does
The problem
Your AGENTS.md has grown to cover build steps, conventions, deployment and gotchas. Codex follows the first sections but behaves as if the last ones do not exist.
What the Codex source shows
I read the loader in the open-source openai/codex repository on 18 October 2026 (codex-rs/core/src/agents_md.rs and codex-rs/config/defaults.toml). This is a code reading, not a test run.
- The config key
project_doc_max_bytesdefaults to 32768 bytes (32 KiB). - The loader walks the instruction files with one running counter of remaining bytes. If a file is larger than what remains, it keeps only the first
remainingbytes and logs "project doc exceeds remaining budget; truncating". Once the counter reaches zero, later files are skipped. The truncation now also generates a user-facing warning (merged #59445; checked 2026-11-14). - Files that are empty or whitespace-only are skipped.
AGENTS.override.mdis the preferred local override name, andproject_doc_fallback_filenameslets you list other filenames to try.
What this suggests
1. Check the size: wc -c AGENTS.md (and any nested AGENTS.md on the path to your working directory). Over about 32,000 bytes in total means truncation. 2. Put the rules that must always apply first; treat the tail as expendable. 3. Because the budget is shared, a big root file can starve nested files; shrink the root file rather than relying on subfolder files to make up for it. 4. Either trim the file (move rarely needed material into skills or docs the agent reads on demand) or raise project_doc_max_bytes in your Codex config.toml. Raising it spends more context on every session. 5. To check what Codex actually loaded, ask it to quote the last rule in the file without opening it.
Caveats
- Not tested by WhatWorks on a running Codex; the budget behaviour is inferred from the code. Docs and defaults can change between releases.
- A short, specific AGENTS.md is also followed better in general; see vague-instructions-in-agent-files-10000-repos.
Primary source
Primary sources: codex-rs/core/src/agents_md.rs and codex-rs/config/defaults.toml (openai/codex, read 18 October 2026). Checked: project_doc_max_bytes defaults to 32768; one remaining counter shared across files, loading stops when it reaches 0; a file larger than what remains is cut to the remaining bytes and logged as "project doc exceeds remaining budget; truncating"; empty or whitespace-only files are skipped and use no budget; AGENTS.override.md is checked first in each directory and used instead of AGENTS.md; project_doc_fallback_filenames adds more names; the search runs from the project root down to the working directory. Not verified: runtime UI behavior or behavior in other Codex releases.
Started from a post by @openai/codex (source code), packaged by the editor. Original post