Worktrees Setup not working in WSL

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

The Worktrees Setup feature doesn’t work when Cursor is running inside WSL.
When I start an agent chat in Worktree mode within WSL, the setup process fails to find the configuration file even though it exists.

In the IDE logs, I see this:

[worktree-setup] checking config
{"composerId":"36f27267-93fa-4616-85c9-47e238febff6","worktreePath":"/home/erickluis00/.cursor/worktrees/acessopro__WSL__ubuntu-22.04_/1W1Q0","rootWorkspacePath":"\\home\\erickluis00\\ubuntu-projects\\acessopro","worktreeConfigFile":"file:///home/erickluis00/.cursor/worktrees/acessopro__WSL__ubuntu-22.04_/1W1Q0/.cursor/worktrees.json","rootConfigFile":"file:///home/erickluis00/ubuntu-projects/acessopro/.cursor/worktrees.json","isTargetWindows":false,"remoteOS":3}
[worktree-setup] no config file found in worktree or root, skipping

It seems like Cursor is not correctly resolving WSL paths.

When running the same setup outside WSL, everything works perfectly.

Steps to Reproduce

  1. Open Cursor IDE connected to a WSL distro (e.g., Ubuntu 22.04).
  2. Create or open a project inside WSL (e.g., /home/user/project).
  3. Add a .cursor/worktrees.json file in the project directory.
  4. Start a new chat in Worktree mode.
  5. Open the “Worktrees Setup” logs.

Result:
You’ll see no config file found in worktree or root, skipping.

Expected Behavior

The Worktrees Setup should detect and load .cursor/worktrees.json correctly even when running inside WSL, just like it does on Windows folders.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.40 (user setup)
VSCode Version: 1.99.3
Commit: a9b73428ca6aeb2d24623da2841a271543735560
Date: 2025-10-30T04:12:35.564Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

Worktrees Setup Logs

[2025-10-30T19:10:11.636Z] [worktree-setup] checking config
{"composerId":"36f27267-93fa-4616-85c9-47e238febff6","worktreePath":"/home/erickluis00/.cursor/worktrees/acessopro__WSL__ubuntu-22.04_/1W1Q0","rootWorkspacePath":"\\home\\erickluis00\\ubuntu-projects\\acessopro","worktreeConfigFile":"file:///home/erickluis00/.cursor/worktrees/acessopro__WSL__ubuntu-22.04_/1W1Q0/.cursor/worktrees.json","rootConfigFile":"file:///home/erickluis00/ubuntu-projects/acessopro/.cursor/worktrees.json","isTargetWindows":false,"remoteOS":3}
[2025-10-30T19:10:11.645Z] [worktree-setup] no config file found in worktree or root, skipping

Does this stop you from using Cursor

No - Cursor works, but with this issue

3 Likes

I also use devcontainer and am experiencing the same situation.

1 Like

Hey, thanks for the report. It looks like your config file is correct, but the logs show rootWorkspacePath using Windows-style backslashes (\\home\\erickluis00\\ubuntu-projects\\acessopro) instead of Unix forward slashes. That’s why the config file lookup fails.

This seems to be a bug in how Cursor handles path resolution in WSL environments. I’ll pass this to the team along with your logs and repro steps.

Hi @deanrie, there is Any updates on this case? Any workaround or status on the fix?

Bump

Hi @Gilbert_Leung , thank you for filing, we were incorrectly treating WSL and assuming paths in WSL are just like paths in Windows (they aren’t).

I have fixed the issue and it’ll be in the next build of 2.1, should be 2.1.26 or higher.

@Erick_Luis was the one with proper bug report. He should get the thanks.

Thank you @David_Gomes ; this was the one bug stopping me from using Cursor 2.

Even after the recent fix, Cursor still doesn’t detect the worktrees.json file inside WSL.
I’ve updated to version 2.1.26, and the rootWorkspacePath now appears to be correct, but the setup still outputs: [worktree-setup] no config file found in worktree or root, skipping.

[2025-11-24T11:00:11.593Z] [worktree-setup] checking config
{"composerId":"3cd4f49f-4b18-4c66-a56d-cb7509efbc15","worktreePath":"/home/erickluis00/.cursor/worktrees/worktreeagentstest__WSL__ubuntu-22.04_/j7uG2","rootWorkspacePath":"/home/erickluis00/ubuntu-projects/worktreeagentstest","worktreeConfigFile":"file:///home/erickluis00/.cursor/worktrees/worktreeagentstest__WSL__ubuntu-22.04_/j7uG2/.cursor/worktrees.json","rootConfigFile":"file:///home/erickluis00/ubuntu-projects/worktreeagentstest/.cursor/worktrees.json","isTargetWindows":false,"remoteOS":3}
[2025-11-24T11:00:11.598Z] [worktree-setup] no config file found in worktree or root, skipping

@Gilbert_Leung, could you test this on your side as well to confirm if the issue persists?

Version: 2.1.26 (user setup)
VSCode Version: 1.105.1
Commit: f628a4761be40b8869ca61a6189cafd14756dff0
Date: 2025-11-24T05:39:06.655Z
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.26200

@David_Gomes

[2025-11-26T07:42:22.342Z] [worktree-setup] checking config

{“composerId”:“66b8118b-b61a-440e-ac77-1433c1f70e15”,“worktreePath”:“/home/gilbert/.cursor/worktrees/mono__WSL__Ubuntu_/wge”,“rootWorkspacePath”:“/home/gilbert/mono”,“worktreeConfigFile”:“file:///home/gilbert/.cursor/worktrees/mono__WSL__Ubuntu_/wge/.cursor/worktrees.json”,“rootConfigFile”:“file:///home/gilbert/mono/.cursor/worktrees.json”,“isTargetWindows”:false,“remoteOS”:3}

[2025-11-26T07:42:22.357Z] [worktree-setup] no config file found in worktree or root, skipping

=====

~/mono master $ pwd
/home/gilbert/mono
~/mono master $ ls -al .cursor/worktrees.json
-rw-r–r-- 1 gilbert gilbert 57 Nov 25 20:18 .cursor/worktrees.json
~/mono master $

=====

  1. same issue as @Erick_Luis
  2. verified that the rootConfigFile exists, but is not detected by Cursor

Version: 2.1.36 (system setup)
VSCode Version: 1.105.1
Commit: 9cd7c8b6cebcbccc1242df211dee45a4b6fe15e0
Date: 2025-11-26T03:43:48.079Z
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.26200

Bump

Looking into this!

1 Like

Possibly related:

There are a couple more critical bugs on intersection of worktrees and devcontainer:

  1. If I click on “Apply” button — I’m getting error like this:
    Failed to apply worktree to current branch: Unable to read file 'vscode-remote://dev-container+7b2273…d6f6e7
  2. If I click on “Review” button — it shows that the all changed files are entirely new, while it’s not. But reviewing changes by checking git diff still works well.

Please, prioritise these bugs, because it really slows down development and pushing me and my team to switch to another solutions. If you need any logs / details — feel free to ask me.

Likely related

@Erick_Luis can you share your .cursor/worktrees.json?

{
“setup-worktree”: [
“pnpm install”
]
}

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