Audits and safely prunes stale branches across a GitHub organization with immutable snapshots, merged-PR classification, live revalidation, resumable deletion ledgers, and post-delete verification.
Ships in org-branch-cleanup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Remove organization branch clutter without guessing which refs are safe to delete.
The bundled scripts/org_branch_cleanup.py separates the work into read-only audit, explicit apply, and full verification phases. Dry-run evidence is the default; deletion requires an exact organization confirmation.
git push --delete.gh auth statusgh api rate_limit --jq '.resources | {core,graphql}'python3 scripts/org_branch_cleanup.py audit \
--org example-org \
--output /tmp/example-org-branch-audit
Start with --include-repo-regex '^one-repo$' when proving access or policy.
Audit output is immutable by default; use a new directory rather than --overwrite.audit-summary.json, audit-errors.tsv, and delete-candidates.jsonl.
--allow-partial.python3 scripts/org_branch_cleanup.py apply \
--candidates /tmp/example-org-branch-audit/delete-candidates.jsonl \
--confirm-org example-org \
--output /tmp/example-org-branch-apply
apply requires the clean sibling audit-summary.json. Do not bypass this with --allow-unverified-candidates or --allow-partial-audit without an explicit operator decision.moved: branch SHA changed after the snapshot.protected: REST or ruleset protection blocked deletion.open-pr: a live pull request now uses the branch.missing: GitHub or another operator already removed it.python3 scripts/org_branch_cleanup.py verify \
--ledger /tmp/example-org-branch-apply/deleted.tsv \
--output /tmp/example-org-branch-apply/verification-rerun.tsv
--confirm-org.--allow-closed-unmerged.gh CLI with repository administration permission.--gh-bin override for a compatible GitHub CLI wrapper.snapshot.jsonl: immutable branch and PR-tip evidence.delete-candidates.jsonl: old merged branches eligible for live preflight.closed-unmerged-review.jsonl: abandoned PR heads requiring explicit approval.stale-unassociated.tsv: old branches with insufficient deletion proof.deleted.tsv and skipped.tsv: resumable mutation ledger.verification.tsv: post-delete ref state.stateDiagram-v2
[*] --> AuditRequestedScope
AuditRequestedScope --> ReportAudit: audit only
AuditRequestedScope --> ReviewCandidates: apply requested
ReviewCandidates --> ReportBlocked: incomplete audit without explicit exception
ReviewCandidates --> RevalidateLiveRef: exact organization and candidates approved
RevalidateLiveRef --> RecordSkip: moved, protected, open PR, or missing
RevalidateLiveRef --> DeleteExactRef: eligible unchanged ref
DeleteExactRef --> VerifyDeletion
VerifyDeletion --> RecordDeleted: absent
VerifyDeletion --> ReportBlocked: failure or ambiguous result
RecordSkip --> ReportCounts
RecordDeleted --> ReportCounts
ReportAudit --> [*]
ReportCounts --> [*]
ReportBlocked --> [*]
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
branch-cleanup, github-org, stale-branches, git-housekeeping
/org-branch-cleanup:org-branch-cleanupfrom org-branch-cleanup
npx claudepluginhub vincentkoc/dotskills --plugin org-branch-cleanupOther plugins' skills for the same job