Home › Rules › Antigravity subagents

Google Antigravity subagents: custom agents, the agents folder and examples

From Google's own Antigravity docs (Custom subagents, the /agents command, Plugins and Customization discovery), checked Nov 7, 2026. Sources below.

Short answer: yes, Antigravity has subagents, in the Antigravity App and the Antigravity CLI. The main agent starts them with its invoke_subagent tool, and they run in the background at the same time as you keep working. Three come built in (research, browser and self). You can add your own custom agent by writing a Markdown file with YAML frontmatter in .agents/agents/<name>.md (or .agents/agents/<name>/agent.md) for one project, or in ~/.gemini/config/agents/ for every project. name and description are required. In the CLI, /agents shows them all.

What a subagent is (and isn't)

The built-in subagents

NameWhat Google says it's for
researchCodebase research, file navigation and structural exploration
browserRuns sandboxed web browsers for interactive browser testing. Started only with the /browser slash command.
selfA direct clone of the calling agent, with the same system instructions and tools

Where custom agent files go

ScopePathUse it for
This project.agents/agents/<name>.md or .agents/agents/<name>/agent.mdAgents your team should share. Commit them with the code.
Every project~/.gemini/config/agents/<name>.md or .../agents/<name>/agent.mdYour own helpers on this computer
A pluginplugins/<plugin_name>/agents/Agents that come with an installed plugin
Make the agents folder (project or global)
# One project only
mkdir -p .agents/agents/test-runner
# -> write .agents/agents/test-runner/agent.md

# Every project on this computer
mkdir -p ~/.gemini/config/agents/code-reviewer
# -> write ~/.gemini/config/agents/code-reviewer/agent.md

Two things trip people up, per Google's customization-discovery doc and the /agents page:

Like rules and skills, Antigravity checks the .agents/ folder in your workspace and each parent folder up to the repository root, never subfolders below where you started. Google also still recognizes .agent/, _agents/ and _agent/, but says to use .agents/ for new projects.

The frontmatter fields

FieldDefaultWhat it does
nameRequiredThe agent's unique name
descriptionRequiredWhat the planner reads to decide when to hand work to this agent
tools[]The tools it's allowed to use, such as view_file, replace_file_content, grep_search, run_command
subagenttrueThe main agent can start it with invoke_subagent
mainAgenttrueYou can pick it as your main chat agent
modelinheritinherit, flash or pro
commandExecutionPolicysandboxHow shell commands run: off, auto, eager or sandbox
mcpServers[]MCP servers just for this agent
skills / plugins[]Skill paths (like skills/my-helper-skill) or plugins it depends on

Everything after the closing --- is the agent's system prompt. Google's example uses plain Markdown headings like # System Prompt and # Review Guidelines.

Watch the tool names. Google lists a known issue: a misspelled or unknown name in tools "may cause the subagent process to hang." Copy the names exactly. Google says better validation and a fix are planned.

Examples you can copy

The smallest one (from Google's /agents page)

~/.gemini/config/agents/code-reviewer/agent.md
---
name: code-reviewer
description: Rigorous code review specialist focusing on edge cases and security.
---
You are an expert code reviewer. Analyze diffs carefully and verify edge cases.

That's all you need: a name, a description and a prompt. With no tools line it falls back to the defaults in the table above.

A test runner (our example)

This one and the next are examples we wrote for this page, using only fields and tool names from Google's docs. Change the steps to fit your project.

.agents/agents/test-runner/agent.md
---
name: test-runner
description: Runs the project's tests after a change, reads the failures and reports which files and lines are broken. Use after any code edit.
tools:
  - view_file
  - grep_search
  - run_command
subagent: true
mainAgent: false
model: flash
commandExecutionPolicy: sandbox
---

# System Prompt
You run tests and report results. You do not edit files.

# Steps
1. Find the test command in package.json, pyproject.toml or the README.
2. Run it once.
3. For each failure, give the test name, the file and line, and one sentence on why it failed.
4. If everything passes, say so in one line.

mainAgent: false keeps it out of your chat agent list, so it only runs when the main agent hands it work. model: flash is the lighter tier, which fits a job like reading test output.

A read-only code researcher (our example)

.agents/agents/docs-researcher/agent.md
---
name: docs-researcher
description: Read-only helper that finds where something is handled in this codebase (a route, a setting, a database table) and returns file paths with a short summary. Use before planning a change.
tools:
  - view_file
  - grep_search
subagent: true
mainAgent: false
model: inherit
---

# System Prompt
You only read. Never change files and never run commands.

# Output
- A list of the files that matter, each with one line on what it does.
- The exact function or line where the thing is handled.
- Anything that looks risky to change, in plain words.

No run_command and no replace_file_content in tools, so it can look but not change anything. That's a safe first subagent to try. Google's own longer example, a code-auditor with model: pro and a skills list, is on the Custom subagents page.

Matching kit: Codebase Fixer Agent ($8)

The free rules set the boundaries. The Codebase Fixer Agent adds the process for an app that already exists: a read-only audit, safety-net tests, one fix at a time with a commit after each, then a review of the whole diff.

See the Codebase Fixer Agent ($8) →

Instant download. 7-day refund, no questions asked.

How to use them

/agents, agy agents, agy --agent
# Inside an Antigravity CLI session
/agents          # open the Agent Manager panel

# From your shell
agy agents                 # list built-in, workspace and plugin agents
agy --agent code-reviewer  # start a session with that agent

Watch, message and stop them

Google caps nesting at 10 levels of subagents under the main agent.

Subagents vs /boost and /teamwork

Google also has two built-in multi-agent modes. /boost runs a three-level team for hard bugs and tricky refactors inside a normal session; Google lists it for the Pro and Ultra tiers (Google One AI Premium) and Enterprise plans. /teamwork runs a bigger team (a coordinator, explorers, workers, plus reviewers that check each milestone) for large, multi-day projects; it's on paid plans. Custom subagents are the simple version: you write the agent yourself and the main agent uses it when it fits. Plan quotas still apply to everything subagents do, so see Antigravity limits and AI credits before you start a lot of them.

Coming from Claude Code subagents?

The idea is the same: a Markdown file with YAML frontmatter, a description the main agent matches on, and a tool list. The folder and some field names differ (Claude Code uses .claude/agents/). Our Claude Code subagents examples page has 7 copy-paste agents; to reuse one here, move it to .agents/agents/ and change the tool names to Antigravity's.

Agent not showing up or hanging?

Next step for Antigravity: Agent Skills

Skills are folders your AI coding agent loads only when the job comes up, and Claude Code, Cursor and OpenAI Codex all read the same SKILL.md format. The Vibe Coder Skills Pack ($9) is 6 ready-to-copy SKILL.md skills (fix-one-bug, stop-the-loop, leak-check, ship-check, explain-project, builder-handoff) for Claude Code, Cursor and OpenAI Codex. Also included in the 6-kit bundle.

Get the Skills Pack for $9 on Gumroad → See what's inside

One .zip of skill folders plus one markdown file. 7-day refund, no questions asked.

Best value

All 6 kits for $29 — or $20.30 with code WELCOME30 (through Nov 30)

Subagents split the work. The kits give the agents the plan, step by step: a small game, a Discord bot, an email-triage agent, an MVP, or a cleanup of messy code.

Get all 6 kits for $29 → See what's in each kit

$29 instead of $48 for the six kits bought separately; WELCOME30 takes 30% off that at checkout ($20.30). Instant download from Gumroad. 7-day refund, no questions asked.

Related

Sources

Every folder, field and command here was checked Nov 7, 2026 on Google's own Antigravity docs. Subagents are new and Google is still changing them. If something here no longer matches, tell us at [email protected].

Free rules starter pack for Cursor, Claude Code, Codex and Antigravity

One shared AGENTS.md that works across Cursor, Claude Code, Codex, Copilot and Antigravity, plus database and test rules in each tool's format. Unzip it into your project and fill in two sections. I'll email you the link.

After that, an occasional email when I publish a new guide or rules file.

Free. No spam. Unsubscribe anytime. See our privacy note.