Skip to content
learnthevibe

modul 4scaling yourself

worktrees and parallel sessions

Two sessions in one checkout share every file, and one edit corrupts the other's view. A worktree gives each session its own directory and branch, on the same repo.

~2 min read · ~10 min with the exercise · v1.0 · verified: 2026-07-15

the luck this course ran on

Module 2's subagent lesson told a story: two sessions wrote this curriculum in parallel, in the same checkout, and the merge went cleanly because they touched different files. That clean merge was discipline plus luck. Both sessions saw the same working directory, so one unplanned edit to a shared file would have corrupted the other's view of the world mid-task.

A worktree (a separate working directory with its own files and branch, sharing the same git repository history) removes the luck. The docs put the guarantee plainly: running each session in its own worktree "means edits in one session never touch files in another". Same repository, same history, physically separate directories.

⌘K

search lessons and terms…