Skip to content

Google Antigravity

Token Optimizer supports Google Antigravity — the agy CLI, the Antigravity 2.0 desktop app, and the Antigravity IDE — through one adapter that decodes Antigravity’s per-conversation SQLite store and wires a user-level plugin.

The three surfaces share one hooks.json and one adapter payload, but they are separate session populations — never merged, never summed — because each keeps its own conversation store.

SurfaceStorageCost source
agy CLI~/.gemini/antigravity-cli/conversations/*.dbcredit_cost / consumed_credits or Gemini list-price estimate
Antigravity 2.0 app~/.gemini/antigravity/conversations/*.dbsame
Antigravity IDE~/.gemini/antigravity-ide/conversations/*.dbsame

Install from the Antigravity page. The cross-platform grid is at /reference/capability-matrix/.

Cost: credits when present, list-price otherwise

Section titled “Cost: credits when present, list-price otherwise”

Antigravity is subscription/credit-metered. When the decoded gen_metadata rows carry a non-zero credit_cost or consumed_credits, that figure is shown as the platform’s own cost. Otherwise the adapter prices the session at the Gemini rate card and labels it a list-price estimate. A model with no known rate card is shown as “cost unavailable” rather than priced against a made-up number.

Capability map by hook surface, not version

Section titled “Capability map by hook surface, not version”

Antigravity’s hook contract is synchronous and command-only. The adapter does not version-gate individual features the way the Copilot adapter does; instead each surface is green, partial, or red based on what Antigravity’s hook events structurally allow.

Hook powerStatusToken Optimizer feature
PreInvocation injectStepsWorksContinuity restore (invocation 1) + context nudges
PreToolUse overwrite on run_commandWorksBash output compression (R13a wrapper re-validates argv)
StopWorksDetached, lease-debounced rollup + dashboard regeneration
PreCompactNot exposedCompaction steering — unavailable
PostToolUse output rewriteNot exposedRead-interception (Delta/Structure Map) — unavailable
status lineNot exposedStatus line quality bar — unavailable

Every hook handler is fail-open: it exits 0 and emits valid JSON or nothing on any error, malformed stdin, oversize stdin, or a missing dependency. Data collection is consent-gated (R20); the bridge and rollup no-op until ~/.gemini/token-optimizer/config.json records antigravity_consent: true.

GapReason
Compaction steeringNo PreCompact hook event
Read-interception (Delta / Structure Map)No PostToolUse output rewrite
Status lineAntigravity owns its status-line data model
Keep-Warm automationNo cache-TTL ping surface

A killed conversation still has its gen_metadata rows on disk, so there is no in-flight tally to lose. The rollup flags a killed / not_fully_idle conversation as incomplete and upgrades it in place when clean totals arrive. Partial data is never silently dropped and never silently presented as exact.

Every Antigravity command needs the runtime prefix.

Terminal window
cd ~/.claude/skills/token-optimizer/scripts
TOKEN_OPTIMIZER_RUNTIME=antigravity python3 measure.py antigravity-summary

On Windows use python, not python3.

Terminal window
cd ~/.claude/skills/token-optimizer/scripts
TOKEN_OPTIMIZER_RUNTIME=antigravity python3 measure.py antigravity-doctor

antigravity-doctor checks the agy binary, the Antigravity home, the three surface directories, the plugin payload and hooks, the consent record, the conversation store, and dashboard port availability.

The Antigravity daemon port is 24847 and its label ends antigravity-dashboard. See the configuration reference.