TECHNOLOGY

bb parallel coding: when each writer needs its own worktree

In this article
THE QUICK TAKE

Separate bb worktrees isolate writers’ file state; a branch-and-runtime map and a combined interface test complete the coordination story.

Parallel conversations can still collide when they edit the same files. Separate Git worktrees give bb writers different working directories and branches, allowing independent changes to develop before they are integrated. The separation moves the coordination problem toward interfaces and merging rather than making it disappear.

Partition the task by responsibility

Imagine one writer updating an input parser and another updating a settings panel. The assignments can identify the expected interface between them and the files each worker primarily owns. This is more useful than simply asking both to improve the application. The bb guide distinguishes shared review from independent writers and recommends separate worktrees when both need to edit. A task partition becomes effective when each writer can make progress without relying on the other’s uncommitted changes appearing in its own directory.

Understand what a worktree separates

Git worktrees associate multiple working directories with one repository. Each directory provides its own checked-out file state and index, while repository relationships remain shared. This supports independent branches without pretending the projects have no common history. For the parser example, an uncommitted fix in one worktree is not automatically present in the panel writer’s files. That absence is an expected property of the arrangement, not evidence that bb lost a message or that the second model ignored an instruction.

Keep runtime resources separate as well

Independent files do not guarantee independent dev-server ports, database fixtures or external services. The bb dev-server guide assigns per-worktree setup and ports for this reason. A hypothetical panel writer can otherwise test against the parser writer’s running application by accidentally opening the same address. An environment record should therefore connect branch, path and service address. This describes an observable development setup, not a claim that bb automatically isolates every process and data service used by an application.

Integrate with a shared acceptance step

When both branches are ready, inspect how their commits combine and test the interface they agreed to preserve. A clean textual merge is useful but cannot establish that the panel sends the input the new parser expects. A concrete fixture can exercise that interaction after integration. The final report should identify the integrated revision and observed result. Parallelism then has a clear output: independently produced changes that were assembled and checked together, rather than several successful worker messages with no verified combined artifact.

Primary sources

Related engineering context: Choosing an AI development stack; Git state and undo.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles