Answers
Antigravity CLI skips AGENTS.md in subfolders and drops rule files without a valid trigger
Published
Antigravity CLI loads AGENTS.md, GEMINI.md and .agents/rules/*.md only from the folder you start agy in and its parents up to the repository root, never from subfolders, and it silently discards a rule file in .agents/rules/ whose frontmatter has no valid trigger. Antigravity CLI replaced Gemini CLI for unpaid and Google One accounts on 18 June 2026, so a team that moved over with a nested GEMINI.md setup loses those files.
For Gemini CLI and Antigravity CLI. Vendor facts are from the pages linked below, read on November 18, 2026.
Check these, in order
- Start
agyfrom the folder whose rules you need, or move the rules up: subfolders below the workspace folder are not loaded. - Give every file in
.agents/rules/atrigger:ofalways_on,glob,model_decisionormanual. Without a valid one the file is dropped with no message. - Files nested in subfolders of
.agents/rules/are ignored unless listed in.agents/rules.json. - A
manualrule loads only when @-mentioned, and the CLI does not support rule mentions, so use another trigger in the CLI. - Keep each rule file under 24,000 bytes after includes are expanded; past that it is truncated.
---
trigger: glob
globs: ["services/payments/**"]
---
Webhook handlers acknowledge with 200, then enqueue.The numbers
| Measure | Value | Source |
|---|---|---|
| Per rule file, after includes | Truncated above 24,000 bytes | Antigravity rules docs |
| Global plus always_on rules together | 20,000-token budget; the largest files become pointers | Antigravity rules docs |
| Public AGENTS.md files over 24 KiB | 51,840 (4.5% of all), GitHub’s exact count | Harbor study, 18 Oct 2026 |
| Public AGENTS.md files on GitHub | 1,142,784 | 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
- Antigravity: Rules: CLI workspace rules are AGENTS.md, GEMINI.md or .agents/rules/*.md in the folder where you start agy or any parent up to the repository root; subfolders below are not loaded. Rule files need frontmatter with a valid trigger, or they are silently discarded.
- Gemini CLI: GEMINI.md files: Gemini CLI was replaced by Antigravity CLI on June 18th, 2026 for unpaid-tier and Google One users. Gemini CLI also scanned a directory’s GEMINI.md files just in time when a tool touched it.
- Antigravity: migrating from Gemini CLI: In the workspace the agent parses rule constraints in the active directory’s GEMINI.md and AGENTS.md, and global constraints in ~/.gemini/GEMINI.md.
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
- Does Gemini CLI read AGENTS.md?
- Antigravity’s 24,000-byte rule limit
- AGENTS.md vs CLAUDE.md, every agent
- Claude Code strips HTML comments from CLAUDE.md, so a rule inside one never loads
- "Read AGENTS.md" in CLAUDE.md does not load it: put @AGENTS.md on its own line
- Windsurf is now Devin Desktop: .devin/rules wins, and only one global_rules.md loads
- Every answer, by agent and problem
Questions
Does Antigravity CLI read AGENTS.md?
Yes. AGENTS.md and GEMINI.md in the folder you start agy in, or any parent up to the repository root, are always-on rules. Global ones live in ~/.gemini/AGENTS.md or ~/.gemini/GEMINI.md.
Why does Antigravity ignore a rule in .agents/rules?
Most often the file has no valid trigger in its frontmatter, and Antigravity silently discards it. The other causes are a file nested in a subfolder of .agents/rules that is not listed in .agents/rules.json, or a manual rule, which the CLI cannot mention.
Does Antigravity CLI read AGENTS.md files in subdirectories?
No. Its docs say subfolders below the workspace folder are not loaded. Gemini CLI did load a subfolder’s GEMINI.md when a tool touched it, so this is a change for teams that migrated.
Which wins when AGENTS.md and GEMINI.md disagree?
Google’s rules page does not give an order. It says discovered rules are combined into the prompt, so both sides of a contradiction reach the model. Delete one of them.