AGENTS.md and CLAUDE.md size limits: 32 KiB, 200 lines, 4 MiB
Short answer: Codex reads at most project_doc_max_bytes (32 KiB by default) of combined AGENTS.md content and stops adding files after that. Claude Code recommends keeping each CLAUDE.md under 200 lines, loads files up to 4 MiB in full and skips larger ones.
What changed
- Codex: “Codex skips empty files and stops adding files once the combined size reaches the limit defined by
project_doc_max_bytes(32 KiB by default).” OpenAI Codex: AGENTS.md guide ↗ - Codex config schema:
project_doc_max_bytesdefault 32768, “Maximum total bytes of project instruction content”. openai/codex config.schema.json ↗ - Claude Code: “target under 200 lines per CLAUDE.md file”, and “Claude Code loads a CLAUDE.md file of up to 4 MiB in full and skips a larger file.” Auto-memory
MEMORY.mdloads only its first 200 lines or 25KB. Claude Code docs: memory ↗ - Cursor: best practice is to “Keep rules under 500 lines”. Cursor docs: rules ↗
Who is affected
Teams with one big AGENTS.md or CLAUDE.md shared across agents. Content past Codex's 32 KiB budget is silently dropped, and very long CLAUDE.md files reduce adherence.
Exact fix
~/.codex/config.toml: raise the Codex budget (example: 64 KiB)
project_doc_max_bytes = 65536Or split by directory: nested files load only where they apply
AGENTS.md # repo-wide essentials
services/api/AGENTS.md
web/AGENTS.mdClaude Code: keep CLAUDE.md short; move scoped rules to .claude/rules/ with paths:
---
paths:
- "src/api/**/*.ts"
---
- Validate every input at the handler boundaryCheck your file size
Paste AGENTS.md / CLAUDE.md. Counted in your browser; nothing is uploaded.
Other agents
Gemini CLI: we did not find a documented size limit for GEMINI.md. Unknown. See the compatibility table.
FAQ
What is the AGENTS.md size limit in Codex?
How long can CLAUDE.md be?
Every claim above links to an official source (vendor docs, changelog or source code), except where a user report is labelled as such. Last verified 2026-10-14. All config changes · RSS