◉ANTIGRAVITY LABJP
Articles/Agents & Manager
◈ Agents & Manager/2026-08-30Advanced

What @ Includes Actually Shrink When You Split Agent Rule Files

I split my rule files with Antigravity 2.11.0's @ includes and measured before and after. Maintenance surface dropped 62 percent; what a session reads dropped 1.7 percent. Against the 24,000-byte cap after expansion, here is the ordering that keeps repository-specific rules from being cut, plus an expander that catches missing, doubled, and over-cap includes.

Antigravity425AGENTS.md15agent design12monorepo7configuration8

✦ Premium Article

I stopped mid-sentence while copying the same warning into a fourth file.

A handful of static site repositories, each with its own rule file for the agent. The openings differ. Everything past the introduction is nearly identical. Fixing one line meant opening the other three and hunting for the same spot. As an indie developer juggling several projects at once, this kind of hand-copying piles up before you notice.

Antigravity 2.11.0, released on August 26, added @path/to/file inside AGENTS.md and custom rule files. Referenced files get inlined directly. That duplication could finally collapse.

I assumed the read volume would drop along with it. When I measured my own files, it did not. Something else did.

Then, in November, the per-file limit was documented in bytes, and the August result stopped being merely "it does not shrink." The later sections cover how I now order files against that cap and how I triage the failures it causes.

Splitting reduces maintenance surface, not what a session reads

The conclusion first. Here is what happened when I split four repository rule files into a shared part and a per-repository part, then reassembled them with @.

What is being measuredBeforeAfterChange
Total bytes across files you maintain340,824129,22962% smaller
Expanded bytes a session reads (one repository)85,73684,2601.7% smaller

The maintenance surface fell to roughly a third. What the agent actually receives barely moved.

The reason is obvious in hindsight. An include inlines the target in place. Collapsing shared rules into one file does not change the fact that every file referencing it still carries the full text once expanded. The duplication disappears on disk and in review. For the expanded input, nothing happened.

Some finer numbers. Counting non-blank lines across the four files: 3,430 lines total, 1,214 of them unique. 695 lines appear verbatim in all four files, totaling 35,639 characters.

MetricLines
Total non-blank lines across four files3,430
Unique lines after deduplication1,214
Lines present in all four files695
Lines present in two or more files780

Only 35 percent of the content was distinctive. The rest was text I had transcribed by hand. In that state, forgetting one edit leaves each repository's agent working from a different set of assumptions. The reason to split was never input reduction. It was making that divergence structurally impossible.

Get this backwards and you split, see no improvement in the metric you were watching, and conclude the feature was not worth it. Decide what you are buying before you start.

The 24,000-byte cap after expansion makes this result matter more

As of November 2026, the official Rules documentation states a per-file cap of 24,000 bytes for AGENTS.md, GEMINI.md, and .agents/rules/*.md. Anything past the cap is truncated from the end, and the count is taken after includes are expanded. The limit used to be described as 12,000 characters; it is now measured in bytes.

Going back to the table above, I sat looking at one number for a while. One repository expanded to 84,260 bytes. If everything is expanded from a single entry file, that is three and a half times the cap. In August I was satisfied to have confirmed that splitting did not change the read volume. Read against today's documentation, roughly the last seventy percent would never reach the agent at all.

Includes do not split the cap. The expanded result is still judged as one file. A tiny AGENTS.md that pulls in a large shared file goes over even if the entry itself is a few hundred bytes. I built a small tree and ran it through the expander below:

{"entry": "AGENTS_en.md", "ok": false, "base": "root", "bytes": 25830, "files": 2,
 "missing": [], "duplicated": {}, "over": 1830,
 "cut_inside": "## Shared 8", "dropped": ["## Specific to this repository"]}

The entry is 125 bytes. With the shared file inlined it becomes 25,830 bytes, 1,830 over. The field worth reading is dropped. The repository-specific section, which I had written after the include line, is pushed past the cap in its entirety.

When I moved that section above the include line and ran the same check, the overflow was the same 1,830 bytes, but dropped came back empty. Only the tail of the last shared section was cut. You cannot always change how much gets truncated, but the ordering decides what gets truncated.

Specific rules first, shared rules last. If something has to fall off, let it be the text every repository already has. Of everything I changed during this split, that ordering rule did the most. A missing tail of shared rules can be covered elsewhere, through subdirectory rules or rules loaded only when relevant. A repository's own assumptions live in exactly one place.

One caveat. I have not re-measured, inside Antigravity itself, exactly where it truncates. The expander's verdict is an estimate that follows the documented behavior. There is an open request on the CLI repository to make the cap configurable, the way Codex exposes project_doc_max_bytes (issue #1863). As of November 2026 I would design on the assumption that it cannot be changed.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Estimate what splitting your rule files will and will not reduce, using measurements from your own repository
✦Catch the silent rule-drop that happens when include paths resolve against the wrong base, before you ship the change
✦Spot a layout where a shared rule file gets pulled in twice and doubles your expanded input, before you run it
✦See which sections the 24,000-byte cap pushes out after expansion, and order your files so repository-specific rules survive
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Agents & Manager2026-07-25
The night my agent shipped nothing: giving generation agents an abstain outcome
When you score a background generation agent by how much it produces, the quality gate quietly loosens over time. Here is a three-valued ACCEPT / ABSTAIN / REJECT design that counts a zero-artifact run as a success, with the code and the measurements from running it.
◈ Agents & Manager2026-11-19
Before an Agent Reads Your Issues: Splitting GitHub Actions Into a Reader Job and a Writer Job
Anyone can write an issue body. When an agent reads it inside GitHub Actions, split the workflow into a reader job with no write access and a writer job that never runs the agent, keep the body out of the shell, and check the agent's proposal with a small Python script. Working code included.
◈ Agents & Manager2026-11-14
The Agent PR I Approved Was Rewritten a Week Later: Counting Which Lines Survive 14 Days with git blame
Agent PRs often sail through review, yet the same lines get rewritten soon after merge. Here is a git blame script that counts how many of a commit's added lines are still there 14 days later, plus the four traps that made my first version report wrong numbers: renames, formatter commits, date reversals and shallow clones.