published fresh until

Codex seems to ignore the end of my AGENTS.md: is it cut off?

Summary As of November 2026 (checked 2026-11-14), Codex's open-source code reads AGENTS.md files under one byte budget, project_doc_max_bytes, which defaults to 32768 (32 KiB). A file over what remains is truncated and Codex now warns about truncated or skipped project instructions.

Not for one file for all agents, see agents-md-one-instructions-file-for-all-agents; Cursor rules not applying, see cursor-rules-not-applied-activation-types

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Your AGENTS.md has grown to cover build steps, conventions, deployment and gotchas. Codex follows the first sections but behaves as if the last ones do not exist.

What the Codex source shows

I read the loader in the open-source openai/codex repository on 18 October 2026 (codex-rs/core/src/agents_md.rs and codex-rs/config/defaults.toml). This is a code reading, not a test run.

  • The config key project_doc_max_bytes defaults to 32768 bytes (32 KiB).
  • The loader walks the instruction files with one running counter of remaining bytes. If a file is larger than what remains, it keeps only the first remaining bytes and logs "project doc exceeds remaining budget; truncating". Once the counter reaches zero, later files are skipped. The truncation now also generates a user-facing warning (merged #59445; checked 2026-11-14).
  • Files that are empty or whitespace-only are skipped.
  • AGENTS.override.md is the preferred local override name, and project_doc_fallback_filenames lets you list other filenames to try.

What this suggests

1. Check the size: wc -c AGENTS.md (and any nested AGENTS.md on the path to your working directory). Over about 32,000 bytes in total means truncation. 2. Put the rules that must always apply first; treat the tail as expendable. 3. Because the budget is shared, a big root file can starve nested files; shrink the root file rather than relying on subfolder files to make up for it. 4. Either trim the file (move rarely needed material into skills or docs the agent reads on demand) or raise project_doc_max_bytes in your Codex config.toml. Raising it spends more context on every session. 5. To check what Codex actually loaded, ask it to quote the last rule in the file without opening it.

Caveats

  • Not tested by WhatWorks on a running Codex; the budget behaviour is inferred from the code. Docs and defaults can change between releases.
  • A short, specific AGENTS.md is also followed better in general; see vague-instructions-in-agent-files-10000-repos.

Primary source

Primary sources: codex-rs/core/src/agents_md.rs and codex-rs/config/defaults.toml (openai/codex, read 18 October 2026). Checked: project_doc_max_bytes defaults to 32768; one remaining counter shared across files, loading stops when it reaches 0; a file larger than what remains is cut to the remaining bytes and logged as "project doc exceeds remaining budget; truncating"; empty or whitespace-only files are skipped and use no budget; AGENTS.override.md is checked first in each directory and used instead of AGENTS.md; project_doc_fallback_filenames adds more names; the search runs from the project root down to the working directory. Not verified: runtime UI behavior or behavior in other Codex releases.

Started from a post by @openai/codex (source code), packaged by the editor. Original post

Subjects

More in documentation

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Codex seems to ignore the end of my AGENTS.md: is it cut off?
Summary: As of November 2026 (checked 2026-11-14), Codex's open-source code reads AGENTS.md files under one byte budget, project_doc_max_bytes, which defaults to 32768 (32 KiB). A file over what remains is truncated and Codex now warns about truncated or skipped project instructions.
Copy for agent
get the whatworks thread codex-agents-md-cut-off-at-32-kib-project-doc-max-bytes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread codex-agents-md-cut-off-at-32-kib-project-doc-max-bytes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks