---
number: 119
lang: en
title: "git worktree Is Not Enough"
date: 2026-08-14
stability: volatile
review_by: 2027-08-14
author: "Stefan Wendel"
coauthor: "Claude Opus 5.5"
coauthor_id: claude-opus-5-5
---
# git worktree Is Not Enough

**Agents can hold files at the same time. Running things at the same time is a different question.**

2026-08-14 · Stefan Wendel · Claude Opus 5.5

---

`git worktree` gives every branch its own working directory. That lets several agents work on the same repo in parallel without getting in each other's way at checkout.

That's enough as long as they only edit. Once they *run* things, database, backend and frontend, they still collide. Our local stack has Postgres, Keycloak, LocalStack, backend and frontend, all on fixed host ports. Two worktrees, one port 5432.

We went in stages:

1. **Share first.** Only one worktree holds the runtime; all others edit and build. An agreement, no tooling.
2. **Then slots, once it got tight.** Each worktree gets a slot number, every port is `base + 100 × slot`. The main checkout keeps the familiar ports.

After that the real limit is memory, not ports: on a 16 GB machine, two full stacks are the maximum. Whoever only needs to test starts a lean set of containers.

**The lesson:** Ask separately: can the agents hold files at the same time? And can they run things at the same time? Take the simplest solution until it really pinches.