Skip to content
Compact command (/compact)2-0Antigravity AppCommandsCompact command (/compact) Antigravity App CommandsAntigravity AppAntigravity CLI
Available on:
Antigravity AppAntigravity CLI

Summarize your conversation so far into a structured checkpoint so the agent continues from a smaller context window, without starting a new conversation or waiting for automatic compaction.

As a conversation grows, every file read, command output, and intermediate turn accumulates in the model’s context window. Antigravity automatically compacts older turns when a conversation approaches the model’s context limit, and /compact lets you trigger that same checkpointing step on demand—for example, right after finishing codebase exploration or completing a milestone:

  • Frees up context on your schedule: replaces earlier conversation turns with a concise continuation checkpoint before stale logs or exploratory searches crowd out your next task.
  • Preserves working state: retains key decisions, file paths, errors and fixes, attached media and files, active background tasks, live subagents, and session artifacts.
  • Makes no workspace changes: compaction calls no tools and modifies no files on disk.
  • Supports compact-and-stop or compact-and-continue: run /compact on its own to compact and pause, or pass instructions after /compact to compact first and immediately continue working.

You can run /compact by itself or with follow-up instructions.

To summarize the conversation so far and end the turn immediately, send bare /compact:

/compact

Antigravity writes the checkpoint summary and stops without calling the agent again, so your next message is the first to run on the compacted context.

To summarize the conversation first and then have the agent act on your next request in the same turn, add your message after /compact:

/compact Keep the OAuth token refresh findings, and now add unit tests for the new middleware.

Your text after /compact guides the summarization step—so you can tell it which findings or constraints to emphasize—and is then answered by the agent using the newly compacted context.

In the Antigravity App (v2.21.0+), type /compact or /compact <message> in the composer and press Enter:

/compact
  • Live status: while the checkpoint summary is being generated, the status line beneath your message shows Compacting (with an elapsed timer such as Compacting · 45s on longer conversations).
  • Cancel: click Stop while compaction is running to cancel it. Cancelled compactions don’t write a checkpoint, leaving your existing conversation context unchanged.

When /compact runs, Antigravity replaces older raw steps in the active model context with a checkpoint that combines a structured summary and deterministic session state:

  1. Structured continuation summary: captures your task overview and success criteria, completed progress (file paths, commands run, and verification outcomes), key technical findings and decisions, errors encountered and how they were fixed (including approaches that were tried and abandoned), active context, remaining next steps, and standing rules or constraints.
  2. Deterministic session snapshots: preserves recent user requests and attached images, PDFs, and files, active background tasks, live subagents, and session artifacts (such as implementation plans and walkthroughs) alongside the prose summary.
  3. Workspace and customizations: your files on disk and your loaded rules, skills, tools, and MCP servers remain active as usual.

Earlier messages stay visible in your conversation scrollback and saved session history; compaction only shortens what’s sent in future model requests.

Use /compact alongside Antigravity’s other session and context tools depending on what you want to keep:

GoalCommand or actionWhat happens to context
Keep working on the same task with a smaller context window/compact [message]Summarizes earlier turns into a checkpoint and continues in the same conversation.
Ask a quick tangential question without adding to history/btw <question>Answers in a read-only fork so neither the question nor its tool calls enter the main conversation.
Inspect current token usage by category (CLI)/contextOpens the Context Usage grid, token breakdown, and checkpoint count without modifying history.
Undo a wrong turn or failed tangent/rewind (CLI) or Revert on an earlier prompt (App)Rolls the conversation back to an earlier message instead of keeping failed attempts in context.
Try an alternative approach in parallel/fork (CLI) or Fork (App)Clones the conversation up to that point into a separate session.
Switch to a completely unrelated task/clear / /new (CLI) or New Conversation (App)Starts a fresh conversation with an empty history.