HANDOFF.md file at the root of your repository (under 100 lines) that carries the goal, finished work, open decisions and next steps of the interrupted session.cd <your-project>
git switch -c chore/handoff-$(date +%Y%m%d)
git status --short
git diff --stat
printf '# Handoff\n\n## Goal\n\n## Done\n\n## Next\n\n## Files\n' > HANDOFF.md
git add HANDOFF.md && git commit -m "chore: context handoff"Details and verification are in the steps below.
You are compacting an interrupted working session so a fresh conversation can continue it.
Do not write or modify application code in this turn. Produce one file named HANDOFF.md in the repository root and nothing else.
Use exactly these sections, in this order:
# Handoff
## Goal
One paragraph: what the user is trying to ship, in their own terms.
## Done
A bullet list of changes already applied. For each item give the file path and one line on what changed. Do not paste file contents.
## Decisions
A bullet list of choices made and the reason for each, including rejected options.
## Open questions
Anything unresolved, ambiguous, or blocked, with the exact question that needs an answer.
## Next
A numbered list of the next three actions, each small enough to finish in one turn. Each action names the file or command involved.
## Files
A bullet list of files the next session must read first, in priority order. Mark the one file where the work resumes with the word START.
## Reproduce
The exact shell commands needed to rebuild the current state from a clean checkout, in order, one command per line.
Rules:
- Never invent a file path, command, version number or test result. If you do not know a value, write "check the docs" next to it.
- Do not paste logs or tool output longer than five lines. Give the command that regenerates the output instead.
- Keep the whole file under 100 lines.
- Write in the language the user has been using in this conversation.
After writing the file, reply with the single line: HANDOFF READY.Replace before use: <your-project> — the folder where the repository lives; <task-name> — a short slug for the task, used in branch names.

git init inside it before Step 1.git --version must print a version.What to do: Before touching the model or the conversation, record what the agent already produced. Run these three commands inside the project folder:
cd <your-project>
git status --short
git diff --stat
git log --oneline -5Then copy the agent's last useful message out of the conversation into a scratch note — the plan it proposed, or the list of files it said it would touch.
Why: A conversation that reports it is too long is a conversation whose working state lives only in that window. If you close it first, you will re-attach the same files to a new chat and hit the same wall within a few turns. Capturing the diff first turns "restart" into "continue".
How to check: git status --short prints either nothing or a short list of paths, and git diff --stat prints one line per touched file with an added/removed count, for example:
src/api/client.ts | 42 ++++++++++++++++----
src/api/routes.ts | 18 +++++----
2 files changed, 47 insertions(+), 13 deletions(-)If git status --short lists files you did not expect, commit or stash them now with git stash push -m "pre-handoff" — otherwise the next conversation cannot tell your edits from the agent's.

What to do: Create the handoff file and, at the same time, remove from the working set everything the next session does not need.
1. Ask the current conversation to produce the file using the prompt in “Prompt for copying” above. If the conversation already refuses to answer because of the length error, write the file by hand using the same section list — it takes about five minutes.
2. Edit it down: keep one paragraph under ## Goal, and no more than three numbered actions under ## Next.
3. Close every editor tab and unpin every file that is not in the ## Files list.
4. Remove from the conversation's working set any folder the task does not touch — build output, node_modules, datasets, generated assets. Antigravity is a workspace-scoped agent, so files inside the open workspace can be read and pulled into context even when you did not attach them explicitly.
5. Commit the file so the next session can open it with a single command.
git add HANDOFF.md
git commit -m "chore: context handoff"
wc -l HANDOFF.mdWhy: The length limit is measured against everything the agent has accumulated — your messages, its replies, the file contents it read, and the output of the commands it ran. Tool output is the usual culprit: one npm test run or one large cat can spend more of the window than a hundred chat turns. A handoff file replaces all of that with a few hundred words the agent can act on.
How to check: wc -l HANDOFF.md prints a number below 100, for example:
48 HANDOFF.mdThen open HANDOFF.md and confirm that a colleague who has never seen the task could start from the ## Next list. If a step there reads “fix the bug”, it is too vague — rewrite it as “change the timeout in src/api/client.ts to read from API_TIMEOUT_MS”.
Before you open the new chat, walk this checklist:
git status --short is clean or contains only intentional work-in-progressHANDOFF.md exists, is committed, and is under 100 lines## Files lists the one file where work resumes, marked START## Reproduce contains commands that run from a clean checkout
What to do: Start a new conversation, select Gemini in the model picker of the agent panel, and seed it with the handoff file only.
Read HANDOFF.md. Do not read any other file yet.
Reply with: the goal in one line, the START file path, and the first action from ## Next.Why: A new conversation starts with an empty window, so the length budget is spent only on what you give it. Selecting Gemini matters because the model picker changes which backend answers, and different models in the picker carry different limits — the exact limit for each model is not fixed in the UI and must be checked against the current documentation. What you are doing here is not “a bigger model”, it is a clean window plus a smaller payload.
How to check: The agent's reply names the goal, the START path and one action, and nothing else — if it starts summarising the whole repository, the handoff prompts it to explore too much; tighten ## Next. Then confirm the selected model on screen: the model name is displayed next to the input box, and it must read Gemini, not the model that produced the original error. Send one real task from ## Next and confirm the answer streams normally with no length warning.
Use this table to pick the right fix instead of guessing:
| Action | Fixes | Does not fix |
|---|---|---|
| Same conversation, shorter message | nothing — the accumulated window is already spent | the length error |
| New conversation, no handoff | a stuck window | you re-attach the same files and hit the limit again |
| New conversation + `HANDOFF.md` + Gemini | a stuck window with the task preserved | very large single-file reads, which still fill the window |
| Switching models inside the old conversation | response quality | the length error, which is per conversation |
Problem. The error appears after only three or four messages.
Your conversation has become too longHANDOFF.md. Check what is heavy before you re-attach anything: du -sh * | sort -h | tail -5 shows the largest items in the workspace, and anything above a few megabytes should stay out of the agent's scope.Problem. The new conversation still shows the length warning on the first message.
Your conversation has become too longcd packages/<package-name> and reopen it), and retry. If the warning survives, the build or the account session is at fault — sign out and back in, then check the documentation for the current per-model limit.Problem. After the switch, the agent "forgets" the plan and re-proposes work that is already done.
## Decisions entry for each rejected option with one line of reasoning, re-commit, and start again. For a comparison of how other agentic coding tools handle this same problem, see Claude Code Desktop: setup, limits and how it differs from the CLI.You now have a committed HANDOFF.md and a clean Gemini conversation that continues the same task. Keep the handoff file updated at the end of each long session, and when you need to choose between assistants before committing to one, use the AI assistant comparison.
Does starting a new conversation delete my code or my files?
No. A conversation is chat history plus context; the files on disk are untouched. That is exactly why Step 1 commits or stashes first — the only real loss is uncommitted work.
Why does the error appear when my chat looks short?
Because the limit counts everything the agent has read and every command output it has received, not just the visible messages. A single large file read or a verbose test run can consume the window in one turn.
Does switching to Gemini keep my previous conversation?
No. The model picker changes which model answers; the previous conversation keeps its own accumulated history. Switching inside an old conversation does not free the window — you need a new conversation seeded with HANDOFF.md.
Can I raise the context limit instead of compacting?
Not from the app settings. The limit is set per model by the provider, and available models change between releases — check the documentation for the current list and limits before planning a long session around one model.
Status: practical guide. Some statements come from vendors; verify in your environment.
Time to complete: 15 minutes You will need: Google Antigravity installed and signed in, a Git repository for the project the agent is working on, a terminal with Git 2.x, and the conversation that currently shows the length error.
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| разговор стал слишком длинным antigravity | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| google antigravity лимит контекста | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| как увеличить контекст ии-агента | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| antigravity сжатие истории диалога | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Git | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| компания | упоминается в заголовке, TL;DR или разделах гайда | |
| Gemini | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| No external links | — | — |
Cite as: AI Release. Как исправить ошибку «Ваш разговор стал слишком длинным» в Google Antigravity: сжатие контекста, лимиты и переход на Gemini. ai-release.org.