Rules / Context budget

codex-chain-over-budget

AGENTS.md files from the root down exceed Codex's 32 KiB.

warning by default Context budget Needs the whole project Inline suppression allowed

Source: Codex docs: AGENTS.md (learn.chatgpt.com), read 14 October 2026.

On GitHub: the rule doc and the tests.

All rules73

What it catches#

AGENTS.md files from the root down exceed Codex's 32 KiB.

Codex reads every AGENTS.md (or AGENTS.override.md) from the project root down to the folder it starts in, and stops at 32 KiB in total (project_doc_max_bytes). This rule adds the chain up for each folder that has one and says which file gets cut or dropped. Only runs when the whole folder is linted.

Why it matters#

The budget is shared root first; the file that crosses it is cut and deeper files are dropped. AsItIs adds up every AGENTS.md (or AGENTS.override.md) from the root down to each folder.

Bad example#

AGENTS.md                 30 KB of shared rules
packages/api/AGENTS.md     6 KB of API rules

Started in packages/api, Codex reads the 30 KB root file and then only the first 2 KB or so of the API file. The rest of the API rules never reach it.

Good example#

AGENTS.md                 8 KB: what every package needs
packages/api/AGENTS.md     6 KB of API rules
docs/agents/style.md       linked from AGENTS.md, read when needed

How to fix#

Shorten the files higher up the chain, since they count against every folder below. Move reference material into files the agent opens when it needs them. If the chain really needs to be longer, raise project_doc_max_bytes in ~/.codex/config.toml, knowing every Codex session then spends that much context on it.

Suppress or configure#

For one finding, put a comment on the line above it. The reason after -- is optional but worth writing:

<!-- asitis-disable-next-line codex-chain-over-budget -- why this one is fine -->

For a whole file:

<!-- asitis-disable-file codex-chain-over-budget -- why this file is an exception -->

For every file, turn it off or change its severity in .asitisrc.json:

{ "rules": { "codex-chain-over-budget": "off" } }

A .asitisrc.json overrides entry limits a change to some paths, and a baseline (asitis lint --format json --write-baseline) accepts today's findings so only new ones fail the build.

Source#

Codex docs: AGENTS.md, read on 14 October 2026.

Run the rule

This page is generated from the plugin's rule registry. Edit it on GitHub. False positive? Open an issue with the line it fired on.