All guides

Working with worktrees

A git worktree is a second checkout of the same repository, on its own branch, in its own folder. With worktrees, two agents can work on two topics at the same time without changing each other’s files.

SimpleEdit is built for this layout. This guide shows how to set it up and how to move between worktrees.

The layout

SimpleEdit works with a plain clone or a bare repository, and gives every topic its own worktree. With a bare repository the layout looks like this:

myproject/
  myproject.git/        ← bare repository
  main/                 ← main worktree
  late-fees/            ← one agent works here
  export/               ← another agent, another branch

To get this layout, select Checkout Repository… on the welcome screen and enter the repository URL. SimpleEdit clones it as a bare repository with a main worktree. New worktrees go next to them, in a folder named after the branch. You can also open an existing bare repository with Open Repository….

If you already have a normal clone of the project, open it with Open Repository… too. The clone stays your main checkout, and the worktrees SimpleEdit creates go to ~/.simpleedit/worktrees/, outside the repository. See Getting started.

One worktree per topic

Use one worktree for each topic. Keep a whole stack of PRs for one topic in the same worktree.

Create and switch worktrees

The workspace header of each session has a worktree picker. It shows the worktree the workspace is viewing, for example late-fees (feat/late-fees).

  1. Select the worktree picker.
  2. Select a worktree in the list to view it.
  3. To make a worktree for a new branch, select Create new branch, type the name in the branch-name field and confirm.
  4. To make a worktree for a branch that already exists, select Check out existing branch, find it with Filter branches… and select it.
  5. To delete a worktree, select Remove worktree next to it.

A new worktree opens in the session right away.

Each session has its own view: switching the worktree in one session does not change the others.

Let the agent move you

Agent sessions start in the project folder, next to the bare repository (in a plain clone, in the main checkout). This way all sessions of a project share one Claude memory (see Claude memory).

When the agent changes into a worktree, the workspace follows it: the file tree and the git log switch to that worktree. If you have the viewer open, your view stays where it is.

You can also ask the agent directly:

Work across repositories

The repository picker next to the worktree picker lists every repository this agent has worked in. That includes a sibling repository where the agent only read or changed a file. Select one to view it. Looking into another repository never moves your view on its own.

Review a worktree’s branch

To review what an agent did on its branch, ask it: “Ask me to review this branch.” The review opens in the Review Room as a tab in that session. See Reviewing plans with SimpleEdit for how a branch review works.