Codex ignores your AGENTS.md. Fix discovery path, overrides and size limits
If Codex skips your project rules, put non-empty guidance in `AGENTS.md` (or `AGENTS.override.md`) on the path from the repo root to your cwd, watch for a higher override or empty file, and raise `project_doc_max_bytes` if the combined docs are truncated. Short answer: 5 steps. 1) Put the file where Codex actually looks; 2) Start Codex from the directory the rules cover; 3) Clear empty files and surprise overrides; 4) Raise the byte cap or split large docs; 5) Verify what loaded.
Last updated: · This page is the decision checklist; the tools list for “Make Codex AGENTS.md apply” is a separate URL.
How do I fix this: Codex ignores your AGENTS.md?
Put the file where Codex actually looks
Codex builds an instruction chain once per run. It reads global guidance from `~/.codex/AGENTS.override.md` or `~/.codex/AGENTS.md`, then walks from the project root down to your current working directory, taking at most one file per directory (`AGENTS.override.md`, then `AGENTS.md`, then any `project_doc_fallback_filenames`). Files closer to your cwd win because they appear later in the merged prompt. Guide: https://developers.openai.com/codex/guides/agents-md
Start Codex from the directory the rules cover
Discovery stops at your cwd. If rules live in `services/payments/AGENTS.md` but you launch Codex from the repo root, that nested file is not on the path. Use `codex --cd services/payments` (or open that folder) so the chain includes it.
Clear empty files and surprise overrides
Empty instruction files are skipped. An `AGENTS.override.md` in Codex home or higher in the tree replaces the normal `AGENTS.md` at that level. Rename or remove the override when you want the base file back, and confirm `echo $CODEX_HOME` points at the home you edited.
Raise the byte cap or split large docs
Combined project docs stop at `project_doc_max_bytes` (32 KiB by default). If later nested rules never appear, raise the limit in `~/.codex/config.toml` or split guidance across nested directories so critical rules stay under the cap.
Verify what loaded
From the repo, run `codex --ask-for-approval never "Summarize the current instructions."` and expect Codex to quote global then project guidance in order. For a nested check: `codex --cd subdir --ask-for-approval never "Show which instruction files are active."` Restart Codex after config changes; the chain is rebuilt each run.
Which tools are best to make Codex AGENTS.md apply?
AGENTS.md guide
Official discovery order, overrides, fallback filenames, byte limits, and verify commands.
Custom instructions with AGENTS.md
Same AGENTS.md layering for Codex / ChatGPT agent configuration.
Codex CLI
Local agent entry point; use --cd and config.toml for discovery settings.
Advanced configuration
project_doc_max_bytes and project_doc_fallback_filenames in config.toml.
Open: 1 spot per week
One labeled sponsor for this topic each week; this week's spot is open. See open weeks →
All tools for “Make Codex AGENTS.md apply” →
Related fixes
- Stop a Cursor agent loopHow to fix a Cursor agent loop (same edit, or work after Stop)Fix →
- Claude Code vs Codex vs Cursor ~$20 plansClaude Code vs Codex vs Cursor $20 plan limits: how to pick without burning the weekFix →
- Scan a vibe-coded app for leaked API keysCheck a vibe-coded app for leaked API keys before you share itFix →
- Add an MCP server to Claude Code, Cursor, or CodexHow to add an MCP server to Claude Code, Cursor, or CodexFix →
See also AI tools launched today on the daily board.
NewAIToolsToday Daily
Top 3 AI launches, one model or news item that matters, and one simple fix. A 5-minute read, every weekday.