Creating a new file and applying from a worktree fails to create a file

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Applying from a worktree does not write context of file, it just creates the file

Steps to Reproduce

  1. Create a fresh directory
  2. Run git init
  3. Open this directory in cursor
  4. Ask any model to write the text “Hello world” in hello.txt using a worktree
  5. Click apply
  6. Open hello.txt from the IDE, the text fails to save. It works fine if you don’t use a worktree

Expected Behavior

When clicking apply, the contents of the file are also written instead of the file just being created.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (user setup)
VSCode Version: 1.105.1
Commit: b3573281c4775bfc6bba466bf6563d3d498d1070
Date: 2025-12-12T06:29:26.017Z
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.22631

For AI issues: which model did you use?

composer-1 and grok-code-fast-1

Additional Information

this is the 6th breaking bug that has affected me in the past two months

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. This is a known issue with worktree in version 2.2.20 - the agent creates new files, but when you click “apply,” the content isn’t saved to disk, leaving the files empty. The team is investigating this.

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