Run setup scripts when a worktree is created
worktrees & cloud
// what it does
A .cursor/worktrees.json file holds setup scripts that run automatically when a new CLI or editor worktree is created — typically installing dependencies and seeding env files so the isolated checkout is ready to build. Skip them for a run with --skip-worktree-setup.
// shell
$ { "setup": ["npm install", "cp .env.example .env"] }// gotcha
A fresh worktree starts from a clean git checkout, so gitignored files like .env and node_modules are not copied — the setup scripts exist precisely to recreate them, or the agent will hit missing-dependency errors.