Looking at your screenshot, the notification states:
“The server cleared a prefix of the conversation as it grew too large.”
First, immediate reassurance: your code, your previous versions, and your history have NOT been deleted.
Here is the exact technical breakdown of what “clearing a prefix” means, how to undo to a previous point right now, and how to recover your stranded code.
1. What “Cleared a Prefix” Actually Means
In LLM runtime architecture, a prefix refers to the earliest turns at the beginning of the conversation.
When a session becomes very long, the cumulative token count reaches the model context window ceiling. To prevent the session from crashing or completely failing to respond, the backend automatically truncates the oldest turns (the prefix) from the active memory buffer so that the model can process your latest prompt.
The server did not delete your session or wipe your disk. It only slid the active prompt window forward.
2. How to Undo to a Previous Point Right Now (Two Methods)
You mentioned: “What if you had a large update that contained hundreds of errors… You won’t even be able to undo to a previous point.”
You actually have two immediate ways to roll back:
Method 1: The Native IDE Timeline (Easiest & Fastest)
Because Antigravity is built on the VS Code engine, it has built-in Local File History independent of Git or the AI chat:
- Open the file that contains the broken updates in the Antigravity editor.
- In the left-hand Explorer sidebar, expand the Timeline section at the very bottom.
- You will see a chronological list of every local save from today and yesterday.
- Click on any timestamp prior to the update to view a side-by-side diff, or right-click it and select “Restore Contents” to instantly revert the file.
Method 2: The Local Transcript Ledger (transcript.jsonl)
Antigravity permanently logs every single step and code change to your local drive before sending it to the model.
-
Windows:
Open File Explorer to:
explorer.exe "$env:USERPROFILE\.gemini\antigravity\brain"
-
macOS / Linux:
open ~/.gemini/antigravity/brain
Sort the folders by Date modified, open the newest folder, and go to .system_generated\logs\transcript.jsonl.
Open transcript.jsonl in any text editor. Every file modification is logged under tool calls:
- Search for
"replace_file_content": You will find TargetContent (the exact code before the change) and ReplacementContent (the code after).
- Search for
"write_to_file": You will find the full file contents written at each step.
3. Best Practice: Preventing Context Saturation
To prevent the server from truncating the conversation prefix in future sessions:
- Avoid Marathon Single-Chat Sessions: Aim to keep conversational threads under 30 to 50 turns.
- Perform a Clean Baton Pass:
-
When concluding a milestone or before leaving work, ask:
“Please write a concise summary of what we completed, the current state of the files, and the next 3 pending steps.”
-
Save that summary into a markdown note (e.g. ROADMAP.md).
- Resume in a Fresh Chat:
- Open a new conversation, paste the summary as Turn 1, and proceed.
- You start with 100% fresh context capacity, zero latency, and zero risk of prefix clearing.
Check your file Timeline panel in the editor or the .gemini/antigravity/brain/ folder, and you will be able to restore your previous code state immediately.