[Feature Request / RFC] Beyond Passive Counters: Tackling “Context Rot” via Real-Time Telemetry & Native “Summarize & Branch” Session Forking
Acknowledging Great Community Discussions
First, a big shoutout to earlier community members who raised the critical issue of token visibility—especially @mdaniiauskas 's excellent proposal on granular metrics and quota transparency (Topic #116597), and @Rene_Augusto_Negrao 's thoughtful posts on progressive visual indicators and accessible multi-sensory alerts (Topic #111192 and Topic #111809).
They brilliantly highlighted an inescapable truth: Developers cannot optimize or budget what they cannot see in real time.
Building directly upon these insightful foundations, this proposal aims to explore the next natural frontier of the conversation:
What happens when the token count does climb high? How does accumulated context impact agentic reasoning quality? And crucially, how can Antigravity provide developers with an effortless, one-click exit strategy to keep working at peak performance?
Executive Summary (TL;DR)
Theoretical 1M–2M context windows are a triumph of modern AI research. However, in day-to-day production coding, Context Hygiene is King. Multi-step reasoning benchmarks (Lost in the Middle, Chroma’s MECW, RULER) demonstrate that autonomous agent accuracy decays sharply once prompt context passes 60,000–80,000 tokens (“Context Rot”).
We propose a two-part architectural solution:
- Live Context Telemetry Badge: Real-time visibility into active prompt tokens, steps, and attention health directly in the UI.
- Native “Summarize & Branch” (Session Forking): A one-click handoff mechanism that autonomously compresses a bloated 120k-token session into a 2k-token executive synthesis and launches a fresh, lightning-fast session with zero state loss.
The Problem: “Context Rot” & Silent Token Bloat in Long Sessions
In real-world software engineering, agentic conversations easily extend to 150–250 steps. In our recent strategy and troubleshooting session (79777e7d):
- Step Count: 226 steps
- Transcript on Disk: 408.13 KB
- Active Prompt Footprint: ~119,400 tokens!
The Compounding Domino Effect:
- Inference Latency: Time To First Token (TTFT) slows down noticeably because the model re-evaluates 120k tokens before emitting a single word.
- Compute & Quota Burn: Even replying “Yes, proceed” consumes ~120k input tokens on every subsequent turn.
- Attention Dilution & Error Loops: Models begin treating past failed tool attempts or voluminous terminal logs as stylistic guides, drifting away from high-priority system instructions located at the top of the prompt.
- Handoff Friction: Developers know they should start a fresh chat, but manually copying architectural context, settled decisions, and modified files is tedious and prone to human error. So developers stay in the bloated chat despite degrading quality.
Feature 1: Real-Time Context Telemetry Badge
Antigravity should give users ambient awareness of their conversation’s physical footprint:
[ 🟢 34.2k tokens | Step 28 | Optimal ]
[ 🟡 68.5k tokens | Step 84 | Attention Dilution Warning ]
[ 🔴 119.4k tokens | Step 226 | Context Rot Alert — Branching Recommended ]
| Token Range | Step Range | Level | Visual & Text Indicator | Recommended Action |
|---|---|---|---|---|
< 50,000 |
< 75 |
Optimal | Normal agentic operation. Full reasoning accuracy. | |
50,000 - 80,000 |
75 - 120 |
Caution | Avoid large log dumps; consider wrapping up task. | |
> 80,000 |
> 120 |
Critical | High hallucination risk. Branch recommended. |
(Note: In alignment with Rene’s accessibility points in #111809, the status level should always include clear textual badges like “Optimal” / “Caution” / “Critical” alongside color coding).
Feature 2: Native “Summarize & Branch” (Session Forking)
Instead of forcing users to manually recap everything, Antigravity should introduce a native [⚡ Summarize & Branch to Clean Chat] action in the toolbar.
The 4-Part Structured Handoff Schema:
When triggered, a lightweight agent call generates:
Session Handoff Summary (Branched from Session )
1. Active Goal & Primary Objective
- Exact feature, bug, or milestone being worked on.
2. Settled Decisions & Architectural Commitments
- Locked-in choices and rejected alternatives (strictly prevents looping or re-debating).
3. Artifact State & Files Modified
- Files created, modified, or deleted in the parent session.
4. Immediate Next Step
- The exact next command, test, or code change to execute right now.
Measurable ROI
- Instant Context Reset: Drops prompt size from 120k+ tokens to ~2,000 tokens (an instant 98.3% token reduction).
- Latency: Sub-second TTFT restored immediately.
- Accuracy: System instructions, safety rules, and architectural guidelines regain 100% attention weight.
- Auditability: Parent session remains archived (
[Branched -> Session XYZ]) for historical auditing.
We believe this is a low-effort, massive-impact DX feature that will solidify Google Antigravity as the most efficient, cost-effective, and reliable agentic coding environment in the industry.
Looking forward to hearing thoughts from the community and the Antigravity engineering team!
