git-repo-cleaner
/install git-repo-cleaner
Git Repo Cleaner
Audit Git repositories for bloat, stale branches, and maintenance issues. Generate safe cleanup scripts.
Quick Audit
python3 scripts/audit_repo.py /path/to/repo
Specific Checks
# Stale branches only
python3 scripts/audit_repo.py /path/to/repo --check branches
# Large files in history
python3 scripts/audit_repo.py /path/to/repo --check large-files
# Full audit
python3 scripts/audit_repo.py /path/to/repo --check all
Output Formats
python3 scripts/audit_repo.py /path/to/repo --format text|json|markdown
Checks Performed
1. Stale Branches
- Branches not updated in >30 days (configurable with
--stale-days) - Branches already merged into main/master
- Branches with no unique commits
- Remote tracking branches with deleted remotes
2. Large Files
- Files >1MB in current tree (configurable with
--min-size) - Large blobs in git history (top 20)
- Binary files that shouldn't be tracked
3. Repo Stats
- Total repo size (.git directory)
- Pack file stats
- Object count and size
- Unreachable objects
4. Maintenance
- Missing .gitignore patterns (node_modules, pycache, .env, etc.)
- Unoptimized packfiles
- Stale reflog entries
Cleanup Script Generation
Use --fix to generate (not execute) cleanup scripts:
python3 scripts/audit_repo.py /path/to/repo --fix
# Outputs cleanup.sh with safe delete commands
The generated script uses git branch -d (safe delete, refuses if not merged) by default.
Use --force-delete to generate git branch -D commands instead.
Workflow
- Run audit on repo
- Review findings
- Generate cleanup script if needed
- Review script before executing
- Execute cleanup
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install git-repo-cleaner - After installation, invoke the skill by name or use
/git-repo-cleaner - Provide required inputs per the skill's parameter spec and get structured output
What is git-repo-cleaner?
Audit and clean up Git repositories. Find stale/merged branches, large files in history, orphaned tags, repo bloat, and generate cleanup scripts. Use when as... It is an AI Agent Skill for Claude Code / OpenClaw, with 99 downloads so far.
How do I install git-repo-cleaner?
Run "/install git-repo-cleaner" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is git-repo-cleaner free?
Yes, git-repo-cleaner is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does git-repo-cleaner support?
git-repo-cleaner is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created git-repo-cleaner?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.