Skip to main content

max-agents-instruction-chain-bytes

Enforce a maximum cumulative UTF-8 byte size for active Codex project instructions.

Rule catalog ID: R001

Targeted pattern scope

  • **/AGENTS.md
  • **/AGENTS.override.md

What this rule reports

  • The active Codex instruction chain is {{actualBytes}} bytes, exceeding the {{maxBytes}}-byte limit. Split or shorten the guidance, or align this rule's maxBytes option with project_doc_max_bytes.

Why this rule exists

Enforce a maximum cumulative UTF-8 byte size for active Codex project instructions.

❌ Incorrect

A file in the targeted scope that produces any diagnostic listed above is incorrect for this rule.

✅ Correct

A file is correct when it uses the documented Codex structure and produces no diagnostic from this rule.

Behavior and migration notes

Included in:

  • codex.configs.recommended
  • codex.configs.strict
  • codex.configs.all

The optional object accepts maxBytes (default 32768) and fallbackFilenames, an array of additional basename-only instruction files. The byte count uses UTF-8 and follows Codex's active instruction-file precedence.

ESLint flat config example

The preset layers supply the correct Markdown, TOML, or JSON language configuration. Override the rule only in a later matching flat-config entry:

import codex from "@typpi/eslint-plugin-codex";

export default [
...codex.configs.recommended,
{
rules: { "codex/max-agents-instruction-chain-bytes": "error" },
},
];

Further reading