Resources · How-to guides

How-to guides

Give a task its own worktree

Create a branch, start a session on its own worktree, and keep its changes apart from your main checkout and other sessions.

20-second silent walkthrough, recorded from a real Prokop instance. Written steps below.

Before you start

You need a workspace that is a Git repository. A worktree is a second checkout of the same repository on its own branch, so a session can edit files there while your main checkout and other sessions stay untouched. Git allows one checkout per branch, so each worktree needs a branch nobody else has checked out.

1. Create a branch

  1. Open the right dock and click the Branches tab.
  2. Click + (New branch), type a name, and click Create.

The branch starts from the commit shown, or from the commit you selected in the history. Your current checkout stays where it is.

2. Start a session on a new worktree

  1. Click New Chat in the session list.
  2. Before sending the first message, click the checkout button in the composer. It shows Primary checkout until you pick something else.
  3. Choose New worktree, pick your branch, adjust the name if you like, and click Create.

The session now shows the worktree as a colored chip in the session list and under the composer. Branches that are already checked out are listed but can't be picked. To reuse a worktree you made earlier, pick it from the same list instead.

The checkout is fixed once the conversation starts, so choose it before the first message.

3. Work as usual

The Explorer and Changes tabs follow the session you're in, so they show the worktree's files. Commit from Changes as usual; see Review and commit what the agent changed. The Worktrees tab lists every worktree with its branch and how many sessions use it.

Sessions in a worktree still use the workspace's memory and skills, so what the agent learns there applies to the whole project.

Running several tasks at once? Work with multiple sessions shows how to keep them side by side. For more detail, see Worktrees in the docs.

Spotted something wrong or missing? Open an issue ↗