| name | cleanup |
| description | Clean up after merging a PR - checkout base, fetch, pull, delete feature branch |
| user-invocable | true |
Cleanup After PR Merge
Clean up git repository after merging a PR by running the cleanup script.
Usage
/cleanup
What This Does
Run the cleanup script:
~/.claude/bin/git-cleanup-merged-branch.sh
The script will:
- Auto-detect the current feature branch
- Find the appropriate base branch (develop/master/main)
- Checkout the base branch
- Fetch and pull latest changes
- Delete the merged feature branch (with safety checks)
- Optionally delete the remote branch
Important
- Only run this AFTER merging the PR in GitHub
- The script uses
git branch -d (safe delete) - will warn if branch isn't fully merged
- Will prompt before deleting remote branches
- Checks for uncommitted changes and warns you
Manual Usage Options
~/.claude/bin/git-cleanup-merged-branch.sh
~/.claude/bin/git-cleanup-merged-branch.sh issue-123-my-feature
~/.claude/bin/git-cleanup-merged-branch.sh issue-123-my-feature develop