Parallel Work Without the Mess: Git Worktrees and Agent Sessions
short summmarty
Nobody actually works in a straight line. A normal day looks more like this: a feature in progress, an urgent bug that jumps the queue, a branch someone asked me to review, a quick experiment I want to try, and a half-finished debugging session I still haven't cleaned up.
The classic Git workflow gives me exactly one place to do all of that — one working folder, one branch checked out, one running dev server, one set of loaded editor context. So for a long time I reached for the usual workarounds:
web-app/
web-app-copy/
web-app-copy-final/
web-app-temp-agent/
Or the stash dance: git stash, switch branch, do the urgent thing, switch back, git stash pop. These work, but they don't scale. Copied folders turn into chaos, stashes hide work, and switching branches quietly destroys the context I had loaded.
The real problem was never branching. It was this: how do I work on several things at once without wrecking my main workspace?
Git worktrees: structured parallelism
Git already has the answer, and it's older than most of the tooling built on top of it. A worktree lets a single repository check out multiple branches into multiple linked folders at the same time.
git worktree add ../web-app-tests feature/PROJ-142-tests
Now each concern gets its own folder, on its own branch, sharing one underlying repository:
$ git worktree list
web-app/ main
../web-app-nav-header/ feature/PROJ-142-nav-header
../web-app-dashboard-tabs/ feature/PROJ-142-dashboard-tabs
../web-app-tests/ feature/PROJ-142-tests
That gives a clean, repeatable shape: one task → one branch → one folder → one diff → one review.
Compared to the alternatives, worktrees are the only option that's actually Git-native. Copying a folder gives me separate files and unmanaged chaos. Cloning again is heavy and duplicated. Stashing is just a serial context switch wearing a disguise. A worktree gives me a real, isolated branch folder without ever leaving the repo.
The shift: agents change the shape of work
Worktrees mattered before, but they matter more now, because coding is becoming less linear in a second way. It's no longer just me moving from one task to the next. It's me in my main workspace while several agent sessions run in parallel — one on a feature, one on tests, one on a refactor I'm not yet sure about.
Watch — Introducing the VS Code Agents Window (Preview) is a five-minute walkthrough from the VS Code team of exactly this agent-first, sessions-based workflow.
Modern coding agents are all converging on the same architecture, and it's the one worktrees already gave us: one task, one branch, one isolated workspace, one reviewable diff. The division of labour is the part that matters:
- I design the work — architect, reviewer, integrator.
- Agents are parallel implementation workers.
- Worktrees are the isolation layer that keeps the lanes from bleeding into each other.
One agent, one lane
The failure mode isn't "let AI edit the repo." It's letting an agent edit the repo without a lane. The single most useful rule I've found is: one agent, one lane, with an explicit scope.
A bad prompt has no scope, no shared rules, and no definition of done:
Improve the app.
A good prompt names the task, fences the paths it may touch, protects what has to keep working, and asks for a summary I can actually review:
You are working on the dashboard migration.
Rules:
- Only touch apps/dashboard and packages/ui.
- Do not modify the billing service.
- Keep existing routes working.
- Run typecheck before finishing.
- Summarize the diff and any risky changes.
Agents can produce a lot of output. Review is what turns that output into value — and review is only tractable when each agent stayed in its lane and I can read one focused diff.
The workflow
Put together, the operating model is simple:
- Keep the main workspace clean.
- Start one session per task.
- Use a worktree for isolation.
- Give the agent a narrow scope.
- Review the diff.
- Merge only what's useful.
- Delete the worktree when you're done.
git worktree remove ../web-app-tests
Takeaway
Humans design the lanes. Agents run in isolated lanes. Git keeps the lanes separate. Review turns output into value.
The tooling is finally catching up to how people actually work — in parallel, non-linearly, with a lot going on at once. Worktrees are the quiet primitive that makes it safe.