Worktree changes not saved

When agent works in a worktree and writes to a file, the changes are not actually saved on the disk.
In the screenshot below agent created new files: Organization and CurrencyConverter and modified User file. On disk both organization and currencyconverter files are empty and user file does not contain the changes agent made.
I must go through all the changed files, save them manually and then the files are modified on the disk.
The problem is when agent tries to run a test in the worktree, it fails because no changes are actually there, unless I manually save them.
I believe this should not be the case.

image

Version: 2.1.0-pre.2.patch.0 (user setup)
VSCode Version: 1.99.3
Commit: d3c12e88360374a70d1a6729bae06ca5444bb080
Date: 2025-11-02T08:14:12.227Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.19045

2 Likes

also when i click “apply all changes”, not all files are copied from worktree into the main project folder

hi @liquefy , the changes are usually applied when “Apply All Changes” is clicked, and they should be all copied over.

I will file the issue internally for the team.

1 Like

I have also experienced this problem today when first trying agents with worktrees. The agent modified an existing file alright, but it created 5 new files (as planned), but no matter how much I pushed Apply All, Reapply, Create PR (went through github merge pull request) - the files stayed empty. I had to manually copy the contents from Cursor to physical files to apply edits.

1 Like

yes, there are two issues i am experiencing:

  1. when clicking “apply all”, not all of the modified files are moved over (there is a selection between “pending changes” and “all changes” to be moved from the worktree and in my experience both of these fail to move over all the changes)
  2. when agent modifies a file within the worktree, it is not actually written to the file on disk and only visible within cursor ide → this is a problem because i might task the agent to create tests in the worktree, it writes them and when it tries to run the tests within the worktree to verify they are correct → they do not work because they are empty files

on top of that, if im not mistaken, once i accept the changes from the worktree to be moved over, i have the option to revert but after reverting no option to apply again and also once i apply changes, the “review changes” button disappears from the chat so unless i kept the review tab open, i have no option to revert or review changes that were made

5 Likes