Getting Started with Google Antigravity (AGY): Four Entry Points, Directory Layout & Core Mechanics
When you start using Google Antigravity (AGY), the hardest part is rarely figuring out how to chat with it. It is usually these four questions:
- Google ships four surfaces at once (CLI, 2.0 desktop app, IDE, and Python SDK)—which one should you actually open every day?
- Why are config files split across
.agents/,~/.gemini/config/, and~/.gemini/antigravity-cli/? - Between Rules, Skills, Hooks, MCP, and Plugins, which ones actually matter on day one?
- When commands mention the Sandbox and approval rules, what gets blocked and what runs automatically?
This guide answers all four up front—skipping abstract theory in favor of the directory layout, practical trade-offs, and verified commands you will use daily.
1. Four Entry Points, One Shared Core
One of Antigravity’s best design choices is that all four surfaces run on the same Agent execution core (handling tool calls, context budgets, sandboxing, and extension loading) and share the same configuration. Here is the high-level architecture:

In daily work, each entry point has a clear role:
| Surface | What It Is | When to Use It |
|---|---|---|
agy CLI |
Terminal workhorse supporting both interactive TUI and -p non-interactive mode |
Daily coding, SSH sessions on remote servers, and CI scripts. Fastest startup—this is the primary focus of this series |
| Antigravity 2.0 | Standalone Electron desktop app with multi-project switching, scheduled tasks, and right-hand auxiliary panels | Monitoring multiple repositories at once, or inspecting background Subagents, Artifacts, and active terminals |
| Antigravity IDE | AI-first editor forked from VS Code | When you want Tab autocomplete (including multi-line diff predictions) and Cmd+I inline targeted edits while coding |
| Python SDK | pip install google-antigravity for launching async Agents from Python |
Batch code reviews, automated evaluations, or programmatically intercepting thoughts and tool_calls |
My recommendation: Do not install and learn all four on day one. If you already live in the terminal alongside Vim or VS Code, start with agy CLI alone. Once you need to juggle parallel repos, open Antigravity 2.0—project-level .agents/ and global ~/.gemini/config/ carry over automatically with zero duplicate setup.
2. How to Avoid Derailing: Run /plan Before Editing
The fastest way to burn time with a terminal coding agent is dumping a large feature request in one prompt, letting it edit a dozen files unchecked, discovering the design went off track at step one, and running git reset to start over.
Antigravity breaks complex tasks into four phases—Explore → Plan → Execute → Verify—anchored by the built-in /plan mode and Artifacts (structured documents such as implementation_plan.md and walkthrough.md):
flowchart TD
U["1. Submit Request"] --> E["2. Explore: Read code and config before editing"]
E --> P["3. /plan: Produce Implementation Plan artifact"]
P --> R{"4. Human Review"}
R -- "Wrong direction / add constraints" --> P
R -- "Approved" --> X["5. Execute: Edit code + run sandboxed commands"]
X --> V{"6. Local Verify: Run tests / build / inspect UI"}
V -- "Errors found, fix" --> X
V -- "Passed" --> W["7. Output Walkthrough Summary"]
In practice, two habits pay off far more than writing longer prompts:
- Run
/planwhenever a change touches more than 3 files: Have the agent list which files it intends to modify, how it will change them, and how it plans to verify the result. Tweaking one line in a plan is ten times cheaper than reverting a sprawling diff. - State the exact verification command up front: For example, “run
pytest tests/api/when done” or “verifyyarn buildexits cleanly.” Whenever there is a runnable local check, the agent closes the loop on most syntax errors and regressions on its own.
3. Directory Layout & What to Configure on Day One
Directory placement is the most common source of confusion when first reading the Antigravity docs. Memorize these three locations and everything else clicks into place:
- Project-level (committed to Git, shared across the team):
AGENTS.md/GEMINI.mdand the.agents/directory (also compatible with.agent/,_agents/, and_agent/). The agent walks upward from your current working directory to the Git root, automatically merging and deduplicating rules along the way. - User-global (shared across all local projects):
~/.gemini/config/(global Rules, Skills, Hooks, MCP, and Plugins). - CLI settings:
~/.gemini/antigravity-cli/settings.json(default model, permissions, terminal behavior, etc.).
When configurations share the same name, precedence strictly follows: current project directory > explicit declarations in project skills.json/plugins.json > user-global ~/.gemini/config/ > built-in defaults.
Six Extension Mechanisms (Don’t Configure Them All at Once)
| Mechanism | Location / Filename | When It Loads | Practical Use Case |
|---|---|---|---|
| Rules | AGENTS.md / GEMINI.md |
Auto-discovered; 24 KB per-file cap, shared 20,000 tokens budget (falls back to on-demand path pointers if exceeded) |
Repo structure notes, code style, communication language, and non-negotiable guardrails |
| Skills | .agents/skills/<name>/SKILL.md |
On-demand (only name and a one-line description stay in context; full body and scripts/ load when matched) |
Reusable SOPs such as release checklists, test authoring, and PR submission |
| Hooks | .agents/hooks.json |
Enforced by code at 6 lifecycle points (SessionStart / PreToolUse / PostToolUse / PreInvocation / PostInvocation / Stop) |
Blocking dangerous commands, running linters after edits, rewriting tool arguments (overwrite) |
| MCP | mcp_config.json |
Connects at session startup; supports local Stdio and remote Streamable HTTP | Connecting databases, Jira, Chrome DevTools, and internal APIs |
| Plugins | .agents/plugins/<name>/plugin.json |
Loaded as a single bundle when enabled | Packaging the four mechanisms above for cross-repo or team distribution |
| Multi-Agent | Subagents / /swarm / run_workflow |
Triggered manually or automatically for research or multi-module tasks | Isolating context and editing modules in parallel with inherit/branch/share workspaces |
When you are unsure where a new rule or capability belongs, follow this decision flow:
flowchart LR
Q0["Add a rule or capability"] --> Q1{"Must be 100% code-enforced<br/>rather than model-adhered?"}
Q1 -- "Yes" --> A_HOOK["Hooks<br/>(hooks.json)"]
Q1 -- "No" --> Q2{"Apply to every session?"}
Q2 -- "Yes" --> A_RULE["Rules<br/>(AGENTS.md / GEMINI.md)"]
Q2 -- "No" --> Q3{"Task-specific SOP?"}
Q3 -- "Yes" --> A_SKILL["Skills<br/>(SKILL.md)"]
Q3 -- "No" --> Q4{"Connect external tools/services?"}
Q4 -- "Yes" --> A_MCP["MCP Servers<br/>(mcp_config.json)"]
Q4 -- "No" --> Q5{"Need isolated context or parallelism?"}
Q5 -- "Yes" --> A_MULTI["Subagents / Swarm<br/>/ run_workflow"]
Q5 -- "No" --> A_BASE["Direct chat + /plan"]
A_HOOK -. "Share with team" .-> A_PLUGIN["Package as Plugin<br/>+ skills.json / plugins.json"]
A_RULE -. "Share with team" .-> A_PLUGIN
A_SKILL -. "Share with team" .-> A_PLUGIN
A_MCP -. "Share with team" .-> A_PLUGIN
Day-one trade-off: During your first week, stick to Rules—a concise AGENTS.md is plenty. Extract a workflow into a Skill only after you have repeated it three or more times. Reach for Hooks only when the model keeps forgetting a rule or when you need hard enforcement against destructive actions like dropping tables or force-pushing. Skip Plugins and Multi-Agent setups until you actually need them.
4. Sandbox & Permissions: Safety Without Approval Fatigue
Letting an agent run shell commands creates an obvious tension:
- Grant unrestricted access, and you risk an accidental
rm -rfor edits to host configs outside the repo. - Prompt for every command, and hitting Enter for every
lsandgit statusquickly makes the tool unbearable.
Antigravity solves this in three layers: commands first pass through any configured PreToolUse Hook, then through the permissions rule engine (strict precedence: Deny > Ask > Allow), and finally execute inside an OS-native Terminal Sandbox (Linux Kernel Namespaces, macOS Seatbelt sandbox-exec). Inside the sandbox, writes are restricted to the active workspace and temporary cache, and network access is disabled by default. Safe local commands run automatically without interrupting you; the CLI only prompts when a command needs to leave the sandbox (installing packages over the network, pushing via SSH, or touching files outside the workspace).
Here is the full path of a command from model request to execution:
sequenceDiagram
participant M as Gemini Agent
participant H as PreToolUse Hook
participant P as Permission Engine<br/>(Deny > Ask > Allow)
participant S as Terminal Sandbox<br/>(Namespace / Seatbelt)
participant U as User
M->>H: Request run_command
alt Hook returns deny
H-->>M: Block immediately with reason
else Hook allows or rewrites args (overwrite)
H->>P: Evaluate command, path & network policy
alt Matches Deny
P-->>M: Reject execution
else Matches Allow or safe inside sandbox
P->>S: Execute inside isolated sandbox
S-->>M: Return stdout/stderr & exit code
else Matches Ask or requires unsandboxed access
P->>U: Prompt approval (supports prefix Always Allow)
U-->>P: Approve / Deny
P-->>M: Execute or return denial
end
end
Four preset modes are available: Default (recommended: auto-run inside sandbox, ask outside), Auto (auto-allow common reversible commands outside the sandbox as well), Request Review (sandbox disabled, confirm every command), and Turbo (allow everything). Keeping Default globally and overriding only for trusted repos strikes the best balance.
5. Hands-On with agy CLI: Commands You Will Actually Use
Below is the verified output of agy --version and agy --help from agy v1.5.18 on Linux:

The flag list looks long, but daily usage boils down to these four groups:
1. Daily Launch & Resuming Sessions
1 | # Start in the project root |
2. Scripting & CI Integration (Non-Interactive Mode)
1 | # Run once and print the result directly without entering the TUI |
3. High-Leverage TUI Shortcuts & Slash Commands
@: Autocomplete file paths, directories, past conversations, rules, or MCP tools. Writing@src/router.tsuses fewer tokens and is far more reliable than copy-pasting code.!: Prefix a line with!to run a local shell command inline (such as!git status) without leaving the TUI./plan: Generate an implementation plan artifact first and wait for your approval before editing files./diff: Inspect the current diff directly in the terminal./compact: Manually compress conversation history once a session grows long./rewind//fork: Roll back a misguided turn, or branch a new session from the current point to test an alternative approach.
4. Extension Management Subcommands
1 | agy mcp list # List connected MCP servers |
6. Coming from Claude Code? Here Is the Comparison Table
If you have used Claude Code before, almost every concept maps cleanly onto Antigravity:
| Concept | Claude Code | Antigravity (AGY) | Key Practical Difference |
|---|---|---|---|
| Project rules | CLAUDE.md |
AGENTS.md / GEMINI.md |
AGY walks upward from cwd to the Git root and enforces a dedicated 20k-token rule budget |
| Project customization dir | .claude/ |
.agents/ (also supports .agent/) |
Houses Rules, Skills, Hooks, and Plugins together |
| Global config | ~/.claude/ |
~/.gemini/config/ (extensions)~/.gemini/antigravity-cli/ (CLI) |
The extensions directory is shared across CLI, 2.0 desktop, and IDE |
| Skills | .claude/skills/*/SKILL.md |
.agents/skills/*/SKILL.md |
Nearly identical authoring format with progressive on-demand loading |
| Hooks | Configured in .claude/settings.json |
.agents/hooks.json |
AGY adds PreInvocation / PostInvocation events and argument overwrite |
| MCP config | .mcp.json / settings.json |
~/.gemini/config/mcp_config.json or inside plugins |
Supports Stdio and Streamable HTTP (drops legacy standalone SSE) |
| Plugin compatibility | .claude-plugin/plugin.json |
plugins/<name>/plugin.json |
agy plugin import (local migration) and install (marketplace/repo install) can import Claude Code extensions directly |
| Multi-Agent | Subagents / Teams | Subagents + /swarm + run_workflow |
Native inherit/branch/share workspace isolation and Python workflow scripts |
Two quick pitfalls to watch out for when migrating:
- All AGY Hook input and output JSON keys use camelCase (e.g.,
conversationId,transcriptPath,toolCall)—do not read them assnake_case. - In native Antigravity plugins,
hooks.jsonmust live directly at the plugin root (<plugin>/hooks.json); placing it under ahooks/subdirectory means the runtime will not discover it.

















