Skip to main content

Worktrees Overview

Inspect worktrees and their sessions in one overview, search and filter them, select a set, close sessions or delete worktrees with a preview of what each action touches.

Updated
Reviewed

Worktrees Overview

The Worktrees Overview is a keyboard-first list of every worktree in the project, one row each, with the columns the sidebar has no room for. It doubles as a quick switcher: type to narrow, press Enter, and you are in that worktree. It is also where you triage in bulk: select a set, run one action across all of them, close the dialog.

Select several worktrees to act on their sessions or directories

It is a git-backed-project surface. A workspace with no repository has one place agents run and no overview to open. See Worktrees need a repository.

Once you have added a remote host, the overview also has an All hosts disclosure. Expanding it asks the other connected machines for the worktrees of their open projects and lists each one's branch, project and, when there are any, changed-file count; machines that aren't connected say Not connected. Click a worktree to switch to that host and project. See Every Host's Worktrees.

Opening it

  • Option-Command-R Control-Alt-R Control-Alt-R toggles it.
  • Action palette: Toggle worktree overview, or Open worktree overview to open without toggling.
  • Sidebar header: the Open worktrees overview button, which appears when you hover or focus the header.
  • The sidebar's filtered-empty states offer an Open overview button, since a filter that hides everything is exactly when you want the wider view.

The search field has focus when it opens. Press Enter there to switch to the top result, or ↓ to move into the list.

Reading a Row

Four columns, named once above the list:

  • Worktree: the card's own identity. The branch-type icon and the title (the linked issue's title when there is one, otherwise the branch), a Current badge on the worktree you are in, and the lifecycle status mark from the card. A second line carries the branch under an issue title and the pull request number with its CI state. Anything wrong is spelled out beside the title in red: N conflicts, Setup failed, Command failed or CI failed.
  • Sessions: up to three sessions listed in full, each with its icon, its state and what it is on; click one to go straight to that terminal. Past three, the cell becomes the sidebar's N active strip with its state counts, which expands in place.
  • Changes: the diff stat and file count, or Clean, then how far the branch is ahead of and behind its upstream.
  • Active: an activity light and how long ago the worktree last changed.

Right-click a row, or press Shift-F10 Shift-F10 Shift-F10 on the highlighted one, for its menu: every session in full (each opens its terminal), Open in editor, reveal in your file manager, Open review hub, Open pull request and Open issue when they exist, and Copy context.

Finding Worktrees

The overview uses the sidebar's own search field, filter popover and quick state filter, with labels on the quick state segments since there is room for them. They are the same filters, not a copy: narrowing the overview narrows the sidebar too, and the sort order, grouping and pins carry over. Grouped by type, the list gets section headers with per-section counts, plus an Outside the project section when external worktrees exist.

The header carries the count, and shows both numbers while filtered: 7 of 24.

Two empty states matter: no worktrees at all offers a Create worktree button; filters that match nothing say No worktrees match these filters and offer Clear all filters.

Selecting Worktrees

The list is a single tab stop that tracks the highlighted row through aria-activedescendant.

GestureAction
Plain clickSwitch to that worktree and close the overview.
Shift+clickRange-select from the anchor to the clicked row.
Command Control Control +click, or the row's checkboxToggle just that row, and set the anchor for the next range. The checkbox replaces the branch icon on hover and while anything is selected.
SpaceToggle the highlighted row without switching.
Command-A Control-A Control-A Select every visible worktree, respecting active filters.
EnterSwitch to the highlighted worktree and close.
EscClear the selection if there is one; otherwise close the overview.

↑ and ↓ move the highlight, including across group headers; Home and End jump to the first and last row, and PgUp and PgDn move a page. Shift with any of them extends the selection. F2 moves into the highlighted row's session controls, and Esc returns to the list. Typing, pressing /, or pressing ↑ on the top row returns to the search field, keeping what you typed; Tab moves past the list. The footer spells out the main bindings.

Selected rows get a subtle background fill. Accent green is reserved for fleet arming and is never a multi-select indicator here.

Selection lives on the dialog and resets when it closes. The anchor survives filter changes, so narrowing and re-widening a filter resumes Shift-click extension from where you were; it resets on window blur. Narrowing the filter drops the now-hidden rows from the selection, so the search field stays usable for refining the target set mid-selection.

With anything selected, the footer becomes the action bar: N selected with a Clear button on the left, and Close sessions and Delete worktrees on the right.

Close Sessions (D1)

Close sessions is a D1 destructive action: one confirm dialog, no typed-name gate. The title reads "Close sessions for N worktrees?" and the description spells out the cost:

Every grid and dock session for the selected worktrees will end. Scrollback is lost for each terminal.

The worktree directories and branches stay. Only the sessions end. The selected set is snapshotted at click time, so a stray click between opening the dialog and confirming can't retarget it.

Tip
Click the Attention segment of the quick state filter, press Command-A Control-A Control-A to select what's visible, then Close sessions. Three actions end every waiting session in the project.

Delete Worktrees (D3)

Delete worktrees is a D3 destructive action: a type-to-confirm dialog. Before it can be confirmed, Daintree reads a fresh delete preview for every selected worktree, the same check a single delete makes, and sorts the batch by outcome:

  • Will be deleted: each worktree that can go, with what deleting it discards (its uncommitted and untracked files, files inside its submodules) and any teardown it will run first.
  • Checking: worktrees whose preview hasn't come back yet.
  • Excluded: worktrees that won't be deleted, each with the reason: Already deleted, Couldn't read this worktree's changes, Holds submodule commits this clone can't find on a remote, or The submodule check didn't finish. A selected main worktree appears here too, as The main worktree; only linked worktrees can be deleted from the overview. A Retry re-runs the checks that failed.

The title counts what will actually be deleted (Delete 3 worktrees?, or the worktree's name when it is one), and a line above the list says how many will be deleted and how many are excluded. The description is the consequence:

Each worktree directory is deleted from disk. Uncommitted and untracked files are discarded, including files inside submodules, and a running dev server is stopped first. Branches are kept.

You confirm by typing the count, not a branch name: 3 worktrees for three targets, 1 worktree for one. The Delete 3 worktrees button stays unavailable until it matches. When the batch discards work, the input is introduced with a sentence saying so. Just before the deletes run, the batch is read again (Checking current work before deleting), so a worktree an agent dirtied while the dialog sat open is not deleted on the strength of an old preview.

Deletes run four at a time. Each follows the same pipeline as a single delete, including stopping a dev server before git worktree remove: on Windows the dev server's directory lock would otherwise block the removal outright. The dev-server check and stop each get 30 seconds; a target that runs out of time fails without being deleted rather than freezing the batch. A worktree nested inside another selected worktree is deleted first, and the outer one is kept if that fails. Bulk delete is always a force delete and never deletes branches.

Warning
There is no undo. Read the target list and what each row discards before you type the count.

What Happens Afterwards

A bulk delete reports once, not once per worktree: Deleted 3 worktrees (with the dev servers it stopped), Deleted 2 of 3 worktrees with the first failure, or Couldn't delete worktrees. A bulk triage pass doesn't bury the notification center in near-identical entries.

Bulk delete closes nothing in advance, so any worktree that still had terminals leaves a deleted-worktree card in the sidebar: the terminals keep running and can be dragged onto a live worktree during the countdown. Bulk triage is exactly the case that hits this, so it is worth knowing the sessions are recoverable for a minute rather than gone. Once two or more pile up they collapse into a single group row with one bulk clear. To end the sessions too, run Close sessions on the same selection first.

A request that is still running in the host when the dialog gives up is not undone. Daintree tracks its completion; dismissing an error is not an undo of a deletion already underway.