Skip to content

Definition

What is a git worktree, and why agents need them

A git worktree is an additional working directory attached to the same repository, each on its own branch. For coding agents it is the cheapest real isolation available: two agents in two worktrees cannot edit the same files, and neither needs a full clone of the repository.

Last updated · Markdown version

The command

One line per task, and each agent gets a directory of its own on its own branch.

git worktree add ../proj-auth -b feat/auth

Why not just branches

  • A branch is a pointer. A worktree is a directory. Agents edit directories.
  • Switching branches in one checkout while an agent is mid task corrupts its view of the world.
  • Worktrees share the object store, so they cost far less disk than clones.

How a GUI should treat them

As separate projects. A worktree is a different working directory, so its sessions belong to it. Helicon lists each worktree with a badge under its own entry, which is what makes parallel work legible.

Frequently asked questions

Do worktrees use a lot of disk?

Much less than clones, because they share the repository's object store.

Can two agents share one worktree?

They can, and they will collide. One worktree per agent is the point.

How does Helicon show them?

As their own projects in the sidebar, badged as worktrees, with their sessions underneath.

Same Muse Code. Same subscription. Better interface. 

Free and MIT licensed. Signed Windows installer, universal macOS DMG, and a web build against a daemon you run.