Docs · Topic
Git worktrees
On hosts running herdr, New Agent Task spins up an isolated git worktree on a new branch and starts an agent inside it—keeping your main checkout clean so several agents can work on the same repository in parallel.
Start an agent on a new worktree
Section titled “Start an agent on a new worktree”- On Home (under a herdr host card) or in the Workspaces sheet, tap New Agent Task.
- Under TASK, tap Repo and choose one of the git repositories Moshpit found in your open panes or under
~. To enter a path outside those, pick Other… and type the Repository path (for example/home/dev/project). - Type a Branch name. Moshpit checks git’s branch-naming rules as you type (no spaces,
.., or~ ^ : ? * [ \). - Tap Agent and pick which coding agent to launch (such as
claudeorcodex). - Optionally enter a Prompt under FIRST MESSAGE. Moshpit sends it to the agent as soon as it starts; leave it blank if you want to type at the prompt yourself.
- Tap Start.
herdr checks out the new branch under ~/.herdr/worktrees, opens a dedicated workspace pane for it, and hands you the live terminal.
Remove a worktree when done
Section titled “Remove a worktree when done”When the branch is merged or no longer needed, use Remove Worktree from the workspace’s menu. That deletes only the branch checkout under ~/.herdr/worktrees and leaves your main repository untouched. If the worktree holds uncommitted or unmerged changes that exist nowhere else, Moshpit warns you before removing them.