At the end of the last lesson, you had a reviewed proposal for issue #1 in your agent’s conversation and a clean main checkout. Issue #3, which adds the location where each item was found to the search results, touches a different file, so there’s no reason to wait for one fix before starting the other.
In this lesson, you’ll run two agent sessions at the same time, one per issue, each in its own folder and on its own branch. You’ll write each task so the sessions are unlikely to get in each other’s way, and you’ll be able to choose between a subagent, a parallel session, and your current session for a piece of work.
Give Each Session Its Own Folder
Two sessions need two places to work, because one folder is shared state. Watch out: even on different features, sessions in one folder see each other’s half-finished edits, lockfile changes, and test data, and git add -A stages the other session’s work too.
So each session needs its own copy of the files and its own line of commits. A branch is a line of commits that grows apart from main until you merge it back. A worktree is a second working folder of the same repository, usually checked out on its own branch. All worktrees share one repository, so a commit made in one is visible from the others at once, with no push or fetch between them.
A second clone would also give you a separate folder, but it’s a separate repository, and its commits would have to travel back by push and fetch. Stashing keeps one folder and swaps changes in and out, so it can’t let two sessions work at the same time.
From your lost-property folder on main, create one worktree per issue. The -b option creates the new branch as Git makes the folder:
$ git worktree add ../lost-property-issue-1 -b issue-1-search
$ git worktree add ../lost-property-issue-3 -b issue-3-found-where
Both folders sit next to lost-property, and both branches start from the same clean commit. To see every worktree with its branch, run git worktree list from any of them:
$ git worktree list
/home/you/festival/lost-property f3fbf88 [main]
/home/you/festival/lost-property-issue-1 f3fbf88 [issue-1-search]
/home/you/festival/lost-property-issue-3 f3fbf88 [issue-3-found-where]
Your paths and commit IDs will differ, but you should see three folders on three branches at one commit. The new folders hold only tracked files, so they have no node_modules/ yet.
Give each worktree its own terminal for the rest of the lesson. In a second terminal, go to the issue #1 folder, using your path from git worktree list, and install: