| English | 中文 |
git worktree is suitable for isolating multiple AI tasks into different directories, reducing cross-contamination of workspaces.
git worktree add ../project-task-a -b ai/task-a
git worktree add ../project-task-b -b ai/task-b
git worktree list
git worktree remove ../project-task-a
.env, keys, or production configurations to AI worktrees by default..gitignore.Claude Code officially supports creating isolated sessions via --worktree:
claude --worktree feature-auth
claude --worktree bugfix-payment-timeout
These types of automatic worktrees are suitable for parallel exploration, but you should still return to the Git perspective to check before merging:
git worktree list
git status
git diff --stat