Skip to content

Codex ignores your AGENTS.md: the causes OpenAI documents

By the Toolbay team · Checked against the sources below on

Codex builds its instructions once, at the start of a run, from ~/.codex and from every folder between the repo root and where you started it. If your rules are missing, the file was empty, cut off at the 32 KiB limit, replaced by an AGENTS.override.md, or not on that path. Ask Codex to summarise its instructions to see what it actually loaded.

How Codex finds the file

  1. Global: in Codex home (normally ~/.codex) it reads AGENTS.override.md if it exists, otherwise AGENTS.md.
  2. Project: starting at the project root (usually the Git root), it walks down to your current folder. In each folder it takes AGENTS.override.md, then AGENTS.md, then any fallback names, and at most one file per folder.
  3. Files closer to your current folder come later in the combined prompt, so they win.

Causes and fixes

  • Empty file: Codex ignores empty files.
  • Wrong folder: you started Codex outside the repo, or in a sibling folder the walk never reaches. Start it in the repo.
  • Override: an AGENTS.override.md higher up, or in Codex home, replaces the regular file. Delete or update it.
  • Too long: the combined files stop at project_doc_max_bytes (32 KiB by default). Raise it or split rules into nested folders.
  • Different name: a file called something else is ignored unless it is listed in project_doc_fallback_filenames in ~/.codex/config.toml. Restart Codex after changing it.
  • Different home: a non-default $CODEX_HOME points Codex at another global file.

See what loaded

terminal
codex -c log_dir=./.codex-log
# then read ./.codex-log/codex-tui.log

Or simply ask Codex to summarise its current instructions and check they appear in the order above.

When a skill or vault helps, and when it does not

Helps

  • Moving long procedures out of AGENTS.md into skills (.agents/skills/) keeps the always-loaded file short and under the limit.
  • A vault the agent reads on demand holds reference that would otherwise bloat AGENTS.md.

Does not help

  • A skill will not load if Codex started in the wrong folder either; fix discovery first.
  • Adding more rules to a file that is already cut off makes it worse.