New worktree does not use selected branch

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When initiating a new agent, if i select new worktree option it always creates a new cursor branch with a random name, instead of using the branch that I selected. I have to checkout the branch separately.

Steps to Reproduce

Create a new agent from agents window, select a branch, select new worktree option, send a message, note the branch that the chat is using

Expected Behavior

The worktree should use the selected branch

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 3.22.12
VS Code Extension API: 1.128.0
Commit: 3a92974361033b2051526321308c2740fe5912c0
Date: 2026-09-26T04:55:12.125Z
Layout: Agent Window
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Milind,
New Worktree uses the branch you pick as a starting point and puts the agent on its own new branch (that’s cursor/23283375). To have the agent work directly on feat/sdk-add-callback-url:

  1. No isolation needed: pick This Mac instead of New Worktree and select your branch. Cursor will offer to check it out.
  2. Isolation on your branch: run git worktree add ../callback-url-worktree feat/sdk-add-callback-url, then open that folder in Cursor and start the agent there. The branch can’t be checked out in your main folder at the same time.

You can also change the cursor/ prefix under Settings > Source Control > Branch Prefix.

Using the selected branch directly in a new worktree is a fair request, so I’ve moved this to Feature Requests where others can vote on it.