AI Agents Need Their Own Desk, and Git Worktrees Give Them One
About this article
Git worktrees, parallel agentic coding sessions, and the setup tax you should be aware of
Agentic AI AI Agents Need Their Own Desk, and Git Worktrees Give Them One Git worktrees, parallel agentic coding sessions, and the setup tax you should be aware of Ruben Broekx Apr 18, 2026 20 min read Share One repo, many desks. A worktree is a second window onto the same project, locked to its own branch, so you and your Agent can work side by side without stepping on each other. You just kicked off Claude on a refactor. You know it’s going to take a while, and you know exactly what comes next. Either you sit there and watch the stream scroll, doomscroll a bit while waiting, half afraid that touching anything will corrupt the run. Twenty minutes of your day, gone, because you’re scared of your own workflow. Or you start poking at small things while you wait. A typo in a docstring, a stray import, a README line that’s been bugging you. Then the Agent finishes, looks at the diff, and starts talking to itself: “I don’t remember adding this, let me clean it up”. You watch it calmly revert your work because it doesn’t fit the scope it was given. Both options are the same bug with different symptoms. You and the Agent are sharing one working directory, and a working directory can only hold one train of thought at a time. The fix is not a better prompt or a tighter scope. It is a second working directory. That is what Git worktrees give you, and this post covers what they are, how they work, the setup cost nobody warns you about, and a small Claude Code toolkit I put together t...