When you set isolation: "worktree" in a Task call, Claude Code creates a temporary git worktree in .claude/worktrees/. The agent works on its own branch, leaving your main working tree untouched. If it makes no changes, the worktree cleans up automatically. If it does, you get the worktree path and branch name to review and merge.
You can also open your own session in an isolated worktree with claude -w <name>. Boris Cherny, who built Claude Code, mentioned running terminal sessions this way: each on a separate branch, each working a different task. I use the same pattern when I have several independent pieces to parallelize. Without worktrees, parallel sessions write to the same files and conflict.