Professional repository cleanup utility for developers and teams
Clean up messy repositories with confidence. Remove backup files, fix naming conventions, and establish professional hygiene standards across your codebase.
Every developer has encountered repositories cluttered with:
.backup,.bak,.oldfiles scattered everywhere- Files named
ENHANCED_,WORKING_,FIXED_,FINAL_ - Inconsistent git configurations across team members
- Missing or inadequate
.gitignorepatterns
repo-clean solves these problems safely and educationally.
repo-clean is the only tool that combines file hygiene, bloat detection, AND comprehensive code quality linting in one unified interface.
- File Hygiene: Backup files, naming conventions, git config issues
- Bloat Detection:
node_modules, build artifacts, oversized directories - Repository Structure: Nested repos, directories that should be separate projects
- Large Files: Assets that should use Git LFS or external storage
- Code Quality: Multi-ecosystem linting (Python, JavaScript, Go, Rust, Java)
- 5 Ecosystems: Python, JavaScript/TypeScript, Go, Rust, Java
- 15+ Linters: eslint, pylint, prettier, black, mypy, clippy, and more
- Safe Auto-fixing: ONLY formatting fixes (prettier, black, gofmt) - NEVER logic changes
- Custom Analysis: Complexity, security patterns, documentation quality
- Preview mode: See exactly what will change before committing
- Automatic backups: Creates rollback points before any changes
- Incremental operations: Clean one issue type at a time
- Detailed logging: Full audit trail of all operations
- Explains why each issue matters
- Suggests best practices for prevention
- Provides learning resources for repository hygiene
- Shows before/after metrics to demonstrate impact
- Handles large repositories efficiently
- Supports multi-repository operations
- Integrates with CI/CD workflows
- Comprehensive error handling with helpful messages
# Install
pip install repo-clean
# Scan for issues (safe, read-only)
repo-clean scan
# Preview cleanup (shows what would change)
repo-clean clean --preview
# Clean backup files safely
repo-clean clean --backup-files
# Fix naming conventions
repo-clean rename --interactive
# Run comprehensive code quality linting
repo-clean lint
# Preview what could be safely fixed (recommended first)
repo-clean lint --preview-fixes
# Fix ONLY safe formatting issues (prettier, black, gofmt)
repo-clean lint --fix
# Full health check with recommendations
repo-clean reportπ Scanning repository for hygiene issues...
β
Repository: /home/user/my-project
π Found 23 issues across 4 categories:
ποΈ Backup Files (15 found)
βββ src/main.py.backup [Why: Clutters workspace, confuses IDEs]
βββ config.json.bak [Why: Security risk if contains secrets]
βββ workflow.yml.old [Why: Outdated code can mislead]
π·οΈ Naming Issues (5 found)
βββ ENHANCED_user_service.py [Why: Non-descriptive, unprofessional]
βββ WORKING_api_handler.py [Why: Suggests experimental code]
βββ FIXED_database_utils.py [Why: Temporary naming became permanent]
πΎ Bloat Directories (3 found)
βββ node_modules/ (847.2MB) [Why: Should be in .gitignore, slows clones]
βββ __pycache__/ (23.1MB) [Why: Generated files, environment-specific]
βββ .pytest_cache/ (5.8MB) [Why: Test artifacts, should be temporary]
π Non-repo Directories (2 found)
βββ legacy-project/ [Why: Nested .git found, should be submodule]
βββ data-warehouse/ [Why: 2.1GB directory, consider separate repo]
π Large Files (4 found)
βββ assets/demo.mp4 (45.2MB) [Why: Use Git LFS for media files]
βββ data/export.zip (12.8MB) [Why: Archives should use external storage]
βββ models/trained.pkl (156MB) [Why: ML models should use Git LFS]
π§ͺ Code Quality (3 ecosystems)
βββ Python: pylint (23 issues - manual), black (8 issues - π§ fixable), mypy β
βββ JavaScript: eslint (15 issues - manual), prettier (12 issues - π§ fixable)
βββ Custom: complexity (3 - manual), security patterns β
βοΈ Git Config (2 issues)
βββ user.name: "root" [Why: Poor attribution, not descriptive]
βββ user.email: missing [Why: Required for proper attribution]
π Gitignore (1 gap)
βββ Missing *.backup* pattern [Why: Future backup files will be tracked]
π‘ Run 'repo-clean clean --preview' to see proposed fixes
π§ͺ Run 'repo-clean lint --preview-fixes' to see safe formatting fixes available
π§ Run 'repo-clean lint --fix' for SAFE formatting only (never logic changes)
π Run 'repo-clean explain backup-files' to learn more
- Installation Guide
- Usage Examples
- Code Quality Linting
- Safety Features
- Error Handling
- Best Practices
Born from real-world experience cleaning 1,500+ problematic files across 42 production repositories.
We welcome contributions! See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Built with β€οΈ for the developer community