git worktrees
The mechanics of git worktrees, and why they became load-bearing for agent work.
Git: Cannot Delete Branch Used by a Worktree
Git refuses to delete a branch that a worktree has checked out, even with -D. Find the worktree with git worktree list, then remove it or prune it, then delete the branch.
git worktree add: Every Form of the Command
git worktree add with a new branch, an existing branch, a remote branch, a commit, or a detached HEAD. Every flag that matters, with real examples and the errors you'll hit.
Git Worktree vs Branch (vs Multiple Clones)
A branch switches one working copy in place. A worktree gives you a second working copy on the same history. A clone gives you a whole separate repo. When to reach for each.
A Git Worktree Workflow That Stays Tidy
Where to put worktrees, how to name them, what to do about node_modules and .env, and when to remove them. The habits that keep a worktree workflow from turning into folder sprawl.
Git Worktrees in Cursor, Zed, and IntelliJ
How each editor handles git worktrees: Cursor's agent worktrees, Zed's worktree picker, IntelliJ's Worktrees tab, and the one thing that works everywhere.
How to Remove a Git Worktree
git worktree remove deletes the directory and its metadata. git worktree prune cleans up after directories you deleted by hand. Neither one deletes the branch. Here's the full cleanup.
How to Use Git Worktrees with Claude Code
Claude Code worktrees explained: the --worktree flag, the exact git commands, real parallel-agent workflows, the gotchas nobody warns you about, and how to automate the whole thing.
Why Your Claude Code Agents Keep Overwriting Each Other's Files
Running multiple Claude Code agents on the same repo? Why they conflict and how to fix it with isolated worktrees.
How to Run Two Claude Code Agents on the Same Repo Without Destroying Your Git History
Multitasking with two Claude Code agents on the same branch causes merge conflicts. The fix is git worktrees, and you can automate it.