Codex
Codex ignoring rules at the bottom of your AGENTS.md? It stops loading instructions at 32 KiB
Codex merges your global, repo and nested AGENTS.md files and silently stops adding them once the combined text hits 32 KiB. Split rules into nested folders or raise project_doc_max_bytes.
What changed
Nothing new shipped; this is a documented limit that is easy to miss. When Codex starts a run it builds one instruction chain: your global ~/.codex/AGENTS.md (or AGENTS.override.md), then one AGENTS.md per directory from the repo root down to where you launched it. It joins them root-first and stops adding files once the combined size reaches project_doc_max_bytes, which is 32 KiB by default. Whatever comes after the cut, usually the most specific folder-level rules, never reaches the model. Tip spotted via @CodexUpdate on X (https://x.com/CodexUpdate/status/2109316872843985119), checked against OpenAI's AGENTS.md guide.
Who is affected
Anyone with a long global AGENTS.md or a big repo-root file, especially monorepos where the nested files closest to the code are the ones that get dropped.
What to do now
- Check which files actually loaded: from the folder you work in, run codex --ask-for-approval never "List the instruction sources you loaded."
- Trim the global and root files, and move team- or service-specific rules into AGENTS.md files inside those folders.
- If you really need more, raise the cap in ~/.codex/config.toml, for example project_doc_max_bytes = 65536, then start a new Codex session.
What is not confirmed
OpenAI's docs describe the cap but not exactly how a file that crosses the limit is cut, so treat anything near the boundary as possibly missing. A higher cap also means more of every prompt goes to instructions.
Sources
- OfficialOpenAI Codex docs: Custom instructions with AGENTS.md · Oct 5, 2026
Get updates like this every morning
- ① Email
- ② Card on Stripe
- ③ 7 days free
Then $2/month · cancel anytime in one click