Work in an isolated git worktree

worktrees & cloud

// what it does

-w (or --worktree [name]) runs the agent in a fresh git worktree at ~/.cursor/worktrees/<reponame>/<name> instead of editing your current checkout, keeping your working tree clean. Omit the name and Cursor generates one. These sit alongside worktrees created from the editor and follow the same cleanup retention.

// shell

$ cursor-agent -w feature-auth
$ cursor-agent -w

// gotcha

--worktree only changes where file edits land; pass --workspace <path> as well if the CLI cannot infer the repository root from your current directory.

// resources