Creating Worktrees from a Bot
What you can do
Section titled “What you can do”In a Bot’s dedicated chat, which you open in the Bots view, you can specify a workspace name and ask the Bot to create a worktree in that workspace. In the same way, you can also ask it to delete a worktree.
Creating and deleting worktrees by specifying a workspace is not available from a regular worktree chat or from the Super Secretary.
When to use it
Section titled “When to use it”Use it when you are interacting with a Bot in the Bots view and want to prepare a worktree for working on an issue without switching to the Projects view.
Create a worktree
Section titled “Create a worktree”-
In the Bots view, choose a Bot and open its dedicated chat.
-
Give the workspace name and an issue number or branch name, and ask the Bot to create a worktree.
Example request:
Create a worktree for issue #10 in expense-api
-
A confirmation dialog appears before the worktree is created. Check the details and press “Allow”. When Tool Permission under Agent in Settings is set to “Auto Allow”, the confirmation dialog does not appear.
-
When creation finishes, the Bot reports the branch and location it created.
-
When you switch to the Projects view, the new worktree appears under the workspace in the sidebar.
The following image shows the completion report after asking for a worktree in a Bot’s dedicated chat.

- Specify the workspace by the name shown in the sidebar. The worktree is created only when exactly one workspace matches the name exactly. If none is found or more than one matches, nothing is created and candidates are returned.
- When you give an issue number (for example,
123or#123), the worktree is created with the branchfeature/issue-<number>. You can also give a branch name (for example,fix/login). - If you do not give the workspace name, or an issue number or branch name, the Agent asks for it.
- The new branch is created from the remote default branch (the branch that
origin/HEADpoints to) after a fetch. - Creating a worktree does not switch the current conversation.
For worktree basics, see Multiple Worktrees.
Delete a worktree
Section titled “Delete a worktree”-
In a Bot’s dedicated chat, give the workspace name and the worktree’s branch name, and ask the Bot to delete it.
Example request:
Delete the feature/issue-10 worktree in expense-api
-
A confirmation dialog appears before the worktree is deleted. Check the details and press “Allow”. When Tool Permission under Agent in Settings is set to “Auto Allow”, the confirmation dialog does not appear.
Deleting a worktree deletes its folder and branch, and stops the Agent and terminals of that worktree. It is not deleted in the following cases.
- The main working tree, a folder not managed by git, or the root of the workspace
- A worktree that is being deleted
- A worktree whose main Agent is running or starting
- A worktree with uncommitted changes