tidy-repo

Reconciles local and remote git state by pruning stale branches, worktrees, stashes, and untracked files.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/Sassy-Dog/sassydog-skills --skill tidy-repo-sassy-dog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tidy-repo
Source: https://github.com/Sassy-Dog/sassydog-skills/tree/main/skills/tidy-repo
Command: npx skills add https://github.com/Sassy-Dog/sassydog-skills --skill tidy-repo-sassy-dog

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After shipping work, repositories accumulate stale branches, orphaned stashes, detached worktrees, and untracked noise files that clutter the workspace and make it hard to tell what is still active. Manually auditing and cleaning this state is error-prone — deleting the wrong branch or stash can lose real work. ## Core Features & Use Cases - Post-shipping git reconciliation: Fast-forwards the default branch, prunes remotes, inventories stale branches and worktrees, triages orphan stashes, and sweeps untracked-file noise. - Safe deletion with guardrails: Deletes merged-PR branches locally and remotely, but never deletes branches with open PRs, never auto-drops stashes on open issues, and never discards untracked files outside a configured allowlist. - Config-driven policy: Reads per-repo sweep policy (noise allowlist, dependency version globs, never-discard list) from .claude/sassy-dog/tidy-repo.md, running in conservative no-discard mode when config is missing. - Use Case: After a day of merging several PRs, ask the agent to tidy the repo — it inventories what is stale, removes squash-merged and [gone] branches, tears down stale worktrees, and reports anything ambiguous for your decision. ## Quick Start Ask the agent to tidy the repo and clean up stale branches, worktrees, and stashes after shipping today's pull requests.

Frequently Asked Questions about tidy-repo

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up stale git branches after merging pull requests?

Run the tidy-repo skill, which fast-forwards the default branch, prunes remotes, and deletes branches whose PRs are merged — both locally and remotely. It handles the `[gone]` grep trap and squash-merge `-D` cases that manual cleanup often gets wrong.

How to safely remove old git worktrees and stashes?

The skill inventories stale and detached worktrees and triages orphan stashes, using `closedByPullRequestsReferences` as the shipped signal. It never force-removes a worktree whose commits are not in the default branch without confirmation, and never auto-drops a stash tied to an open issue.

What happens if the repo has no tidy-repo config file?

The skill runs in conservative mode with an empty noise allowlist and discards nothing, since it cannot know which untracked files are precious. It still performs branch and worktree reconciliation, then offers once to set up the repo via the setup-config skill.

Can tidy-repo delete untracked files automatically?

Only files matching the `noise_allowlist` in the repo's `.claude/sassy-dog/tidy-repo.md` config are auto-discarded, and anything on the `never_discard` list is always preserved. It never infers disposability from `.gitignore`, since ignored files like `.env.local` are often valuable.

Why does tidy-repo refuse to run without the repo-cleanup skill?

The actual deletion mechanics are delegated to the `sassy-dog:repo-cleanup` skill so the plumbing lives in one place. If that skill is unavailable, tidy-repo stops and asks you to install the plugin rather than improvising destructive git operations from memory.