As the title says, I hope antigravity team remove the automatic compact, its ruining the important context in the session especially during edits/implementation when the compact happens, you will get a poor results by it and antigravity literally have no any idea what just happened and will completely ignore the recent decisions and shared understanding, like for real though every harnesses out there had /compact <summary> available I don’t see any special about built-in compact of antigravity at all besides just to ruin the session context.
When the harness injects an automatic <CONTEXT_SUMMARY>, the model frequently breaks subsequent code edits, hallucinates outdated signatures, or repeats mistakes you solved thirty turns earlier.
Here is the exact systems diagnosis of why this happens, the architectural feature request the Antigravity team needs to see, and the practical operational pattern we use today to eliminate compaction amnesia entirely.
1. The Systems Diagnosis: Why Automatic Compaction Breaks Active Code Edits
Under the hood, automatic inline compaction fails during active development for three fundamental reasons:
-
Negative Constraint Evaporation:
LLM summarisation models are inherently biased towards positive narrative continuity (e.g. “the developer asked to build X, we called tool Y”). They systematically omit negative constraints (e.g. “never wrap execution in cmd /c”, “do not modify table schema Z”, “maintain backwards compatibility with API v1”). The moment those negative constraints are compressed away, the agent reverts to its baseline training habits. -
Loss of AST & Exact Diff Boundaries:
A summary captures high-level intent, not line-level AST nodes or precise indentation boundaries. When the agent attempts its next file replacement, it no longer has the raw file buffer in active memory. It starts guessing line ranges, leading to broken edits or partial file clobbering. -
False Confidence & Context Drift:
Because the model sees a<CONTEXT_SUMMARY>block, it assumes it has complete situational awareness. In reality, it is operating on a low-resolution caricature of your earlier decisions.
2. The Upstream Feature Request for the Google Antigravity Team
To turn this into an actionable engineering proposal for the platform maintainers, we need two concrete controls:
-
Configurable Compaction Mode in
settings.json:"antigravity.compaction.mode": "manual" // options: "auto", "manual", "warn"Give developers the choice to disable automatic background compaction completely.
-
User-Directed
/compact [focus-instructions]Command:
Follow the proven paradigm used in other developer harnesses (like Claude Code or Aider). Compaction should be user-triggered, allowing the developer to dictate what must survive:/compact Preserve active database contracts, API route schemas, and negative constraints. -
Early Warning Context Meter in the Status Bar:
Display an unobtrusive token/context utilisation percentage in the IDE status bar so developers know before initiating a complex multi-file edit whether the active window is nearing capacity.
3. How to Prevent Compaction Amnesia Today (The “Baton Pass” Workflow)
Until the Antigravity team exposes manual compaction toggles, relying on in-flight auto-compaction is an anti-pattern. Here is the operational workflow we use across enterprise sessions to maintain zero context degradation:
Session A (Turns 1 - 45)
|
+-► Approaching token ceiling
|
▼
[Trigger Baton Pass] --► Agent writes "ACTIVE_CONTEXT.md"
* Solved architectural decisions
* Strict negative constraints
* Active file contracts & open steps
|
▼
Session B (Fresh Chat)
|
+-► Ingest "ACTIVE_CONTEXT.md" --► 0 Token Debt, 100% Rules Intact
-
The 45-Turn Boundary: Never let a complex coding session run blind into the ~250k token cliff. Monitor your turn count and tool volume.
-
Deterministic State Snapshot: Around Turn 45-50, instruct the agent:
“Author an architectural handoff document in markdown summarising: (1) Active file schemas, (2) Solved issues and test results, (3) Pending steps, and (4) Strict negative constraints.”
-
Rehydrate in a Clean Session: Open a fresh chat, point the agent to the handoff document, and proceed.
By moving session state into an explicit markdown artefact rather than trusting stochastic inline compaction, you get 0 tokens of conversational debt, 100% constraint retention, and zero amnesia.
ITs a good workaround but i think that’s NOT the best idea, giving all preserved CONTEXT into a markdown, actually compact solves this, we just need the /compact command NOT a workaround or another markdown file on the repo that’s all