Skip to main content

Worktrees Overview

The full-bleed Worktrees Overview modal: multi-select, keyboard navigation, and bulk close-session and remove-worktree actions across every worktree in a project.

Updated
Reviewed

Worktrees Overview

The Worktrees Overview is a full-bleed modal that shows every worktree in the project as a grid of cells, with multi-select and bulk actions. It's built for triage: pick the set you want to act on, run one action across all of them, then close the modal.

Opening the Overview

  • Action palette: search for "Worktrees Overview".
  • Primary worktree card: three-dot menu → Overview.

The modal sizes itself to the viewport and blurs the rest of the app behind it. The grid is virtualized like the sidebar, so the modal stays smooth on projects with many worktrees.

Selecting Worktrees

Selection happens in the grid itself. The grid is the single tab stop, and cells track activation through aria-activedescendant.

GestureAction
Plain clickSwitch to that worktree (closes the modal).
Shift+clickRange-select from the anchor to the clicked cell.
Ctrl/Cmd+clickToggle just that cell (sets the anchor for the next range).
SpaceToggle the focused cell.
Cmd+ASelect every visible worktree (respects active filters).
EscClear selection if any; otherwise close the modal.

Selected cells get a subtle background fill and a neutral inset ring. Accent green is reserved for fleet arming and is never used as a multi-select indicator here. Selection state lives on the modal, so it resets when you close it. The anchor survives filter changes, so narrowing and re-widening the filter still resumes Shift-click extension from your last anchor, and the anchor resets on window blur.

Keyboard Navigation

Inside the grid, arrow keys move cell to cell. When the grid is grouped by type, navigation is section-aware: / moves within the current group, and / crosses into the next or previous group. Enter switches to the focused worktree and closes the modal; Space toggles selection without switching.

The modal carries a footer that echoes the bindings in plain text: "↑↓←→ navigate · Enter switch · Space select · Esc clear selection". The last entry changes to "Esc close" when nothing is selected, since Esc closes the modal in that case.

Close Sessions (D1)

The Close sessions header button, visible once at least one cell is selected, is a D1 destructive action: a single confirm dialog with no typed-name gate. The dialog title reads "Close sessions for N worktree(s)?" and the description spells out the consequence:

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

The worktree directories and branches stay on disk. 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 the action.

Remove Worktrees (D3)

The Remove worktrees header button, also visible when cells are selected, is a D3 destructive action: a type-to-confirm dialog. The body lists every target with its branch name, plus warning rows for dirty or unpushed worktrees, and the footer reads:

This is irreversible. Type the count to confirm.

You type the selection count into the confirm field, or the branch name for a single-target remove, and only then does the confirm button enable. Each deletion follows the same pipeline as a single worktree delete, including the close-terminals and delete-branch toggles.

If your selection includes the main worktree, the description tells you how many targets were skipped. The main worktree is excluded from bulk remove, the same as it's excluded from single delete.

Hiding the Main Worktree and the Working/Waiting Stats

The overview header has a small Hide main toggle (role="switch") that drops the primary worktree from the grid. While the toggle is on, the word "main" appears in the header with a strikethrough as a visual confirmation. Hiding main is useful when you want to act on every secondary worktree at once without protecting the primary by hand.

Next to the toggle, the header carries two clickable stat counters:

  • N working: a green dot, with an animated pulse when motion isn't reduced, followed by the count. Clicking sets the quick state filter to working; clicking again resets to all.
  • N waiting: an amber dot followed by the count. Same toggle behavior for waiting.

Those two stat pills are the only clickable counters here. There's no clickable finished count and no clickable total, since neither is an action surface.

Tip
Click N waiting to filter, Cmd+A to select all visible, then Close sessions. Three actions close every waiting session in the project.