Fork conversations
Section titled “Fork conversations”Branch an existing conversation into a new, independent conversation so you can test an alternative approach, compare two implementations side by side, or rewind to an earlier turn without modifying your original thread.
Antigravity App
Section titled “Antigravity App”In the Antigravity App, open the Fork Conversation menu on a completed turn, choose Fork in New Git Worktree to branch in an isolated working copy, send a follow-up prompt, and click the Forked from banner to compare both threads side by side.
Conversation forking is available in the Antigravity App version 2.36.0 and later.
Antigravity CLI
Section titled “Antigravity CLI”In the Antigravity CLI, run /fork to branch the active session into a new conversation, try an alternative change, and run /resume with the original conversation ID to switch back.
Overview
Section titled “Overview”Forking lets you split one conversation into parallel branches that share the same starting context:
- Branch from the latest response or an earlier turn: in the Antigravity
App, fork from any completed agent turn, the conversation header menu, or any
conversation in the left sidebar. In the Antigravity CLI, run
/fork(or/branch) at the prompt to branch from the current point. - Isolate code changes in a Git worktree: when your project folder in the Antigravity App is a Git repository, you can fork in the current folder or create a new Git worktree so both branches edit files independently.
- Compare or switch between threads: in the Antigravity App, click the
Forked from banner at the top of a forked conversation to inspect the
original and forked conversations side by side, or click the parent title to
open the original conversation. In the Antigravity CLI, switch between threads
with
/resume. - Turn a side question into a full conversation: in the Antigravity App,
continue any finished
/btwside question as a top-level conversation when a quick lookup grows into hands-on work.
Fork a conversation
Section titled “Fork a conversation”Antigravity App
Section titled “Antigravity App”You can fork a conversation from the action toolbar on any completed agent turn, from the conversation header, or from the conversation list in the left sidebar.
- Open the fork menu from one of three places:
- Any completed turn: at the bottom of the agent response you want to branch from, click Fork Conversation (the branch icon next to Copy and the feedback buttons). Forking from an earlier turn keeps only the conversation history up to that turn.
- Conversation header: at the top right of the conversation, click More actions (⋮) and point to Fork. This branches from the latest step, including while a turn is running (any in-progress steps are canceled in the new branch).
- Left sidebar: hover over a conversation in the sidebar, click More options (⋮) or right-click the row, and point to Fork to branch that conversation from its latest step.
- Choose where the forked conversation should work:
- Fork in Current Folder: keeps working in the same project folder without copying or rewinding files.
- Fork in New Git Worktree: available for Git repositories. Creates a new Git worktree in the same project from the current commit and copies your uncommitted (staged, unstaged, and untracked) changes into it without modifying the original folder.
- Send your next prompt in the new conversation. Antigravity opens the fork with a Forked from banner at the top and a collapsible Conversation Forked notice at the branch point.
Choose a folder or worktree destination
Section titled “Choose a folder or worktree destination”The destinations in the fork menu depend on your project folder and your active interface layout:
| Menu option | When it appears | Latest-turn fork | Earlier-turn fork |
|---|---|---|---|
| Fork in Current Folder | All folders (Git repositories and plain folders). Shown as Fork conversation in this folder in the Knowledge Work layout. | Branches the conversation in the same folder and project. No files are copied or changed. | Rewinds the conversation history only. Files in the folder stay as they are. |
| Fork in New Git Worktree | Git repositories in the default Software Engineering layout. | Creates a new Git worktree in the same project from the current commit and copies your uncommitted changes (staged, unstaged, and untracked) into it, leaving the original folder unchanged. | Creates a new Git worktree from the current commit and copies your current uncommitted changes rather than rewinding files, so the worktree may include edits made after the forked turn. |
Navigate between parent and forked conversations
Section titled “Navigate between parent and forked conversations”Every forked conversation displays a Forked from banner below the conversation header:
- Open side-by-side split view: click the Forked from banner bar to view the original conversation on the left and the forked conversation on the right.
- Return to the original conversation: click the parent conversation title inside the Forked from banner to open the original conversation directly. If the original conversation was deleted, the banner displays Deleted conversation.
- Inspect the fork notice: expand Conversation Forked at the branch point in the conversation to view the parent conversation ID, the forked artifact directory, and any folder or worktree notes.
Continue a /btw side question as a conversation
Section titled “Continue a /btw side question as a conversation”When a /btw side question finishes in the
side panel and you want to turn it into a full conversation,
click Continue as a New Conversation in the tab header. If your project is a
Git repository, choose Continue in Current Workspace or Continue in Shared
Workspace. Antigravity creates a new top-level conversation from the side
question’s history, carries over any unsent draft or attachments, and closes the
side question tab.
Antigravity CLI
Section titled “Antigravity CLI”In an interactive CLI session, run /fork (or its alias /branch) to branch
the active conversation into a new conversation ID:
# Branch the current conversation in the same project and folder
/fork
# Branch using the /branch alias
/branch
# Branch the current conversation into another configured project
/fork <project_id>-
Type
/fork(or/fork <project_id>) in the prompt box and press Enter. -
The CLI creates a new conversation ID with a copy of your conversation history, model selection, active custom agent, and workspace directories, and switches your terminal session to the new branch:
Forked conversation. To go back, use: /resume a7c85357-8648-4cf4-b0d1-54d32f828f1c -
Send your next prompt in the forked conversation. Your original conversation remains unchanged.
Fork into another project
Section titled “Fork into another project”Pass a <project_id> to move a branched copy of your conversation into another
configured project:
/fork billing-serviceThe CLI loads ~/.gemini/config/projects/<project_id>.json, associates the
forked conversation with that project, adds the project’s local folders to the
active session, and prints the /resume command for the original conversation:
Forked conversation into project "billing-service".
To go back, use: /resume a7c85357-8648-4cf4-b0d1-54d32f828f1cIf <project_id> doesn’t match a valid project configuration file, /fork
reports an error and keeps you in the current conversation.
Switch between branches or fork from an earlier turn
Section titled “Switch between branches or fork from an earlier turn”- Jump directly to the original conversation: run the
/resume <conversation_id>command printed by/fork(or pass any unique ID prefix, such as/resume a7c85357). - Browse all branches interactively: run
/resumewith no arguments (aliases/switchand/conversation) to open the conversation picker and switch between the original thread and any forks. - Branch from an earlier message: in the CLI,
/forkalways branches from the latest step. To roll back a conversation in place instead, run/rewind(alias/undo), noting that/rewindalso reverts workspace file edits made after the selected message.
What a forked conversation inherits
Section titled “What a forked conversation inherits”A fork copies your conversation state up to the branch point while keeping live background processes isolated:
| Item | Antigravity App | Antigravity CLI |
|---|---|---|
| Conversation history | Copies all messages, reasoning, and tool outputs up to the selected turn. | Copies all messages, reasoning, and tool outputs up to the latest step. |
| Model and agent settings | Inherits the active custom agent, project context, and conversation title metadata. | Inherits the selected model, active custom agent (or switches agents when forking from /agents), workspace directories, and project. |
| Workspace files | Unchanged for Fork in Current Folder; new Git worktree at the current commit with your uncommitted (staged, unstaged, and untracked) changes copied in for Fork in New Git Worktree (without modifying the original folder; falls back to the current commit with a warning if copying fails). | Unchanged; continues in the current workspace directories (plus any folders loaded by /fork <project_id>). |
| Artifacts | Copies artifacts (such as plans and walkthroughs), scratch files, and bookmarks from the source conversation’s current state into the new conversation’s artifact folder (up to 256 MiB / 2,000 files, skipping scratch/ first if over the limit), updating conversation ID references in text artifacts. For earlier-turn forks, copied artifacts reflect the current state rather than the earlier turn. | Keeps artifact files in the original conversation’s artifact folder without duplicating them. |
| Subagents and background tasks | Stay attached to the original conversation and aren’t duplicated into the fork. Start new subagents in the fork if needed. | Stay attached to the original conversation and aren’t duplicated into the fork. |
Limitations
Section titled “Limitations”- Local sessions only: conversation forking in the App and
/forkin the CLI aren’t available in remote agent conversations. In the CLI,/forkis an interactive TUI command (usable with both Google sign-in and a Gemini API key) and isn’t available in headless mode (-por--print). - Completed turns in the App: the per-turn Fork Conversation button appears only on completed agent responses. To fork while a turn is running, use More actions (⋮) > Fork in the conversation header or More options (⋮) > Fork in the sidebar.
- Git worktree prerequisites: Fork in New Git Worktree requires a single-folder workspace whose Git repository has at least one commit. For multi-folder workspaces or repositories with no commits yet, use Fork in Current Folder (or make an initial commit first).
- Custom executable agents: in the App, conversations driven directly by an
executable custom agent can’t be forked. In the CLI,
/forkstarts a fresh agent process without carrying over in-memory process state. - Concurrent CLI sessions: if you open a conversation that’s already active
in another CLI window on the same machine, the CLI displays a banner
suggesting
/forkso the two terminals don’t write to the same conversation.
Choose between fork, /btw, /compact, and rewind
Section titled “Choose between fork, /btw, /compact, and rewind”| Goal | What to use | Effect on history |
|---|---|---|
| Explore an alternative approach without losing your current thread | Fork Conversation (App) or /fork (CLI) | Creates a new conversation starting from a copy of your history up to that point. |
| Ask a quick question without interrupting the agent | /btw <question> | Answers in a separate read-only fork and leaves your main conversation untouched. |
| Free up context window space on the same task | /compact | Summarizes earlier turns into a checkpoint and continues in the same conversation. |
| Undo a wrong turn in place | Undo on an earlier prompt (App) or /rewind (CLI) | Drops later turns in the current conversation (with optional file preservation in the App; reverts files in the CLI). |
Next steps
Section titled “Next steps”- Side question command (
/btw): ask read-only side questions while the agent works, and continue them as full conversations in the App. - Compact command (
/compact): summarize long conversations into a checkpoint to reclaim context window space. - Resume command (
/resume): search, group, and switch between original and forked conversations in the CLI. - Managing conversations: rewind, list, clean, and compact saved CLI conversations.
- Projects: organize folders, Git worktrees, and CLI
project configurations for
/fork <project_id>.