Notes on worktrees and parallel agents
Practical guides for developers who run several AI coding agents at once: how git worktrees work, how to keep them tidy, and how to tell what’s already in main.
Worktrees in Codex, Cursor and Claude Code compared
How Codex, Cursor and Claude Code each use git worktrees for parallel agents: where the worktrees live, branches vs detached HEAD, setup for .env and dependencies, and cleanup.
How to run Claude Code, Codex and other AI agents in parallel
A workflow for running several AI coding agents at once with git worktrees: one branch per agent, setup, knowing which agent is waiting on you, and landing the results.
How to remove a git worktree (and fix the errors)
Remove a git worktree with git worktree remove, clean up folders you deleted by hand with prune, and fix "cannot delete branch used by worktree", locked and "contains modified" errors.
How to clean up git worktrees without losing work
A checklist for deleting old git worktrees safely: the six kinds of work that hide in them, why git branch --merged misses squash merges, and how to check each one.
Git worktree vs branch: what's the difference and when to use each
A branch is a line of commits; a worktree is a folder where a branch is checked out. When to switch branches, when to add a worktree, and how stash and clone compare.
Git worktree explained: a practical guide for running AI agents in parallel
What git worktree is, the five commands you actually need, and the gotchas that bite when several AI coding agents each work in their own checkout.
Git worktree cheat sheet: every command with examples
All the git worktree commands in one place with copy-paste examples: add a new or existing branch, list, switch, lock, move, remove, prune and repair.
Claude Code worktrees: run parallel sessions with claude --worktree
How to use claude --worktree to run several Claude Code sessions side by side: where worktrees go, copying .env with .worktreeinclude, cleanup, subagents, and the gotchas.