Clean up local Git, only when the user runs /git-janitor. Inspect uncommitted and unpublished work in every worktree first, discard work that is superseded or over 60 days old when justified, then remove merged and stale local worktrees and branches. Record what was discarded and why.
Ships in killall-skills. 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.
Read when SKILL.md points to them.
/git-janitor runs full local cleanup in the current repository. It runs only
when the user invokes it; no agent starts it. Command arguments can name another
repository or narrow the request to an audit. Invoking it authorizes the local
cleanup policy below. Follow any more specific instruction in the user's request.
Confirm the repository root and resolve the default branch to a local commit.
Use a default named by the user; otherwise try origin/HEAD, then
gh repo view --json defaultBranchRef if available. Use main or master
only when one is the sole plausible local default. Ask only if the reference
remains ambiguous. Record the current checkout, all local branch tip OIDs,
and git worktree list --porcelain.
Cleanup is local: never push, delete remote branches, or rewrite remote refs. Keep the default branch and the checkout running this task. Their disposable working changes may still be cleaned path by path after inspection.
Visit every worktree before removing any of them, including the current
checkout and detached worktrees. Record its HEAD, branch, lock state,
git status --porcelain --untracked-files=all, staged and unstaged diffs,
untracked paths, and any ignored files that a removal would erase. Inspect
enough of the content to understand the work. Record the newest relevant
file modification time when available; a worktree with recent edits needs
judgment even when its branch tip is old.
For each branch, separately count commits not reachable from the default and commits ahead of its configured upstream. If no upstream exists, say "unpublished status unknown" and inspect the branch history rather than assuming zero unpushed commits. A local remote-tracking ref may be stale; do not claim it proves the live remote state. Show the branch's last commit date, ahead/behind counts, and the commit subjects or files that explain its work.
Compare dirty files and branch commits with the current default and other
retained work. git cherry, a tree comparison, and file content can show
that a patch or result already landed through a squash, cherry-pick, or later
implementation. A three-dot diff lists files touched since divergence, not
necessarily content still absent from default. Being behind default alone
does not make changes disposable. Classify local work as landed or clearly
superseded, disposable after inspecting its purpose, or valuable /
uncertain; note the evidence for each classification.
Inspect unmerged branches yourself, read-only: the expected tip OID, default
ref, upstream, and linked worktree path, and query PRs with
gh pr list --state all --head "$short_branch". A failed PR lookup is
unknown, not no PR.
The age rule is permission, not a substitute for understanding dirty data. The user's standing cleanup request authorizes these local actions. Do not stop after the inventory to ask for each branch or worktree.
Before each discard, record the path, branch, tip OID, unpublished commit count, dirty paths, and the evidence that the work can go. Recheck the tip, status, worktree mapping, and relevant content immediately before acting. If anything changed, skip that item and report it.
Use git worktree remove "$path" for clean linked worktrees and
git worktree remove --force "$path" for dirty ones classified disposable.
Never force-remove the running checkout or a locked worktree. For disposable
changes in the running checkout, use targeted restore/clean operations on
the reviewed paths instead of a blanket reset or clean. Delete merged
branches with git branch -d -- "$branch"; use
git branch -D -- "$branch" for authorized old or superseded unmerged
branches after their worktrees are gone. A failed command is a skipped item,
not a reason to silently widen the force.
Run git worktree prune --dry-run -v, then prune stale metadata that is
clearly abandoned; preserve entries that may represent temporarily missing
worktrees. Report dirty and unpublished work first: what was discarded,
what was kept, and the evidence. Then list worktrees, branches, and stale
metadata removed, with exact names and paths. State any remaining decisions
or failures plainly.
What SKILL.md sets; muted values are Claude Code's defaults
/killall-skills:git-janitorfrom killall-skills
npx claudepluginhub killallgit/killall-skills --plugin killall-skills15 skills in this plugin
/architectural-reviewReview a codebase's architecture. Finds hotspots in git history, walks them for friction, writes an HTML report of deepening candidates with before/after diagrams, proposes glossary terms, and suggests beads for the work. Words after the command name a direction (a module, a subsystem, a pain point)./catch-upRebuild a human's lost context on the work in flight after reconciling the current checkout's dangling changes — commit what belongs to an open PR, discard what already landed, sync the branch — then summarize the state of play, decisions, live PRs and tickets, and the single next step. Use when the user says "catch me up", "where were we", "what's the state of this", "get back on track", or invokes `/catch-up` after time away./Other plugins' skills for the same job