Worktree agents fork automatically into separate workspaces

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using Worktree agents, the agent will sporadically launch a new workspace, switch to it, and continue the work there, and it can’t go back to edit the original workspace.

This can spiral out of control and end up with a session of work with 3, 4 worktrees; where putting everything together is a hassle.

Steps to Reproduce

1.- Start a new worktree agent with some work.
2.- After some time, ask the agent for the work it’s done.
3.- It’ll tell you that some of the work is in a separate workspace that Cursor made it launch.

Expected Behavior

Agents does all the work in just one worktree.

Screenshots / Screen Recordings

Operating System

MacOS

Version Information

Version: 2.5.17
VSCode Version: 1.105.1
Commit: 7b98dcb824ea96c9c62362a5e80dbf0d1aae4770
Date: 2026-02-17T05:58:33.110Z
Build Type: Stable
Release Track: Default
Electron: 39.3.0
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Darwin x64 24.6.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Other report: Agent stuck in "Planning...", "Generating..." - #21 by Vidar_Halvorsen

It’s so messy that Cursor not even launched a new session to continue the work from the original worktree, but it grabbed an existing dangling commit, with some totally unrelated work in it, and continued doing the original worktree’s work there, mixing everything up.

Hey, thanks for the report. This is a known issue. Worktree agents sometimes unexpectedly create new workspaces or switch to unrelated branches or commits mid-session.

I can see both screenshots, including the one where the agent picked up an existing “dangling” commit from unrelated work and mixed everything together.

The team is aware of this class of worktree isolation bugs. Your report helps us prioritize it. I added a tag to the report, attached the screenshots, and linked your previous thread.

A couple of questions to help with debugging:

  • Which model are you using when this happens?
  • Do you start the worktree agent manually (via the dropdown), or does the agent decide to use worktree on its own?

Until this is fixed, if you need to keep working, running the agent locally (without worktree mode) might be the more stable option.

  • Which model are you using when this happens?

GPT-5.3 Codex

  • Do you start the worktree agent manually (via the dropdown), or does the agent decide to use worktree on its own?

I start the initial worktree agent manually. The subsequent worktrees are started by the agent itself, and when I’ve asked it why it did, it tells me “Cursor made him do it”.

Until this is fixed, if you need to keep working, running the agent locally (without worktree mode) might be the more stable option.

How do I spawn an agent to do a separate work from what I’m doing locally?

I can’t use Cloud Agents and now Worktree Agents are also failing.

What do you recommend me?

Which model are you using when this happens?

Thanks for the info - GPT-5.3 Codex, noted.

I start the initial worktree agent manually. The subsequent worktrees are started by the agent itself, and when I’ve asked it why it did, it tells me “Cursor made him do it”.

Got it. That’s the core of the bug then - the agent shouldn’t be spawning additional worktrees on its own.

How do I spawn an agent to do a separate work from what I’m doing locally?

Right now, if both cloud agents and worktree agents are giving you trouble, the main option is to use local agents in separate chat sessions. You can have multiple chats open side by side, each working on different parts of the codebase - not as isolated as worktrees, but it works for independent tasks that don’t edit the same files.

If you specifically need isolation (same files, different approaches), worktree mode is the only way, and I understand that’s exactly what’s broken for you.

What do you recommend me?

For the immediate term - try running worktree agents with a different model (Claude Sonnet 4.6 or similar) to see if the cascading behavior is specific to GPT-5.3 Codex. That might narrow things down and also give you a workaround.

I’ve flagged this with the team - no timeline yet, but your detailed report (especially the dangling commit scenario) helps with prioritization. Will update here if there’s news.

So the short answer is:

There’s no way for me to spawn a new agent in a separate and isolated environment right now, even though I’m paying $600 a month for this.

(aka I’m screwed).

I get it, this is really inconvenient, especially on Ultra.

You mentioned Cloud Agents also aren’t working. Can you share more details on what exactly is happening there? If it’s a different bug, we might be able to fix that faster and at least get you back to an isolated workflow via cloud.

Also for the worktree bug, try a different model (Claude Sonnet 4.6) like I suggested above. There’s a chance the cascading worktree creation is specific to GPT-5.3 Codex.

I’ll post here if there are any updates.

I’ve been sharing details for 4 months already: Cloud agent can't connect via api3.cursor.sh

This frustration that you’re seeing wasn’t born from one day to the other…

try a different model (Claude Sonnet 4.6) like I suggested above.

I’m doing a financial application here, where every detail matters. I don’t want a dumber model screwing everything up or introducing a bug that might cost me money later in the future.

I took another look at your thread about the cloud agent. You provided everything we need, curl requests, console logs, and a video. The issue is clear, and it’s on our side.

This task is in our backlog. I’ll reply here when there’s real news.

You said the same thing 4 months ago: Cloud agent can't connect via api3.cursor.sh - #8 by deanrie ……..

Can you at least give me some credits for all the tokens I’ve had to waste due to these issues and the many months of not having access to Cloud Agents?

Any updates on this?

It’s been 15 days since the report and worktree agents keep launching separate worktrees on the same session.

Version: 2.6.11
VSCode Version: 1.105.1
Commit: 8c95649f251a168cc4bb34c89531fae7db4bd990
Date: 2026-03-03T18:57:48.001Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin x64 24.6.0