Skip to content

Multiple Worktrees

You can create worktrees in a workspace under git and separate your work by worktree. In the sidebar, the worktree list appears under the workspace. When you select a worktree, you can start a chat in that worktree.

Use worktrees when you want to separate your work by Issue or by branch. If you create a worktree by entering just an Issue number, it uses the app’s standard branch name (e.g. feature/issue-123).

  1. In the sidebar, press “+” on the workspace row. The “Create worktree” dialog appears.
  2. In “Issue number or branch name”, enter an Issue number (e.g. 123) or a branch name.
  3. Check the “Branch”, “Location”, and “Base” shown in the dialog, and press “Create”.

The “Create worktree” dialog showing the “Issue number or branch name” input box and the base

  • You can enter an Issue number of up to 9 digits. You can also put “#” before the number.
  • “+” appears only for workspaces under git.
  • While a worktree is being created, you cannot create another worktree.

Worktrees are created in the directory specified in “Worktree Base Directory” under “Worktree” in Settings. If it is not set, worktrees are created in the parent directory of each git repository (at the same level as the repository).

  1. Open “Worktree” in Settings.
  2. Specify a directory in “Worktree Base Directory”, and press “Save”.

The “Worktree” screen in Settings showing the “Worktree Base Directory” input box

Press a worktree in the sidebar to select it and its workspace, and you can start a chat.

  1. Press “×” on the row of the worktree to delete. “×” does not appear for the worktree marked “Primary”.
  2. In the “Delete the worktree?” confirmation, press “Delete”.

Deleting a worktree does the following.

  • It deletes the worktree directory and its branch. The branch is kept if it has commits that are not merged.
  • If it is running, it is stopped and the conversation is discarded.

If there are uncommitted changes or untracked files, the “Delete with uncommitted changes?” confirmation appears. If you press “Force delete”, the uncommitted changes and untracked files are lost and cannot be restored.