Unfinished work and pruning
Find potentially unfinished work
Section titled “Find potentially unfinished work”shirei worktrees unfinishedShirei 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 state | Result |
|---|---|
| Open or merged PR/MR | Omit the worktree candidate |
| Closed without merge | Keep the candidate |
| Review predates local commits | Keep with review=stale |
| Forge cannot verify the remote | Keep with review=unknown |
The command is conservative: uncertainty stays visible. Run shirei worktrees scan first to include worktrees created outside Shirei.
Prune selected worktrees
Section titled “Prune selected worktrees”shirei worktrees prune- Select 1 or more worktrees with Tab in
fzf. - Press Enter and review every printed path.
- Type
deleteexactly 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.
Sessions are separate
Section titled “Sessions are separate”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.