Skip to content
Kitbay
Skill

clean-old-worktrees-global

Apache-2.0Updated on Nov 11, 202650,877GitHub starsIncludes scripts

A skill in the ClickHouse repository for freeing disk space by deleting unused git worktrees and old build folders across every checkout under the home folder or another root, including worktrees nested inside checkouts.

What the skill teaches

A skill in the ClickHouse repository for freeing disk space by deleting unused git worktrees and old build folders across every checkout under the home folder or another root, including worktrees nested inside checkouts. Anything untouched since a set age, one day by default, counts as unused. A bundled scan script lists candidates; the agent then reviews them, keeping main repositories, anything of unknown age, and worktrees with uncommitted work or commits that would be lost unless the user confirms. A bundled delete script removes the final list, skipping folders in use by a process or holding mount points, and can be rerun if it times out. The report covers what was deleted, kept and skipped, with disk usage before and after.

Capabilities

  • Scan checkouts for stale worktrees and build folders
  • Keep worktrees with unsaved or unpushed work
  • Delete the reviewed list with safety checks
  • Report disk usage before and after