Skip to content
How it learnsFrom coding sessions, reviews, Slack and docs.Only what fitsEach session gets the few rules its task needs.Pull request reviewEvery PR checked against your team’s rules.Keep it trueA gate, conflicts, disputes and stale rules, handled.HandoffsCarry the work to another session or a teammate.SecurityWhat it sends, what it changes and how to leave.
Engineering teamsOne agent or several: what one person learns, every session uses.PR review onlyInstall the GitHub App. Nothing on anyone’s machine.Teams that mix agentsClaude Code, Cursor, Codex and Copilot, the same rules.On your ownYour corrections follow you across repos, machines and agents.Book a call30 minutes with Roei, if you want a hand. Never required.
DocsPricingSign in
Connect your agents →
For teamsOn your ownPR review onlyHow it learnsOnly what fitsPull request reviewKeep it trueSecurityDocsPricingSign inConnect your agents →
Home/Answers

Answers

Ignores its rule file

  • HTML comments in CLAUDE.md
  • "Read AGENTS.md" does not import
  • Antigravity ignores AGENTS.md
  • Windsurf ignores rules

Rule file too long

  • AGENTS.md too long for Codex
  • Antigravity rule size limit
  • Copilot instructions length
  • Cursor rules too long

Rules drift from the code

  • CLAUDE.md and AGENTS.md drift
  • Directory trees in rule files

Share rules across repos and agents

  • Share CLAUDE.md across repos
  • Share AGENTS.md in Codex
  • Copilot org instructions
  • Gemini CLI and AGENTS.md
  • Share Windsurf rules

Memory between sessions

  • Gemini CLI memory

Answers

Codex reads 32 KiB of AGENTS.md and cuts the rest: raise project_doc_max_bytes or trim

Published November 18, 2026

Codex reads at most 32 KiB of project instructions by default, one budget shared by every AGENTS.md from the repository root down, and it cuts the file that crosses it mid-text and drops the rest. 30,080 public AGENTS.md files are over that limit on their own. Raise project_doc_max_bytes in ~/.codex/config.toml, or cut the file.

For Codex. Vendor facts are from the pages linked below, read on November 18, 2026.

Two fixes

  • Measure: wc -c AGENTS.md plus every nested AGENTS.md on the path to the folder you start Codex in. The budget is the total.
  • Raise the cap in ~/.codex/config.toml with project_doc_max_bytes = 65536. In our test this brought back both a 33.6 KB root file and the nested file it had pushed out.
  • Or cut: OpenAI’s best-practices guide says a short, accurate AGENTS.md beats a long file of vague rules, and the prompt behind /init asks for 200 to 400 words.
  • Move folder-specific rules into that folder’s AGENTS.md, which loads only when you start Codex there or below.
  • Run codex debug prompt-input "hi" to print exactly what the model receives. Codex 0.168.0 and later also warn in the session when a file is truncated.
# ~/.codex/config.toml
project_doc_max_bytes = 65536

The numbers

MeasureValueSource
Codex default project_doc_max_bytes32 KiB, all project files togetherCodex AGENTS.md docs
Public AGENTS.md files over 32 KiB on their own30,080 (2.6% of all)Harbor study, 18 Oct 2026
Public AGENTS.md files over 24 KiB51,840 (4.5%), one nested file from the limitHarbor study, 18 Oct 2026
Median AGENTS.md length63 lines; 1 in 10 longer than 287Harbor study, 18 Oct 2026
AGENTS.md files longer than 200 lines17.8% (weighted, of 1,966)Harbor study, 18 Oct 2026

Study figures are weighted estimates from 1,935 CLAUDE.md and 1,970 AGENTS.md files sampled from public GitHub repositories on 18 October 2026, with GitHub's own counts for the totals. Every figure is in the study's CSV, and the method is in the study.

What the docs say

  • Codex: Custom instructions with AGENTS.md: project_doc_max_bytes is 32 KiB by default. Codex reads one file per folder from the project root and stops searching once it reaches your current directory.

Where Harbor fits

Harbor connects Claude Code, Codex, Cursor and GitHub Copilot (the CLI and VS Code agent mode; the cloud agent is not supported yet) through hooks and an MCP server. Through Codex’s own hooks it serves only the rules that apply to the task, at most three ranked rules per prompt, so the team’s rules do not compete for one 32 KiB budget. Codex runs a hook only after you trust it; harbor init records that trust and harbor doctor says when it is missing. Each rule shows how often it was served and how often an answer cited it. A citation is evidence a rule was used, not proof it was obeyed.

Read next

  • Why Codex ignores AGENTS.md, every cause
  • How long should a rule file be?
  • The study behind the numbers
  • Antigravity truncates each rule file at 24,000 bytes and caps always-on rules at 20,000 tokens
  • Copilot code review no longer stops at 4,000 characters of instructions: the limit was removed in June 2026
  • Keep each Cursor rule under 500 lines and split the rest by file pattern
  • Leave the directory tree out of CLAUDE.md and AGENTS.md: it goes stale and the agent can list files itself
  • Every answer, by agent and problem

Questions

Is there a size limit on AGENTS.md in Codex?

Yes. project_doc_max_bytes defaults to 32 KiB for all project AGENTS.md files together, spent from the root down. The global ~/.codex/AGENTS.md is not counted against it.

What happens when AGENTS.md is over 32 KiB?

Codex keeps the start, cuts the file that crosses the budget mid-text and drops any files after it. Before Codex 0.168.0 the only sign was a line in a log file; 0.168.0 and later warn in the session.

How do I increase the AGENTS.md limit in Codex?

Set project_doc_max_bytes = 65536 (or another byte count) as a top-level key in ~/.codex/config.toml, then start a new session.

How many AGENTS.md files are too big for Codex?

GitHub code search counted 30,080 public AGENTS.md files over 32 KiB on 18 October 2026, 2.6 percent of all of them, and 51,840 over 24 KiB.

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it learns
  • Only what fits
  • Pull request review
  • Keep it true
  • Handoffs
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • Install
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Share Claude Code memory with a team
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Copilot Memory and Dreaming

Compare

  • All comparisons
  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen
  • vs MemPalace
  • vs Sentra
  • vs Trail-code

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborConnect your agents