Cursor rapidly creating new worktrees

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I only ever open Documents/Code/mono. I have never run git worktree add. There are dozens of worktrees under .cursor/worktrees/mono/ with three-letter names (e.g. dnh, mnm, uqg). Something is creating these automatically. Please confirm whether Cursor or a Cursor Git integration creates worktrees, and whether this can be disabled so I stay in the main repo.

Steps to Reproduce

I don’t know what started this - I’ve been using cursor fine

Expected Behavior

The agent makes edits in my worktree instead of creating a new one every few minutes and sprinkling its edits in them

Operating System

MacOS

Version Information

Version: 2.4.31 (Universal)
VSCode Version: 1.105.1

For AI issues: which model did you use?

Auto

Does this stop you from using Cursor

Yes - Cursor is unusable

1 Like

Hey, thanks for the report. Worktrees in .cursor/worktrees/ are created automatically when you use Parallel Agents or Best-of-N (the “Use Multiple Models” option). Each agent run gets its own worktree so it can make changes in isolation, so folders with three-letter names are expected.

A couple questions to narrow this down:

  1. When you send a request, do you select “Use Multiple Models” or run agents in worktree mode (there’s a dropdown at the top of the agent panel)? If you want the agent to edit your working copy directly, make sure you’re using a single local (Local) agent.
  2. If you’re already using a single local agent but worktrees are still being created, that’s a bug. Can you confirm?

In the meantime:

Clean up existing worktrees:

git worktree prune
rm -rf ~/.cursor/worktrees/mono

Limit worktree buildup in the future (add to settings.json):

{
  "cursor.worktreeMaxCount": 5,
  "cursor.worktreeCleanupIntervalHours": 1
}

Show worktrees in the SCM panel (optional, for visibility):

{
  "git.showCursorWorktrees": true
}

Worktree docs: Parallel Agents | Cursor Docs

Let me know if you’re intentionally using parallel or multi-model mode, it’ll help figure out whether something is actually broken.

1 Like

Thanks for the response.

I did spend some time using multiple models running concurrently. I managed to put this particular agent in a state where I couldn’t select any options for

I’m not sure what steps I took to get here. However a new agent window shows what I’m used to seeing where I can be sure I’m not running parallel agents.

This seems to have resolved the issue and I’ll clean up all the worktrees that were created.

This solved it for me. I was stuck showing the “Apply”/“Review” buttons that did nothing.

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