# git worktrees

The mechanics of git worktrees, and why they became load-bearing for agent work.

[Jul 31, 2026 **Git: Cannot Delete Branch Used by a Worktree** \  
Git refuses to delete a branch a worktree has checked out, even with -D. Find the worktree with git worktree list, remove it, then delete the branch clean.](/content/blog/git-cannot-delete-branch-used-by-worktree/index.html)  
[Jul 31, 2026 **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 examples and errors.](/content/blog/git-worktree-add/index.html)  
[Jul 31, 2026 **Git Worktree vs Branch (vs Multiple Clones)** \  
A branch moves one working copy. A worktree adds a second, on the same history. A clone is a separate repo entirely. The commands, and when to use each.](/content/blog/git-worktree-vs-branch/index.html)  
[Jul 31, 2026 **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 worktrees from sprawling.](/content/blog/git-worktree-workflow/index.html)  
[Jul 31, 2026 **Git Worktrees in Cursor, Zed, and IntelliJ** \  
Yes. IntelliJ's Worktrees tab in the Git tool window handles them natively. Where to find it, plus how Cursor and Zed handle worktrees instead.](/content/blog/git-worktrees-in-your-editor/index.html)  
[Jul 31, 2026 **How to Remove a Git Worktree** \  
git worktree remove deletes a directory and its metadata in one step. git worktree prune cleans up what you deleted by hand. Neither touches the branch.](/content/blog/remove-git-worktree/index.html)  
[Jun 19, 2026 **How to Use Git Worktrees with Claude Code** \  
Claude Code worktree commands explained: the --worktree flag, what it does, real parallel-agent workflows, the gotchas, and how to automate it.](/content/blog/git-worktrees-claude-code/index.html)  
[Mar 17, 2026 **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.](/content/blog/agents-overwriting-files/index.html)  
[Mar 14, 2026 **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.](/content/blog/two-agents-same-repo/index.html)
