When start a new agent session, and choose to work in a worktree / master,cursor does work in an isolated directory, but it doesn’t create a corresponding git branch for that worktree.
Steps to Reproduce
new agent, choose workttree/master, click open terminal in worktree, run git branch
Expected Behavior
create a corresponding branch for that session. if there’s no branch, when master is updated, I cannot merge the code.
Hey, thanks for the report. This is a known bug. The branch name isn’t being passed correctly from the UI when creating a worktree, so you end up in a detached HEAD state instead of a proper branch.
The team is aware of this, and your report helps us prioritize it.
As a workaround, you can create the worktree manually and then point the agent to it:
Thx a lot!And there’s another user experience problem when using worktree: when you start a new session on a worktree, the session panel is still retaining in the current window. I have to create a new cursor window to open the worktree directory, so that I can run some commands to verify the result, but if there’s any problem, I have to jump back to the original window, find that session and copy the errors, and then jump back to the worktree window to verify again. This is super inconvenient sometimes!
Hey, good point about the UX. It really is inconvenient to switch back and forth between windows to check the result and copy errors back into the session.