repo-cleanup

repo-cleanup is a skill for Claude Code from Sassy-Dog/sassydog-skills. It costs 210 tokens per session (5,714 once invoked), scanned A, original, Apache-2.0.

A cleanup process for reconciling a Git repository after work has shipped. It checks branches, worktrees, stashes, and other leftover local state against the current remote repository.

In plain words
What is it for?
Use it after merging work to update the default branch, remove gone or merged branches, clear stale agent worktrees, and inspect leftover stashes safely.
Why use it?
It removes stale development state that can clutter the repository or make it difficult to tell which work is still active.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the sassy-dog plugin — 21 skills, 10 agents shipped together

Good fit Use it after merging work to update the default branch, remove gone or merged branches, clear stale agent worktrees, and inspect leftover stashes safely.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Sassy-Dog/sassydog-skills
Claude Code
/plugin install sassy-dog

Made for: Claude Code.

Or install sassy-dog, the plugin that ships this one along with the rest of its 21 skills, 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for repo-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/repo-cleanup/github.svg)](https://agentmods.dev/skills/sassy-dog/sassydog-skills/repo-cleanup)
Your own site
<a href="https://agentmods.dev/skills/sassy-dog/sassydog-skills/repo-cleanup"><img src="https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/repo-cleanup/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for repo-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/sassy-dog/sassydog-skills/repo-cleanup"><img src="https://agentmods.dev/badge/skills/sassy-dog/sassydog-skills/repo-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 210 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,714 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00210 $0.05714
Opus 5 $0.00105 $0.02857
Sonnet 5 $0.00042 $0.01143
Haiku 4.5 $0.00021 $0.00571

Measured 11d ago against content hash 07174f2ac66e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

repo-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/repo-cleanup/SKILL.md · 394 lines

How it starts

The opening of the file, as written. The whole thing — 394 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Repo Cleanup

The shared mechanics behind a repo's tidy-repo. A generated tidy-repo is thin: it holds project facts and delegates the actual reconciliation here, so the tricky git plumbing (the [gone] grep trap, squash-merge -D, stash triage by PR linkage) lives in exactly one place.

This skill does not own the top-level cleanup request — the per-repo generated tidy-repo does, and calls this skill by name. It also pairs with the read-only sassy-dog:repo-health (health = read scan; cleanup = write reconcile) and with the built-in commit-commands:clean_gone (a narrower [gone]-only sweep — this skill supersedes it with stash/untracked/label handling).

Inputs to establish first

The caller (a generated tidy-repo, or the user directly) supplies these. Resolve any that are missing before acting:

  1. Repoowner/name. If not given, resolve dynamically (don't hardcode): REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner).
  2. Default branch — defaults to main. Used as the reconcile target and the "never delete" guard.
  3. Dep/version-file globs — files whose presence in a stash blocks small-content auto-drop (e.g. package.json, bun.lock, pubspec.yaml, *.csproj, migration dirs). Stack-specific.
  4. Noise allowlist — extra auto-discard patterns beyond the universal defaults (build/output dirs like **/node_modules/, **/.dart_tool/, **/build/).
  5. Never-discard list — gitignored-but-precious files to leave untouched (e.g. .env.local).
  6. delete_branch_on_merge — whether GitHub auto-deletes the head branch on merge (makes step 7 normally a no-op). Read from repo settings if unknown.
  7. Claim label (optional) — a take-it-style in-progress label (e.g. status:in-progress) to clear on issues whose work already merged. Omit if the repo has no claim-label convention.

Acting principle (steps 3–4 and 8): ASSESS first, act on what you're confident about, escalate only on mixed signal — substantive WIP, dep-file touches, abandoned-but-non-trivial work. Asking on every .DS_Store defeats the purpose; never confirming on a 600-line orphan stash loses real work.

Read the full file on GitHub · 394 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 394 lines · 210 tokens per session scan A 07174f2ac66e

Subscribe to this mod's changes

repo-cleanup is a skill published in the GitHub repository Sassy-Dog/sassydog-skills (0 stars, last pushed 3d ago), licensed Apache-2.0. It adds 210 tokens to every session and 5,714 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

commit

Git commit workflow with precommit hook handling, lint/type checking, README updates, and API reference updates. Use when the user wants to commit changes. Handles precommit hooks that modify files (formatting, linting) by re-staging and retrying. Runs ruff lint and pyright type checks on staged Python files, and…

ReflexioAI/claude-smart · 122 tokens

update-pr

Update an existing pull request with new changes. Use when the user wants to update a PR, push follow-up changes to a PR, refresh a PR description, or sync a PR with latest commits. Triggers on: update pr, update-pr, update the pr, push to pr, refresh pr, sync pr, update pull request.

ReflexioAI/claude-smart · 71 tokens

codex-setup

Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.

sd0xdev/sd0x-harness · 65 tokens

smart-rebase

Smart partial rebase for squash-merge repositories. Auto-detect which commits to keep/drop when base branch was squash-merged into target. Use when: user says 'rebase', 'partial rebase', 'base already merged', 'smart rebase', or /smart-rebase. Not for: simple git rebase (the developer runs it — Claude never executes…

sd0xdev/sd0x-harness · 131 tokens

next-step

Change-aware next step advisor. Use when: user asks what to do next, workflow progression is unclear, session just started with dirty worktree. Not for: executing the suggested command (user decides), auto-loop decisions (hooks handle that). Output: findings-based suggestions or session summary with commit seed.

sd0xdev/sd0x-harness · 63 tokens

resolving-merge-conflicts

Use when a git merge or rebase reports conflicts and the operation is in progress.

romiluz13/cc10x · 25 tokens