Skip to main content
Dispatcher

Documentation

Git worktrees

How Dispatcher uses isolated git worktrees so parallel agents do not collide.

Canonical HTML: https://getdispatcher.dev/help/worktrees

Why worktrees

When several coding agents edit the same checkout, they overwrite each other. Dispatcher gives each executed task its own git worktree and branch so parallel work stays isolated.

A worktree is a second working directory attached to the same repository: shared git history and remotes, separate files and branch checkout on disk.

What Dispatcher does

When you execute a task, Dispatcher typically:

  1. Creates a dedicated branch (for example dispatcher/task-fix-oauth)
  2. Creates a git worktree checked out to that branch
  3. Launches the selected agent inside that worktree
  4. Keeps the terminal, diff, and review flow attached to the task
  5. Recovers worktrees on restart if they still exist on disk

Your main project checkout stays usable while agents work elsewhere.

Practical tips

  • Prefer one task → one worktree → one PR when work should move independently
  • Review diffs in Dispatcher before merging; agents can be wrong
  • Don’t check out the same branch in two worktrees (git forbids it)
  • Leave finished worktrees in place until the PR merges if you may need to continue
  • Clean abandoned worktrees with git worktree list and git worktree remove <path>, then git worktree prune

Local-first note

Repository files, diffs, terminal output, and agent transcripts stay on your machine for local desktop use. Optional cloud sync covers tasks/docs/sites you choose to sync — not your git objects.

Related

Git worktrees · Dispatcher Docs