Lesson 05 · Loop Engineering

Worktrees, and the tax you still pay

Isolation removes the collision. It does not remove you.

The moment you run more than one agent, the files start to collide. Osmani's comparison is exact: two agents writing the same file is the same headache as two engineers committing to the same lines with nobody talking to each other.

A git worktree is a separate working directory on its own branch, sharing the same repo history. So one agent's edits literally cannot touch the other one's checkout.

# one checkout per piece of work
git worktree add ../repo-auth-fix -b fix/auth-timeout
git worktree add ../repo-flaky   -b fix/flaky-session

# and when the work lands
git worktree remove ../repo-auth-fix

Claude Code gives you three routes to the same isolation: plain git worktree, a --worktree flag to open a session in its own checkout, and isolation: worktree on a sub-agent, so each helper gets a fresh checkout that cleans itself up afterwards. The Codex app builds worktree support straight in, one per thread.

The part that is not solved

Here is the lesson inside the lesson. Osmani wrote a whole post called the orchestration tax, and he summarises it in one line:

The worktrees take away the mechanical collision but YOU are still the ceiling, your review bandwith decides how many you can actually run, not the tool. Addy Osmani, Loop Engineering

So the right question is never "how many agents can I launch". It is how many diffs can I genuinely read today. Set your parallelism to that number.

A practical starting number Two. Run two worktrees for a week and measure whether you actually reviewed both. Raise it only when the answer is yes.

Check yourself

What does a git worktree give two parallel agents?

What actually caps how many agents you should run in parallel?

How many agent-produced diffs did you truly read last week? Write the number, then your parallelism limit.

If those two numbers differ, the second one is wrong. Osmani's point is that the tool will happily let you exceed yourself.

Read the source

Primary source: The orchestration tax by Addy Osmani. It is the human half of this lesson and the more important half.

Ask me. I can set up two worktrees on your repo now and run a sub-agent in each, so you can feel the review load before you commit to it.