Multi-agent fails to generate project files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Using multi-agent Worktree mode to do some reports (web search, browser tab), and write some md files.

Files appear under /home/user/.cursor/worktrees/project/TEMP_HASH

Agents are 100% sure TEMP_HASH folder is the real project folder. It is not.

Agents are unable to move or recreate the files in the real project folder.

If I use Apply, I can only use ONE set of files from an agent output, and not the other, they are exclusive for some reason.

Steps to Reproduce

New Agent
Worktree mode
Prompt to generate new files
Unable to see new files in project folder

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.18
VSCode Version: 1.99.3
Commit: 8cb04d86d3ad91716fbaa6853f0c8ce3e64371d0
Date: 2025-10-27T15:23:27.332Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Linux x64 6.8.0-83-generic

For AI issues: which model did you use?

Cheetah + Grok

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known bug in the multi‑agent worktree system.

Temporary workaround: ask the Agent to manually copy files from the worktree to your main project folder. A prompt that worked for another user:

“I’m trying to apply these changes, but Cursor says it can’t find the files. Can you copy them onto main? (not the worktree)”

To help track this issue, please share:

  • The exact error message when clicking Apply
  • Whether you can see the generated files in ~/.cursor/worktrees/
  • Whether the issue persists after updating to the latest Cursor version (current 2.0.40)

This doesn’t always work, because all tool queries and shell commands confirm the files are in the correct positions :grinning_face:

The Agent is convinced this new folder is the actual project work folder.

I am able to drag and drop files, but this conflicts with the Apply/Re-Apply/Undo features.

Also sometimes the same file names are created or changed.

Maybe an option is like a controlled merge session/feature, like the Agent Review function, but for the whole batch of results in the branched changes.

  • There is no error, the feature works with the above caveats.
  • It is very difficult to navigate to these files manually, maybe some buttons besides opening a forked file in a tab and right clicking the tab.
  • I will retry and update later if the Agent sees the original project folder and solve the issue.
1 Like

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I ran three agents to generate a new UI component simultaneously. I’m able to apply code changes generated by GPT 5 Codex High and Composer 1 to the current branch, but the changes created by Claude Sonnet 4.5 failed to apply because of a markdown file the model created and then deleted as shown in the image. I asked the model to delete the git history of this markdown file but it didn’t work.

Steps to Reproduce

  1. Ask the Sonnet 4.5 to create the UI component based on my prompt.
  2. When finished coding, it started creating the markdown file shown in the image but then deleted it as it realized it didn’t follow my Cursor rule that no markdown file should be created for a newly added feature.
  3. After code was generated, hit the Apply All button and the failed to apply worktree to current branch error message popped up.

Expected Behavior

Clicking Apply All will apply changes to the current branch.

Screenshots / Screen Recordings

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.43 (Universal)
VSCode Version: 1.99.3
Commit: 8e4da76ad196925accaa169efcae28c45454cce0
Date: 2025-10-30T18:49:27.589Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 25.0.0

For AI issues: which model did you use?

GPT 5 Codex High
Composer 1
Claude Sonnet 4.5

Does this stop you from using Cursor

No - Cursor works, but with this issue

I got similar issue described by GitandGeek above using 3x models in parallel. If on one model, it create a file, then via some interaction with me this file is deleted, then I got this error (given below), which is frustating

Failed to apply worktree to current branch: Unable to read file ‘/Users/valentindemange/.cursor/worktrees/dashdoc-1/m3o3V/frontends/apps/web-flow/src/hooks/useSimpleFetch.ts’ (Error: Unable to resolve nonexistent file ‘/Users/valentindemange/.cursor/worktrees/dashdoc-1/m3o3V/frontends/apps/web-flow/src/hooks/useSimpleFetch.ts’)