Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
worktrees.json setup failed with “Failed to cd to worktree directory”
Steps to Reproduce
Probably not minimal reproducible steps, happens locally with not many logs to go through
On MacOS
- Setup
.cursor/worktrees.jsonwith a configuration in your project - Go to cursor IDE, create a worktree chat. Ask it to do anything.
- Setup is not run. The following logs appear:
[2026-01-12T12:34:26.389Z] [worktree-setup] checking config
{“composerId”:“40447bbe-c749-4d48-8800-849ce6e86289”,“worktreePath”:“/Users/myuser/.cursor/worktrees/myrepo/wws”,“rootWorkspacePath”:“/Users/myuser/Projects/myorg/myrepo”,“worktreeConfigFile”:“file:///Users/myuser/.cursor/worktrees/myrepo/wws/.cursor/worktrees.json”,“rootConfigFile”:“file:///Users/myuser/Projects/myorg/myrepo/.cursor/worktrees.json”,“isTargetWindows”:false}
[2026-01-12T12:34:26.392Z] [worktree-setup] selected setup spec
{“key”:“setup-worktree”,“hasCommands”:true,“hasScript”:false,“configPath”:“file:///Users/myuser/.cursor/worktrees/env0/wws/.cursor/worktrees.json”}
[2026-01-12T12:34:26.407Z] [worktree-setup] started terminal session
{“sessionId”:“308509dd-ab4b-4eeb-9445-59f2f5beab0d”,“worktreePath”:“/Users/myuser/.cursor/worktrees/myrepo/wws”}
[2026-01-12T12:34:26.408Z] [worktree-setup] executing combined UNIX script with per-command logs
{“worktreePath”:“/Users/myuser/.cursor/worktrees/myrepo/wws”,“scriptLength”:617}
[worktree-setup] ERROR: Failed to cd to worktree directory
[2026-01-12T12:34:26.844Z] [worktree-setup] all commands finished
{“durationMs”:451}
[2026-01-12T12:34:26.845Z] [worktree-setup] ended terminal session
{“sessionId”:“308509dd-ab4b-4eeb-9445-59f2f5beab0d”}
Expected Behavior
worktrees.json commands are run, no failures in console
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Version: 2.3.34 (Universal)
VSCode Version: 1.105.1
Commit: 643ba67cd252e2888e296dd0cf34a0c5d7625b90
Date: 2026-01-10T21:17:10.428Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Darwin arm64 25.0.0
Does this stop you from using Cursor
No - Cursor works, but with this issue