/cleanup:stale-forks [path]from cleanup
Identifies personal forks whose unique commits are already merged upstream (or have no unique commits) and removes local clones after approval, with optional GitHub fork deletion.
Ships in cleanup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Find personal forks that are no longer useful and reclaim their space.
Operates in report → confirm → execute order. After approval, remove the local clones autonomously. Deleting the GitHub fork is a separate interactive confirmation (it is irreversible and outward-facing). Choices are gathered through interactive questions, not flags.
$ARGUMENTS → use it.Enumerate repositories under the resolved root (each .git directory).
Determine the authenticated user once: gh api user --jq .login → $ME.
A repository is a personal fork when:
upstream remote (git -C "$REPO" remote get-url upstream succeeds), orgh repo view --json isFork,parent,owner,nameWithOwner (run inside the repo) reports isFork == true and owner.login == $ME.Skip anything that is not a personal fork. Record the upstream nameWithOwner and default branch for each fork.
A fast inventory shortcut for many forks: gh repo list "$ME" --fork --limit 300 --json name,parent,defaultBranchRef, then intersect with local clones present under the root.
Removing a local clone while keeping the GitHub fork is reversible (re-clone later), so the only irrecoverable risk is local-only work. Check it first, cheaply, with no network:
git status --porcelain non-empty) → keep, flag it.git -C "$REPO" log --oneline --branches --not --remotes. Non-empty → keep, flag it (removing the clone would lose them).Then assess whether the fork itself is still useful (this is what makes it a candidate, vs just reclonable):
git -C "$REPO" log --oneline --branches --remotes --not upstream/<default> (resolve the upstream default branch first). Empty → contributes nothing beyond upstream. This compares against the default branch only; work merged into a non-default upstream branch will conservatively show as unique and be kept — safe-by-default, never a false deletion.gh pr list --repo <upstream> --state open --author "$ME" (or one cross-repo pass: gh search prs --author=@me --state=open). An open PR means the fork is active → flag.Classify:
Table: fork, upstream, classification, reason, local size (du -sh). Group removal candidates separately from keep/flagged, with the total reclaimable size. Then ask the user (interactive question) which set of local clones to remove — e.g. only dead-and-reclonable, or all reclonable (including active-PR clones, which would then need a re-clone to resume).
For each approved fork, remove the local clone directory tree (the whole repo directory) to reclaim the disk. If read-only cache directories block removal, restore the write bit first (chmod -R u+w).
Then, for the GitHub fork, ask the user (interactive question) whether to also delete it on GitHub — default no. Only on an explicit yes, per fork:
gh repo delete <owner>/<repo> --yes
This needs the delete_repo token scope (gh auth refresh --scopes delete_repo if missing). If the user declines, leave the GitHub fork untouched and note it can be deleted later.
Report local space reclaimed, clones removed, GitHub forks deleted (if any), and every fork kept/flagged with its reason.
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/brew-cleanupReclaim Homebrew disk by removing old formula/cask versions, pruning the download cache, and uninstalling orphaned dependencies (brew autoremove). Shows a dry-run estimate first, then runs the user-chosen scope after approval. TRIGGER when the user wants to free Homebrew space ("brew cleanup", "почисти brew", "remove orphaned brew packages"). DO NOT trigger for uninstalling a specific named formula./cleanup-allRun the full local cleanup pipeline — stale git worktrees, dead personal forks, Docker prune, Go caches, and Homebrew — in one pass, each stage report → confirm → execute, then a combined reclaimed-space summary. TRIGGER when the user wants a broad disk cleanup ("free up disk space", "почисти всё", "run the cleanup pipeline"). DO NOT trigger when the user clearly wants only one specific cleaner — invoke that skill instead./npx claudepluginhub lexfrei/ccc --plugin cleanupOther plugins' skills for the same job