prune Command
What It’s For
Section titled “What It’s For”Clean up stale Git worktree metadata when a worktree directory was deleted manually or Git’s worktree records otherwise get out of sync.
Use prune for stale metadata. Use remove when you want to delete real worktree directories and optionally delete branches.
What It Does
Section titled “What It Does”- Finds worktree records that Git marks as prunable across the main repository and configured child repositories.
- Reports stale entries without changing anything when run with
--dry-run. - Runs Git worktree pruning for affected repositories in mutating mode.
- Supports JSON output for automation and agent workflows.
arashi prune [options]Key Options
Section titled “Key Options”--dry-runreport stale worktree metadata without pruning it.--expire <time>pass a Git worktree prune expiry time. Defaults tonowso stale entries discovered by Arashi are cleaned immediately.--jsonoutput machine-readable results.
Examples
Section titled “Examples”# Preview stale worktree metadataarashi prune --dry-run
# Clean stale worktree metadata nowarashi prune
# Automation-safe cleanup reportarashi prune --jsonpruneremoves Git metadata for stale worktree records; it does not delete existing worktree directories.removeexcludes prunable entries from its selection list and points stale targets here.- Branches are not deleted by
prune; useremovefor real worktrees and branch cleanup. - JSON mode emits one JSON envelope on stdout with per-repository stale entries, reasons, totals, and failure details when needed.
Agent Notes
Section titled “Agent Notes”- Prefer
arashi prune --dry-run --jsonbefore mutating cleanup when diagnosing out-of-sync worktree records. - Use
arashi prune --jsonfor non-interactive cleanup after confirming entries are stale metadata, not active worktrees. - Do not use
arashi removeto clean prunable entries;removeis for real coordinated worktrees and branches.