Codex CLI · Claude Code · Cursor · verified 2026-10-14

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_bytes default 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.md loads 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 = 65536

Or split by directory: nested files load only where they apply

AGENTS.md            # repo-wide essentials
services/api/AGENTS.md
web/AGENTS.md

Claude Code: keep CLAUDE.md short; move scoped rules to .claude/rules/ with paths:

---
paths:
  - "src/api/**/*.ts"
---
- Validate every input at the handler boundary

Check 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.

Moving this setup to another agent? Paste your config into the free converter: it outputs the exact files for Claude Code, Codex CLI, Cursor and Gemini CLI.

FAQ

What is the AGENTS.md size limit in Codex?
32 KiB of combined instruction content by default (project_doc_max_bytes = 32768). You can raise it in config.toml.
How long can CLAUDE.md be?
Anthropic recommends under 200 lines per file. Claude Code loads files up to 4 MiB in full and skips anything larger.

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