/worktree — Task Isolation via Worktrees
Guidance for when and how to use Cursor's worktree isolation feature.
When to use
- Risky refactors that may break the working tree
- Parallel implementations of independent features
- Experimental spikes you want to discard cleanly
- Long-running tasks that shouldn't block the main branch
How it works
/worktreecreates an isolated git worktree with its own branch- Work proceeds independently — no conflicts with main
- When done, merge or cherry-pick back, then clean up the worktree
Best practices
- Name worktrees descriptively:
feat/short-descriptionorfix/issue-ref - Keep worktree lifespan short — merge or discard within a session
- Use
--worktreeflag withcursor agentfor headless runs