Antigravity CLI Setup
Give Antigravity CLI persistent memory across sessions.Antigravity CLI (
agy) is Google’s standalone successor to Gemini CLI — it reuses Gemini CLI’s ~/.gemini/ config tree and, per Google, “keeps the most critical features of Gemini CLI: Agent Skills, Hooks, Subagents, and Extensions.” Claude-mem changes what happens across sessions by capturing observations, decisions, and patterns — then injecting relevant context into each new session.
How it works: Claude-mem installs lifecycle hooks into Antigravity CLI’s shared
~/.gemini/settings.json that capture tool usage, agent responses, and session events. A local worker service extracts semantic observations and injects relevant history at session start — via GEMINI.md, an MCP server, and a rules file.Antigravity CLI is a different product from the Antigravity desktop IDE (
antigravity binary) — both share the same ~/.gemini/antigravity namespace, but the CLI’s own binary is agy. Detection checks for agy in your PATH (or an existing ~/.gemini/antigravity directory).Prerequisites
- Antigravity CLI (
agy) installed —curl -fsSL https://antigravity.google/cli/install.sh | bash - Node.js 18+
- The
~/.geminidirectory must exist (created by Antigravity CLI / Gemini CLI on first run)
Installation
Step 1: Install claude-mem
- Auto-detect Antigravity CLI (checks for
agyinPATH, or an existing~/.gemini/antigravitydirectory) - Install 8 lifecycle hooks into
~/.gemini/settings.json - Inject context configuration into
~/.gemini/GEMINI.md - Register claude-mem’s MCP server in
~/.gemini/antigravity/mcp_config.jsonand~/.gemini/config/mcp_config.json - Write a rules/context placeholder to
~/.agents/rules/claude-mem-context.md - Start the worker service
Step 2: Configure an AI provider
Claude-mem needs an AI provider to extract observations from your sessions. Choose one:- Gemini API (Free)
- Claude SDK
- OpenRouter
The simplest option — use Gemini’s own API for observation extraction:
- Get a free API key from Google AI Studio
- Add it to your settings:
Step 3: Verify installation
Step 4: Start using Antigravity CLI
Launch Antigravity CLI normally. Claude-mem works in the background:What gets captured
Claude-mem registers all 8 confirmed Antigravity CLI lifecycle hooks (verified against a live install):| Hook | Internal event | Purpose |
|---|---|---|
| SessionStart | context | Injects memory context into the session |
| BeforeAgent | session-init | Captures user prompts |
| AfterAgent | observation | Records full agent responses |
| BeforeTool | observation | Logs tool invocations before execution |
| AfterTool | observation | Captures tool results after execution |
| Notification | observation | Records system events (permissions, etc.) |
| PreCompress | summarize | Captures session summary before compression |
| SessionEnd | session-complete | Marks session complete |
~/.gemini/settings.json (not assumed from Gemini CLI’s schema alone).
MCP registration
Antigravity CLI has native MCP support, but which config path it reads was genuinely ambiguous at the time of writing — two real candidate paths exist on disk with no definitive documentation resolving which oneagy loads. Claude-mem writes to both, safely and idempotently:
~/.gemini/antigravity/mcp_config.json~/.gemini/config/mcp_config.json
search, smart_search, timeline, etc.) a chance to register correctly regardless of which path Antigravity CLI actually reads.
Future enhancement (not implemented in this release)
Antigravity CLI ships a first-class plugin-marketplace subcommand system:agy plugin {list,import,install,uninstall,enable,disable,validate,link}. Notably, agy plugin import gemini|claude suggests native cross-tool plugin migration — structurally similar to Codex CLI’s .codex-plugin/plugin.json marketplace mechanism. This could eventually be a cleaner, more idiomatic way to bundle claude-mem’s hooks + MCP + skills registration than hand-editing settings.json. It isn’t implemented here because its manifest schema isn’t discoverable without running agy plugin import/install against a real manifest, which would mutate a user’s live local plugin state. Tracked as a candidate follow-up.
Troubleshooting
Hooks not firing
-
Verify hooks exist in settings:
You should see entries like
"SessionStart","AfterTool", etc. with claude-mem commands. - Restart Antigravity CLI after installation.
-
Re-run the installer:
Worker not running
No context appearing at session start
- Ensure the worker is running (check http://localhost:37777)
- You need at least one previous session with observations for context to appear
- Check your AI provider is configured in
~/.claude-mem/settings.json
Raw escape codes in output
If you see characters like[31m or [0m in the session context, your claude-mem version may need updating — the Antigravity CLI adapter strips ANSI color codes automatically:
Uninstalling
~/.gemini/settings.json, cleans up the context section in ~/.gemini/GEMINI.md, removes claude-mem’s entry from both MCP config files, and removes the rules context section — while preserving everything else in those files.
Next Steps
- Gemini Provider — Configure the Gemini AI provider for observation extraction
- Configuration — All settings options
- Search Tools — Search your memory from within sessions
- Troubleshooting — Common issues and solutions

