cleanup

Automate git branch cleanup by deleting merged feature branches.

11|3|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/ImperialAutomation/claude-code-toolkit --skill cleanup-imperialautomation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup
Source: https://github.com/ImperialAutomation/claude-code-toolkit/tree/main/skills/cleanup
Command: npx skills add https://github.com/ImperialAutomation/claude-code-toolkit --skill cleanup-imperialautomation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Automates the cleanup process in git repositories by deleting merged feature branches and syncing with the main base branch.

Core Features & Use Cases

  • Automatic Branch Cleanup: Detects current feature branch, switches to base branch, fetches latest changes, and deletes the merged branch.
  • Remote Branch Handling: Prompts for confirmation before deleting remote branches to ensure safety.
  • Use Case: After a pull request merge, quickly clean up local and remote branches to maintain repository hygiene and prevent clutter.

Quick Start

Use the cleanup skill to remove a feature branch after merging a PR and update the main branch seamlessly.

Frequently Asked Questions about cleanup

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

FAQPage Schema
How do I delete local and remote git branches after a pull request merge?

To delete merged branches, the cleanup process detects your current feature branch, switches to the main branch, fetches updates, and deletes the local and remote branches to maintain repository hygiene.

What is the best way to automate git branch cleanup for merged features?

Automating git branch cleanup uses scripts to detect the active feature branch, switch to the base branch, fetch latest changes, and remove obsolete branches, ensuring efficient repository maintenance after merging.

Does the automated branch cleanup delete remote branches without confirmation?

No, automated branch cleanup prompts for confirmation before deleting remote branches to ensure safety, while local branches are removed automatically after switching to the main base branch.

How do I switch to the main branch and fetch updates before deleting a feature branch?

The cleanup automation switches to the main branch and fetches latest changes before deleting the detected feature branch, ensuring your local repository is synced with the main base branch.

When should I run an automated git branch cleanup in my development workflow?

You should run automated git branch cleanup immediately after a pull request merge to quickly remove local and remote feature branches, preventing clutter and maintaining repository hygiene.

Do I need any external dependencies to automate git repository maintenance?

No external dependencies are required to automate git repository maintenance; the cleanup process relies solely on internal scripts to manage branch detection, switching, fetching, and deletion.