Antigravity in Cerebro: integration plan

Google Antigravity as an extra agent account in Cerebro

Research as of 2026-11-30 · Google AI Pro (pedro.reyes.solutions@) paid until 2027-01-12 · CLI not installed yet
TL;DR. Antigravity has a real CLI (agy) with headless mode (-p --output-format stream-json) and conversation resume (--conversation <id>), so it fits Cerebro's runner the same way claude -p does. Context transfer is already solved: Cerebro's chat migration has a replay path (buildReplayPrompt) that rebuilds the conversation from Firestore. It works for any provider, in both directions. On Pro it also runs Claude Opus/Sonnet 5.5, which are billed to Google's quota. The real work is in generalising "Claude accounts" into "agent accounts".

1. What agy offers (official docs)

TopicFact
InstallmacOS/Linux: curl -fsSL https://antigravity.google/cli/install.sh | bash → ~/.local/bin/agy. Windows: irm https://antigravity.google/cli/install.ps1 | iex
Headless-p, --output-format text|json|stream-json, --input-format stream-json, --json-schema, --print-timeout
Stream eventsinit (conversation_id, tools, permission_mode) → many step_update (text_delta, step_type user_input/agent_response/tool, tool_info, usage) → result (status SUCCESS/ERROR/…, response, usage tokens)
Resume--conversation <id>, -c. History is scoped to the cwd. Transcript: ~/.gemini/antigravity-cli/brain/<id>/…/transcript.jsonl (format not documented)
AuthGoogle OAuth in the browser on first run. Token stored in the OS keychain. Logout only via /logout in the TUI. No whoami/status. No CLAUDE_CONFIG_DIR equivalent, so one Google account per OS user
Permissions--mode accept-edits|auto|plan, --dangerously-skip-permissions, --sandbox. Allow/ask/deny rules only in settings.json (no --disallowedTools)
Models--model, --effort, agy models. Gemini 4 family, Gemini 3.x Flash, Claude Opus 5.5 / Sonnet 5.5
InstructionsReads AGENTS.md/GEMINI.md + .agents/rules/*.md (24 KB/file, 20k-token always-on budget). Our AGENTS.md is 15 KB, so it fits
SkillsReads <workspace>/.agents/skills/*/SKILL.md, which our repo already has. Does not read .claude/skills
MCP~/.gemini/config/mcp_config.json or .agents/mcp_config.json (mcpServers, stdio or Streamable HTTP; no SSE)
Hooks.agents/hooks.json: SessionStart, PreToolUse, PostToolUse, Pre/PostInvocation, Stop
QuotaPro: a 5-hour window plus a weekly cap per model group, and overage on AI credits (useG1Credits). /usage is text only; there's no JSON quota command
System promptNo --append-system-prompt, so Cerebro's chat instructions have to go into the prompt or a rule file

2. Cerebro today vs. what changes

PieceToday (Claude)For Antigravity
AccountsCLAUDE_ACCOUNT_IDS fixed to account-1..5, each a ~/.claude-account-NAdd a provider field to the account. A new card Antigravity · pedro.reyes.solutions@ in Agents › Cuentas (desktop + mobile)
Chat turnmain/chats.ts spawns claude -p --output-format stream-json --resumeA second runner, agy -p --output-format stream-json --conversation, plus a parser from step_update to Cerebro's message stream and activity chips
Cerebro UI rules (questions, artifacts, handoff…)--append-system-prompt-filePrepend them as a <cerebro> block to the first turn's prompt, then a short reminder on later turns
Context transfertranscript-copy (same CLI) or replayReplay only, in both directions. Transcript copy is impossible because the formats differ. Raise CHAT_REPLAY_MAX_CHARS for Gemini's long context
Limit detectionParses "You've hit your … limit" and the usage APIMap result.status=ERROR + quota text to a limit card, then migrate. Usage: parse agy -p /usage text (unverified) or count tokens
Blocked tools--disallowedToolsA generated permissions.deny in agy's settings.json (e.g. mcp(chrome-devtools/*))
MCP.mcp.json (codegraph, chrome-devtools, cerebro-browser)Generate .agents/mcp_config.json from .mcp.json (cerebro-browser only)
Instructions / rulesCLAUDE.md + 6 path-scoped .claude/rulesAGENTS.md is already loaded. Mirror .claude/rules into .agents/rules with trigger: glob, plus a sync check
Hooks (impact-hint…).claude/settings.jsonOptional: .agents/hooks.json calling the same scripts
AttachmentsSaved to disk; Claude reads themSame: pass the paths in the prompt (headless image input isn't documented)
Scheduled agentsRUNNERS registry: claude | openai-compatibleAdd an antigravity runner. This is the cheapest first milestone
Slash menuLists Claude's commandsHide it for agy chats, or list skills only

3. More points to work out

  1. Subscription ends 2027-01-12. That's six weeks away. Build it provider-generic: the free tier also includes the CLI (with a weekly quota), so the integration keeps working at lower volume if you don't renew.
  2. Terms of service. Clause 6 forbids "third party software… to access the Service" (the example given is OpenClaw using Antigravity OAuth). Calling the official agy in its documented headless mode looks fine. Never reuse its OAuth tokens directly.
  3. Privacy. Clause 5 says interactions are used to improve Google products unless you turn that off. Turn it off before sending repo code.
  4. Data left on Google's side. The agy CLI never sees secrets in the repo, but its tool calls can still cat files. Use the same deny rules for .env and ~/.secrets as for Claude.
  5. One Google account per OS user. There's no config-dir switch, so a second Google account would need HOME isolation (untested). Not needed now.
  6. Both machines. The token lives in each machine's keychain, so you install and log in once on the Mac and once on Windows. Ejecutar en should skip machines without an agy login.
  7. Model per chat. Default to Gemini 4 or Claude Opus 5.5 via Antigravity. The model picker needs agy's list (agy models).
  8. Unverified 4× quota claim. A blog says using --agent costs 4× quota on Pro. Avoid --agent; put instructions in the prompt or rules.
  9. Session key / commits. Same repo rules. The Co-Authored-By trailer changes per model (Gemini vs Claude via Antigravity).
  10. Auto-migration ordering. Decide where Antigravity sits in the fallback queue: last resort, or first for cheap work.
  11. Mobile parity. The provider badge, account card and migrate dialog live in apps/cerebro-mobile too, and the shared/chats.ts copy must stay byte-identical.
  12. Tests. Unit tests for the stream-json parser, the replay prompt, limit detection and account order. Recorded agy fixtures go under scripts/chats.
  13. Cost visibility. Store usage tokens per turn so Agents › Cuentas can show an estimated weekly use.

4. Phased plan

Phase 0: setup (≈30 min, manual)

Install agy on Mac (and Windows), log in with pedro.reyes.solutions@, turn off "improve products", run agy models and agy -p /usage, and capture a stream-json sample as a test fixture.

Phase 1: scheduled agents runner (small)

Add antigravity to AGENT_PROVIDERS and RUNNERS, with model + mode. This proves auth, headless runs and parsing with little risk.

Phase 2: chats on Antigravity (medium-large)

Add provider to accounts, the agy chat runner + stream parser, Cerebro rules in the prompt, .agents/mcp_config.json + deny rules, "Migrate to Antigravity" through replay, limit card, and the desktop + mobile UI.

Phase 3: polish

Usage windows on the card, a place in auto-migration, .agents/rules mirroring and hooks, per-model trailers.

Sources