Worktree created from worktree instead of Local copy and can't delete worktrees

  • Cursor IDE
  • MacOS
  • Version: 2.4.27 (Universal)
  • VSCode Version: 1.105.1
  • Commit: 4f2b772756b8f609e1354b3063de282ccbe7a690

I fired off a “Use multiple models” agent, and it created a worktree from another worktree instead of my local copy. I know because it’s referencing a method in it’s response which doesn’t exist in my local copy.

I added "git.showCursorWorktrees": true to my settings so I could see the worktrees, and I can’t delete any of them. I click the 3 dots to the right of the worktree > Worktrees > Delete Worktree and get this popup:

You cannot delete the worktree you are currently in. Please switch to the main repository first.

I have no other windows open, closed all files, and closed all agent tabs.

Nothing shows me I’m working within a worktree, or which worktree I’m in, and I have no idea how to switch in/out of them via the IDE.

Creating a basic Local agent works fine and edits my local directory as expected.

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Cursor IDE
  • Cursor CLI
  • Background Agent (GitHub, Slack, Web, Linear)
  • BugBot
  • Somewhere else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!

Hey, thanks for the report. This is a known issue with worktrees and agents, the team is aware of it.

Similar reports: Multi-agent copy from worktree

When you use multi-agent mode (Use Multiple Models), agents sometimes switch incorrectly between the worktree and the main directory when creating and applying changes. This can also block deleting worktrees through the UI.

For now, please try these workarounds:

  • Remove worktrees manually in the terminal: git worktree remove ~/.cursor/worktrees/[project]/[hash] (if that doesn’t work, add the --force flag)
  • If Cursor says you’re inside a worktree, try restarting the IDE, this often resets the state
  • Next time, try using Single Agent instead of Multiple Models until we fix this

I’ll pass your report along for prioritization.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.