clean-all

Delete all non-main Git branches locally and remotely, prune stale references, and remove worktrees.

1|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/cwilliams5/Alt-Tabby --skill clean-all
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-all
Source: https://github.com/cwilliams5/Alt-Tabby/tree/main/.claude/skills/clean-all
Command: npx skills add https://github.com/cwilliams5/Alt-Tabby --skill clean-all

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps maintain a clean Git repository by removing outdated local and remote branches, preventing clutter and potential confusion.

Core Features & Use Cases

  • Remote Pruning: Removes stale remote-tracking branches that no longer exist on the remote.
  • Local Branch Deletion: Deletes all local branches except for main.
  • Remote Branch Deletion: Deletes all remote branches except for main.
  • Worktree Cleanup: Removes any associated worktree directories.
  • Use Case: After completing a feature and merging it, use this Skill to automatically clean up the feature branch from both your local and remote repositories.

Quick Start

Run the clean-all skill to tidy up your Git branches.

Frequently Asked Questions about clean-all

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I delete all local and remote Git branches except main?

To delete all local and remote Git branches except main, you can use an automated cleanup tool that removes non-main branches, prunes stale remote-tracking references, and clears associated worktree directories to ensure a clean repository state.

What is the best way to clean up stale Git branches after merging a feature?

The best way to clean up stale Git branches after merging a feature is to automate the deletion of non-main branches both locally and remotely, while pruning outdated remote-tracking references and removing linked worktree directories.

How does Git remote pruning work for stale remote-tracking branches?

Git remote pruning works by removing stale remote-tracking branches that no longer exist on the remote server, ensuring your local repository references are synchronized and free of outdated branch clutter.

Can I automatically remove Git worktrees when cleaning up repository branches?

Yes, you can automatically remove Git worktrees when cleaning up repository branches by running a cleanup process that deletes associated worktree directories alongside non-main local and remote branches.

When should I not use an automated tool to delete Git branches?

You should not use an automated tool to delete Git branches if you have unmerged changes or active feature branches, as this process permanently deletes all non-main branches locally and remotely without selective recovery options.

Do I need any dependencies to clean up Git branches automatically?

No dependencies are required to clean up Git branches automatically, as the cleanup process runs directly within your Git environment to delete non-main branches, prune remote references, and remove worktree directories.