Cleanup Merged — Git skill for Claude Code
Clean up worktree and local + remote branch for a merged PR.
How to install Cleanup Merged
Installs to ~/.claude/skills/lugassawan-swe-workbench-cleanup-merged/SKILL.md
mkdir -p ~/.claude/skills/lugassawan-swe-workbench-cleanup-merged && curl -fsSL https://raw.githubusercontent.com/lugassawan/swe-workbench/HEAD/commands/cleanup-merged.md -o ~/.claude/skills/lugassawan-swe-workbench-cleanup-merged/SKILL.md Restart Claude Code, or start a new session, for it to be picked up.
What Cleanup Merged does
description: Clean up worktree and local + remote branch for a merged PR argument-hint: [PR number — optional, defaults to current branch]
Target: $ARGUMENTS (PR number if provided; otherwise derive from current branch)
Invoke `swe-workbench:workflow-cleanup-merged` to perform the full cleanup.
Pass the PR number from $ARGUMENTS to the skill if provided. If $ARGUMENTS is empty, the skill will derive the target branch from the current branch.
When the skill completes, print a summary
Alternatives in Git
- Clean Worktrees (Automatic) — Automatically remove all worktrees for branches merged into master 25.5k ★
- Local Review — You are tasked with setting up a local review environment for a colleague's branch 10k ★
- Merge Command — Finalize worktree work: update docs, commit, merge to main, clean up 1.3k ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Branch Cleanup
Clean up merged, stale, and orphaned git branches. Protects main/develop/release/ automatically. Supports --dr
Git.Merge
Merge the current branch's PR, switch to the default branch, and clean up all merged/gone local and remote bra
Cleanup Worktree
Remove a merged worktree and its branch after verifying it was merged into main
CloseBranch
Close out a branch after its PR is merged/closed - switches to the PR's base branch (main, or the todo's arc b
PR Post Merge
Clean up after a PR is merged — close fork issue, update local branch, delete issue branch
Clean After Merged
Switch to the repo's main branch, pull, and delete the just-merged local branch.
Related Agents
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes
Branch Gardener
Triages local branches and stashes in a managed repo (merged, stale, superseded, unpushed) and proposes deleti
Merge Cleanup
Commits worktree changes, cherry-picks them to main, removes the worktree, and prunes the branch. Use at the e