Individual skill
cleanup-git
Remove merged local branches and stale git worktrees. Use when the user says "cleanup branches", "prune worktrees", "tidy git", "remove merged branches", "delete merged branches", "gone branches", or wants to clean local git state. NOT for creating commits, creating worktrees, or configuring git hooks.
src/skills/cleanup-git/SKILL.md
Source commit 5ad5b8f0df027cf694ccbeb3311830890f01d582
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 7, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 38
- Repository last updated
- Oct 25, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- ai-coding Repository topic
- claude-code Repository topic
- code-review Repository topic
- developer-tools Repository topic
- codex Repository topic
- pi-coding-agent Repository topic
- agent-skills Repository topic
- codex-cli Repository topic
- coding-agents Repository topic
- cursor Repository topic
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
.agentbundler/targets/claude.jsonasset · 151 bytesSKILL.mdcore · 4,658 bytesSKILL.mdcore · 4,658 bytesscripts/cleanup-git.shruns · 12,317 bytes
Read excerpt
# Cleanup Git
Use the target repo's own `scripts/cleanup-git.sh` if it ships one, otherwise this skill's script. Inspect a repo-provided script before relying on its safety policy. Use direct deletion only for a specifically approved exception described below; never pipe a branch list into force-delete.
```bash
scripts/cleanup-git.sh # preview (default)
scripts/cleanup-git.sh --apply # execute the requested safe cleanup
scripts/cleanup-git.sh --apply --force --branch <name> # approved ahead-commit loss
scripts/cleanup-git.sh --base <ref> # override base detection
```
The script fetches and prunes remotes. It prefers the fetched remote default branch, then remote `main`, `master`, `trunk`, `develop`, or `dev`, then local fallbacks. `--base` overrides this choice.
## What the script decides