Rules & Context

Antigravity Ignoring AGENTS.md? Fix Rules in 2.0

Updated: July 21, 2026

First identify the Antigravity surface, then use its documented instruction path

Troubleshooting AGENTS.md and workspace rules in Antigravity 2.0

If Antigravity appears to ignore AGENTS.md, first check whether you are using the CLI or Antigravity 2.0. The CLI migration guide explicitly supports workspace-local AGENTS.md and GEMINI.md in the active directory. Antigravity 2.0's current Rules documentation instead directs workspace rules to .agents/rules.

Get the latest on AI, LLMs & developer tools

New MCP servers, model updates, and guides like this one — delivered weekly.

CLI or Antigravity 2.0?

These surfaces share an agent platform, but their documented customization paths are not identical. Use this table before changing filenames or settings.

SurfaceDocumented workspace instructionsGlobal instructions
Antigravity CLIAGENTS.md or GEMINI.md in the active directory~/.gemini/GEMINI.md
Antigravity 2.0Markdown rules in .agents/rules at the workspace or Git root~/.gemini/GEMINI.md

The CLI paths come from Google's official Gemini CLI migration guide. The Antigravity 2.0 path, activation modes, and global file come from the current Rules documentation.

Fix AGENTS.md in Antigravity CLI

The CLI guide says it parses AGENTS.md and GEMINI.md from the active directory. That makes the launch directory the first thing to verify:

pwd
ls -la AGENTS.md GEMINI.md 2>/dev/null
agy
  1. Run pwd in the same shell where you start agy.
  2. Put AGENTS.md in that active directory, with the exact filename and case.
  3. Start a new conversation after changing the file. The official CLI reference says /clear (alias /new) resets active conversation context.
  4. If you launch from a monorepo package directory, keep the instructions needed for that package in the active directory rather than assuming a nested-discovery algorithm.

Conversation history is also scoped to the current working directory, according to the official CLI conversation guide. If behavior changes between folders, confirm that you did not resume a different folder-scoped conversation.

Fix Rules in Antigravity 2.0

For the visual Antigravity 2.0 product, use its documented Rules UI:

  1. Open the Customizations panel from the agent panel menu.
  2. Open Rules and create a workspace rule.
  3. Store the Markdown rule under .agents/rules. Google notes that the older .agent/rules path remains backward compatible.
  4. Choose the activation mode that matches the job: Always On, Manual, Model Decision, or Glob.

A rule silently appearing “ignored” is often an activation mismatch. A Glob rule applies only to matching files; a Manual rule must be mentioned; a Model Decision rule is conditional. Put repository-wide invariants in an Always-On workspace rule. Google documents a 12,000-character limit per rule file, so split large instruction sets by purpose.

Keeping AGENTS.md as the source of truth: Antigravity 2.0 rules support file references with @filename. A workspace rule created under .agents/rules can reference a repository file with a relative path such as @../../AGENTS.md. Confirm the path from the rule file's location; relative references are resolved from that file.

Find Conflicting Instructions

Both current docs identify ~/.gemini/GEMINI.md as global developer context. Antigravity 2.0 may also have several workspace rules with different activation modes. Audit all instruction sources before concluding that a file was not loaded:

sed -n '1,240p' ~/.gemini/GEMINI.md 2>/dev/null
find .agents/rules .agent/rules -type f -print 2>/dev/null

Look for direct contradictions: test commands, package managers, formatting rules, generated-file policies, and directories the agent may edit. The official docs do not publish a conflict-precedence order for AGENTS.md versus GEMINI.md, so do not depend on one “winning.” Remove the contradiction or scope the rules explicitly.

Verify the Rule Loaded

Use a harmless, deterministic marker rather than judging a broad style rule. Temporarily add this sentence to the rule you are testing:

When asked for the repository codename, answer exactly: ORBIT-CHECK.

Start a new conversation, ask for the repository codename, and remove the marker after it succeeds. If it fails:

  1. Recheck the active CLI directory or 2.0 project root.
  2. Confirm the rule activation mode.
  3. Check the 12,000-character limit.
  4. Replace any indirect reference with a one-line rule in the native location to isolate a path-resolution problem.
  5. Then restore the real rule and test one concrete instruction, such as the exact test command.

Avoid Undocumented Settings

Current official documentation does not describe a context.fileName setting, a nested-AGENTS toggle, or a guaranteed GEMINI.md-over-AGENTS.md precedence rule. This guide therefore does not recommend them. Use the documented active-directory files in the CLI or .agents/rules activation modes in Antigravity 2.0.

After loading is fixed, add instructions incrementally and test one concrete behavior at a time. Use Google's current Rules documentation for supported activation modes, file references, and limits.

Frequently Asked Questions

Does Antigravity CLI support AGENTS.md?

Yes. Google's migration guide says the CLI parses AGENTS.md and GEMINI.md in the active directory.

Where should Antigravity 2.0 workspace rules live?

The current Rules documentation specifies .agents/rules at the workspace or Git root and retains backward support for .agent/rules.

Should I enable nested AGENTS.md loading?

No such toggle is documented in the current official pages. For package-specific 2.0 behavior, use a Glob workspace rule. For the CLI, launch from the active directory whose context file you intend to use.

Which wins, GEMINI.md or AGENTS.md?

The current documentation confirms both CLI files but does not specify a conflict order. Keep their instructions consistent instead of relying on undocumented precedence.

All Sources and Links

Primary Google Antigravity documentation