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 using Antigravity 2.11.0's @path/to/file includes and measured the before and after across four real repositories. Maintenance surface dropped 62 percent. What a session actually reads dropped 1.7 percent. Here is why, plus the code that catches the silent failure mode.

Antigravity358AGENTS.md13agent design11monorepo7configuration7

Premium Article

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

Four 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 accumulates quietly.

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.

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 same file tree breaks two different ways depending on the resolution base

A decision surfaced almost immediately. When you write @rules/common.md, which rules/ is that?

Two options:

  • Root-relative: resolved from the project root. The same string means the same thing wherever you write it.
  • File-relative: resolved from the directory of the file containing the @. Moving the file changes what it means.

With a single level of includes, both behave identically. The difference only appears once an included file includes something else.

I built a three-file cycle to test it. a.md includes rules/b.md, which includes rules/c.md, which includes a.md.

Here is the same file tree expanded twice, changing only the resolution base:

--- base=root ---
{"entry": "a.md", "ok": false,
 "error": "circular include: a.md -> rules/b.md -> rules/c.md -> a.md"}

--- base=file ---
{"entry": "a.md", "ok": true, "base": "file", "chars": 48,
 "files": 3, "missing": ["rules/rules/c.md"], "duplicated": {}}

Root-relative caught the cycle and stopped. Expected.

File-relative did not stop. Inside rules/b.md, the string @rules/c.md resolves to rules/rules/c.md, which does not exist, so the include never happens. The cycle never closes, so no error fires. The expansion reports success and one file's worth of rules quietly vanishes.

This is the worst failure mode in the whole exercise. The breakage shows up as absence rather than as an exception. Nothing in the output looks wrong. It surfaces only as a vague sense that the agent is behaving a little oddly.

Rule files are not the kind of file you re-verify on every run. That is exactly why an omission survives for weeks.

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
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 $15 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-07-16
The More I Wrote in AGENTS.md, the Less Got Followed — Measuring Adherence and Cutting Rules
The rules in my AGENTS.md were being ignored — not from precedence conflicts or load failures, just plain ignored. Here is how I turned rules into checkable predicates, measured adherence over three weeks, and cut the file in half.
Agents & Manager2026-07-14
I Changed One Line in AGENTS.md and Broke the Agent — Regression-Testing the Instructions Themselves
Every time you edit the instructions you hand an agent — AGENTS.md, skill text — some other task quietly breaks. Here is a regression harness whose subject is the instructions, not the code: fixed tasks, deterministic assertions, and a way to wire it into unattended runs.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →