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
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install git-repo-cleaner - 安装完成后,直接呼叫该 Skill 的名称或使用
/git-repo-cleaner触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。
如何安装 git-repo-cleaner?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install git-repo-cleaner」即可一键安装,无需额外配置。
git-repo-cleaner 是免费的吗?
是的,git-repo-cleaner 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
git-repo-cleaner 支持哪些平台?
git-repo-cleaner 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 git-repo-cleaner?
由 charlie-morrison(@charlie-morrison)开发并维护,当前版本 v1.0.0。