Why Google Antigravity eats weekly quota fast and what I measured A reverse-engineering analysis of Google Antigravity's local binaries found that the agent client relies on Gemini 4 implicit prompt caching with a roughly 5-minute eviction window, so pauses longer than that force full-price re-ingestion of the entire conversation prefix. The author disassembled the 193 MB Go `language_server` binary in Antigravity v2.33.0 and the `agy` CLI v1.5.11/1.5.12, identified telemetry buckets `lt_5m` and `ge_5m`, and located a dormant `modelapiccpa/keepalive.go` engine that sends a trimmed one-token keep-alive ping tagged `prompt_cache_keep_alive` to hold the cache warm without polluting conversation history. Cached tokens receive a 90% discount versus uncached input tokens, and the author narrowed the eviction cliff to a 15-second window and unlocked the built-in keep-alive engine on a live 6-minute run. Why Antigravity Eats Weekly Quota Fast - and What I Measured Publish date: Nov 19, 2026 Last updated: Nov 19, 2026 Gemini 4 Hydrogen, Gemini 4 Argon, and hy4-flash via OpenCode used for the binary reverse engineering, empirical cache probing, and keep-alive tooling. Introduction Greetings If you use Google Antigravity agy with the big frontier models, you have probably noticed how fast your weekly quota disappears during normal coding sessions 1, 4 . My suspicion was simple: a short prompt-cache lifetime . When you are coding with an agent, you don’t send messages every 10 seconds. You wait for a response, read the diff, run a test, think for 5 minutes, and then send your next prompt. If the prompt cache expires during that 5-minute pause, your next message has to re-ingest the entire conversation history at full price. Instead of just assuming that was true, I decided to actually test it and look inside the Antigravity binaries to see how caching works under the hood. What started as a quick TTL check turned into disassembling a 193 MB Go binary, discovering a dormant keep-alive engine that Google already wrote, binary-searching the exact eviction cliff down to a 15-second window, testing whether /btw side-questions can keep the cache warm, and finally unlocking Google’s built-in zero-trajectory keep-alive engine on a live 6-minute run. 1. Background: Implicit Caching & The Idle Tax To understand why pauses matter, let’s look at how Gemini models handle context in Antigravity. Every turn in an agentic coding session carries a massive prefix: the system prompt, tool schemas, connected MCP servers, skill definitions, and all previous turns. On Gemini 4 models, Antigravity relies exclusively on implicit caching 2, 3 . Unlike explicit caching where you manually place cache breakpoints and pay for a guaranteed storage lease , implicit caching is an automatic, best-effort prefix match on Google’s backend. When your request hits the implicit cache, cached tokens cache read tokens get a 90% discount compared to regular uncached input tokens 2 . When the cache misses, you pay 100% on the entire prefix. Google does not publish a fixed TTL for implicit caching. If that TTL is shorter than a typical code-review pause, interactive coding turns into a worst-case workload. 2. What the Binary Says Before running live probes, I inspected the local Antigravity installation on macOS arm64 : the desktop app /Applications/Antigravity.app , v2.33.0 , its core Go agent binary language server , and the standalone CLI ~/.gemini/bin/agy , v1.5.11 / 1.5.12 across isolated CLI runs. 2.1 Telemetry Buckets Give Away the 5-Minute Cliff Inspecting the Go symbol table in language server immediately confirmed that Antigravity tracks cumulative context through CumulativePromptHandler and buckets turn gaps into two telemetry categories: lt 5m less than 5 minutes and ge 5m 5 minutes or more . That alone was a strong clue that 5 minutes is the magic number. 2.2 Google Already Built a Keep-Alive Engine Digging deeper, I found a file path in the binary’s symbol table: modelapiccpa/keepalive.go . Disassembling its functions keepAlivePings , beforeRequest , scheduleNextPingLocked , ping , and trimLastBlock revealed that Google already built an automatic background prompt-cache keep-alive mechanism. Here is how their internal keep-alive works: 1. Zero-Trajectory Pollution : When a turn finishes onRequestDone , the client schedules a background timer. When the timer fires, it clones the last request protobuf, calls trimLastBlock to replace the final prompt block with a single period "." , sets max output tokens = 1 , tags the request with "prompt cache keep alive": "true" , and sends it in the background. When the 1-token response comes back, it throws it away so it never pollutes your conversation history . 2. Exact Hardcoded Timers : - Ping interval : Hardcoded in scheduleNextPingLocked to 4 min 30 s 270s . - Staleness cutoff : Hardcoded in ping to 4 min 45 s 285s . If the timer wakes up more than 4m 45s after the last turn e.g., after laptop sleep , it aborts the ping because it knows the server cache is already dead. Why do we still lose the cache every 5 minutes? Two gates in the binary stop it from running: - Gate A keepAlivePings : Locked behind server-side Mendel experiment flags enable-prompt-cache-keep-alive and prompt cache keep alive max pings that aren’t exposed in settings.json or Antigravity hooks. - Gate B beforeRequest : Checks the internal model provider enum 0x5 or 0xa and currently restricts background pings to explicit-cache provider enums like Claude , completely skipping Gemini models. 3. Experimental Setup: Measuring Cache Hits Since account-level quota percentages are noisy other background agents share the same quota pool , I used cache read tokens from agy --input-format stream-json --output-format stream-json as the primary ground-truth signal. At the end of every turn, agy emits a DONE event for agent response with three numbers: - input tokens T uncached : Tokens billed at full price. - cache read tokens T cached : Prefix tokens served from the implicit cache. - output tokens : Generated response tokens. | Observed Signal | What It Means | |---|---| | Large cache read tokens ~14,770 , small input tokens ~2,150 | Cache Hit - prefix served from cache, only tail billed at full price. | | cache read tokens = 0 , large input tokens ~16,820+ | Cache Miss - full prefix re-ingested from scratch. | For the baseline TTL tests, I used gemini-4-hydrogen-low with --effort low and the prompt "Reply with only OK." so output tokens stayed tiny 5 to 25 tokens . To run multi-turn conversations inside a single long-lived process matching how the desktop app’s language server runs , I fed NDJSON user events into agy through a persistent FIFO pipe. 4. What I Measured 4.1 Separate CLI Processes Don’t Share the Cache First, I tried running two separate one-shot agy -p --conversation