Skip to content

Branch a Session with /branch

Use /branch when you want to try a different direction without rebuilding context from scratch.

Terminal window
/branch try-streaming-approach

The name is optional. /branch copies the conversation so far and switches you into the copy. The original stays intact, and you can return to it with /resume.

A branch is useful when the current session has valuable context, but you want a separate thread for an experiment or an alternate implementation.

  • Try a second approach to the same feature.
  • Explore a risky change without derailing the main session.
  • Take a second pass at the work without adding that discussion to the original conversation.

A branch inherits everything, so it is not an independent reviewer. For a fresh pair of eyes, use a subagent review.

/branch does not run anything in parallel. It switches you into the copy, and the original sits idle until you resume it.

  • /branch [name]: switch into a copy yourself.
  • /fork [prompt]: copy the conversation into a new background session and keep working here (v2.1.212 or later).
  • /subtask: hand a side task to a subagent that reports back into this conversation.

Use /branch when the existing context is valuable.

Use /clear when the existing context is irrelevant or polluted.

/branch copies conversation context. It does not isolate files, so a branch edits the same working directory as the original.

For parallel implementation, prefer /fork, which tells the background copy to create its own git worktree before it edits code (v2.1.221 or later), or start separate sessions in git worktrees yourself.