How It Works
Managed Worktrees
Choose where an agent edits files and inspect or clean up its checkout.
A Git worktree lets an agent use its own branch and files while you keep another checkout open. Two agents assigned to the same worktree see the same files, including uncommitted edits.
Choose a destination
On the new agent page, the destination for a member can be the workspace root, a new worktree, or an existing eligible worktree. For example, create help-text for an implementer, then select that existing worktree for the reviewer.
Agents use the logical name in gg_team. An add request with worktree_name creates or reuses that name. An assign_worktree request moves an idle member to the named checkout. For a repository-specific setup step, commit a worktree init script.
Find the files on disk
Settings > Worktrees shows the branch prefix and parent directory used for new worktrees. With the defaults, a worktree named help-text has branch gg/help-text. Its path looks like this (the hash depends on your repository’s canonical path).
~/.gg/worktrees/my-repo-1234abcd/gg--help-text
The short repository name and hash distinguish checkouts even if two repositories have the same folder name. gg migrates older long paths at startup when it can move them safely. Expand the inventory row for the actual path, branch and associated agents, or select Reveal for a folder that exists.
Keep or clean up a worktree
When removing a member with gg_team, set preserve_worktrees to keep its checkout for later. If another agent still uses the checkout, that association matters for cleanup. See Settings > Worktrees for detached worktrees, missing folders and cleanup that needs attention. Disk sizes appear as the scan completes.
Expand a row to see actions available for its current state. Review the preview before confirming an action.
- Clean artifacts removes eligible generated files.
- Prune Git registration clears a stale Git worktree registration for a missing folder. Delete branch is a separate action when eligible.
- Stop managing removes gg’s tracking of an eligible missing or unrecoverable worktree and keeps any remaining files and branch.
- Delete worktree discards the checkout according to the effects shown in the preview. Use Preserve to keep a detached checkout.