Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
After upgrading to Cursor 3.0, the new /worktree command partially executes .cursor/worktrees.json setup commands. pnpm install runs successfully, but subsequent cp commands using $ROOT_WORKTREE_PATH fail silently – .env files are missing in the created worktree. This was working correctly prior to the /worktree command migration.
{
"setup-worktree": [
"pnpm install",
"cp $ROOT_WORKTREE_PATH/apps/client/.env apps/client/.env",
"cp $ROOT_WORKTREE_PATH/.env.local .env.local",
"cp $ROOT_WORKTREE_PATH/supabase/.env.local supabase/.env.local"
]
}
Steps to Reproduce
- Place the above worktrees.json in .cursor/
- Use /worktree to create a new worktree
- node_modules exists (confirming pnpm install ran), but all three .env files are missing
Expected Behavior
$ROOT_WORKTREE_PATH should resolve to the original project root, and all setup commands should execute – as they did before Cursor 3.0.
Operating System
MacOS
Version Information
Version: 3.0.12
Additional Information
This is a pnpm monorepo. The fact that pnpm install succeeds but the cp commands don’t suggests the issue is specifically with $ROOT_WORKTREE_PATH no longer being set or resolved under the new /worktree flow.
FWIW, When I asked my agent to debug this (Sonnet 4.6), they said:
That was my mistake. The worktree creation instructions explicitly say:
After each create, look for
.cursor/worktrees.jsoninREPO_ROOT, thenWORKTREE_PATH. If found, run setup once before other work.I skipped that step — I created the worktree, saw the output, and immediately jumped into reading source files and implementing the feature without checking for a setup file. I should have looked for
.cursor/worktrees.jsonin the repo root right after the worktree was created and run its commands before doing anything else.
Does this stop you from using Cursor
No - Cursor works, but with this issue