Answers
Antigravity truncates each rule file at 24,000 bytes and caps always-on rules at 20,000 tokens
Published
Antigravity truncates any rule file above 24,000 bytes, counted after includes are expanded, and global plus always_on rules share a 20,000-token budget; past it, the largest files are reduced to pointers the agent reads only on demand. A long AGENTS.md written for Codex’s 32 KiB limit can therefore lose its end in Antigravity.
For Gemini CLI and Antigravity CLI. Vendor facts are from the pages linked below, read on November 18, 2026.
How to stay under it
- Measure with
wc -c AGENTS.md GEMINI.md, and count what your@[label](path)includes add, since the limit applies after they are inlined. - Split by subject into
.agents/rules/*.md, each with atrigger:. Aglobormodel_decisionrule loads its full text only when the task matches. - Keep the always-on set small: AGENTS.md, GEMINI.md, global files and
always_onrules all draw on the same 20,000 tokens. - Put the rules that matter most at the top of each file, since truncation removes the end.
---
trigger: model_decision
description: Database migrations and schema changes
---
Every migration gets a down step.The numbers
| Measure | Value | Source |
|---|---|---|
| Rule file truncation point | 24,000 bytes, after includes | Antigravity rules docs |
| Global and always_on rules | 20,000 tokens together, separate from skills and MCP | Antigravity rules docs |
| Public AGENTS.md files over 24 KiB | 51,840 (4.5% of all) | Harbor study, 18 Oct 2026 |
| Codex’s default limit, for comparison | 32 KiB | Codex AGENTS.md docs |
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
- Antigravity: Rules: Each rule file is truncated above 24,000 bytes after includes are expanded. Global and always_on rules share a 20,000-token aggregate budget; past it, the largest files are reduced to pointers the agent can read on demand.
Where Harbor fits
Harbor has no hooks for this agent. Its MCP server can be added to any MCP client, but then the agent has to decide to call it, which is the same weakness as a file it has to choose to open. If this is your main agent, the free fixes above are the answer today.
Read next
- Why Antigravity CLI skips AGENTS.md
- AGENTS.md too long for Codex
- The study behind the numbers
- 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
- Every answer, by agent and problem
Questions
Is there a size limit on AGENTS.md in Antigravity?
Yes. Each rule file, AGENTS.md and GEMINI.md included, is truncated above 24,000 bytes after includes are expanded, and global plus always_on rules share a 20,000-token budget.
What happens when Antigravity rules go over the token budget?
The largest files are reduced to pointers that the agent can read on demand, so their text is no longer in every prompt.
Did Gemini CLI have a GEMINI.md size limit?
Its GEMINI.md page states none. It concatenated every file found and sent them with each prompt.