Worktrees and isolationEvery card that writes code gets its own git worktree, so several agents can work in one repository at once without stepping on each other or on you.Where they liveWorktrees are created under the workspace config folder, never inside your repository: ~/.grid/<workspace>/worktrees/<card-id>/<repo>. Your checkout stays on whatever branch you had open, and git status in your own tree stays clean.Which base does a card branch from?This is the question that makes worktrees painful elsewhere, so Prepare answers it explicitly and writes the answer on the card.CASEBASENormal cardThe project default branch, freshly fetched.Follow-up to an open cardThe parent card’s worktree branch, so the follow-up sees work that has not landed yet. The card records the dependency and the board shows it as blocked by that card.Follow-up to a closed cardThe default branch again, because the work is already merged.Explicit baseYou can pin any branch in the card before approving the plan.
Can it be tested in isolation?A worktree that cannot run is a worktree that cannot be reviewed. Prepare therefore decides, and states, whether the card is isolatable: whether make <repo> start and test work in a fresh tree, and what they need. Dependencies are resolved per worktree (the repo's own install command), and services that cannot be duplicated, a shared database for instance, are declared so Review knows to run against the shared instance instead of pretending.·Isolatable: Review starts the app locally and gives you a port. This is the normal case.·Partly isolatable: runs, but against shared services. Review says so on the card.·Not isolatable: Review skips the local run and leans on diff review and the test suite. Prepare must say why.CleanupClose removes the worktree and prunes the branch if it was merged. Cards that are rejected and closed have their worktree removed too, so nothing accumulates silently. grid worktree ls lists what exists with its card and disk size, and grid worktree gc removes orphans.ALPHAWorktrees are local. They are never synced, never uploaded, and are excluded from card sync entirely.