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

Antigravity CLI skips AGENTS.md in subfolders and drops rule files without a valid trigger

Published November 18, 2026

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 agy from 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/ a trigger: of always_on, glob, model_decision or manual. 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 manual rule 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

MeasureValueSource
Per rule file, after includesTruncated above 24,000 bytesAntigravity rules docs
Global plus always_on rules together20,000-token budget; the largest files become pointersAntigravity rules docs
Public AGENTS.md files over 24 KiB51,840 (4.5% of all), GitHub’s exact countHarbor study, 18 Oct 2026
Public AGENTS.md files on GitHub1,142,784Harbor 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.

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