Skip to content

Unfinished work and pruning

Terminal window
shirei worktrees unfinished

Shirei reports tracked, live worktrees that are:

  • Dirty.
  • Not merged into a locally known remote default branch.
  • Merge-unknown or detached.
  • Missing from disk.
  • Uninspectable because Git returned an error.

For named branches, it asks gh and glab about reviews across configured remotes:

Review stateResult
Open or merged PR/MROmit the worktree candidate
Closed without mergeKeep the candidate
Review predates local commitsKeep with review=stale
Forge cannot verify the remoteKeep with review=unknown

The command is conservative: uncertainty stays visible. Run shirei worktrees scan first to include worktrees created outside Shirei.

Terminal window
shirei worktrees prune
  1. Select 1 or more worktrees with Tab in fzf.
  2. Press Enter and review every printed path.
  3. Type delete exactly to confirm.

For each confirmed selection, Shirei attempts to remove:

  • The worktree directory.
  • Git worktree metadata.
  • The associated local branch, even when dirty or unmerged.
  • Its Shirei worktree entry.
  • Its Shirei recent-directory entry.

Remote branches are never deleted. The primary worktree is always refused. If branch deletion fails after directory removal, Shirei retains a retryable state entry.

shirei kill closes live backend sessions and processes but leaves directories alone. shirei worktrees prune deletes worktrees and local branches but is not a session-management command. Use the command matching the resource you intend to remove.