One command to clean your code. Remove AI-generated comments, add documentation, or format code properly.
git clone https://github.com/atharva-badgujar/code-cleaner.git
cd code-cleaner
chmod +x install.sh
./install.shWindows:
cmdgit clone https://github.com/atharva-badgujar/code-cleaner.git
cd code-cleaner
install.batclean # Interactive mode (easiest!)
clean . # Clean current folder
clean app.py # Clean single file
clean system # Clean npm cache That's it! 🎉
cleanCode Cleaning Commands:
# Remove comments and format
clean .
# Add helpful comments
clean . add
# Clean and push to GitHub
clean . push
# Process specific file
clean app.pySystem Cleaning Commands:
# Find and clean orphaned node_modules
clean system
# Show all (including active projects)
clean system --show
# Auto-delete without confirmation
clean system --auto
# Search custom path
clean system --path ~/DesktopThe tool will ask you:
- What folder/file to process
- What mode (clean/add/format)
- Whether to push to GitHub
Perfect for beginners!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INTERACTIVE MODE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
clean Start interactive mode (easiest!)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CODE CLEANING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
clean . Remove comments + format (current folder)
clean file.py Clean single file
clean ./src Clean specific folder
clean . add Add helpful comments to code
clean file.py add Add comments to specific file
clean . push Clean code and push to GitHub
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NPM CACHE CLEANING
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
clean system Smart clean npm cache
clean system --show Show detailed file listing
clean system --verify Verify and fix corrupted cache
clean system --force Delete entire cache (use carefully!)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
HELP & INFO
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
clean --help Show all commands and examples
clean -h Show help (short version)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SUPPORTED LANGUAGES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, PHP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Ever used ChatGPT or Claude to write code and got this?
# This function adds two numbers together
def add(a, b):
# First we add a and b
result = a + b # Store in result variable
# Now return the result
return result # This returns the sumClean it in one command:
clean app.pyResult:
def add(a, b):
result = a + b
return resultClean, professional, production-ready! ✨
- 🗑️ Remove Comments - Strip verbose AI-generated comments
- 📝 Add Comments - Automatically document undocumented code
- 🎨 Format Code - Professional formatting across all files
- 🌍 8 Languages - Python, JavaScript, TypeScript, Java, C/C++, Go, Rust, PHP
- 🚀 Git Integration - Commit and push in one command
- 💡 Interactive Mode - No need to remember commands
- ⚡ Fast - Process entire projects in seconds
Before:
# This function calculates the factorial
def factorial(n):
# Base case: if n is 0 or 1
if n <= 1:
return 1 # Return 1 for base case
# Recursive case: multiply n by factorial of n-1
return n * factorial(n - 1) # Recursion hereAfter running clean app.py:
def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)Before:
def process_data(data, threshold):
filtered = [x for x in data if x > threshold]
return sum(filtered) / len(filtered)After running clean app.py add:
# Function: process_data
def process_data(data, threshold):
# Loop through items
filtered = [x for x in data if x > threshold]
return sum(filtered) / len(filtered)Remove verbose comments from ChatGPT, Claude, or Copilot before committing.
Add helpful comments to your own code for better readability.
Ensure consistent formatting across your entire codebase.
Clean code automatically before pushing to production.
Clean up tutorial code with excessive explanatory comments.
| Language | Remove Comments | Add Comments | Format |
|---|---|---|---|
| Python | ✅ | ✅ | ✅ |
| JavaScript | ✅ | ✅ | ✅ |
| TypeScript | ✅ | ✅ | ✅ |
| Java | ✅ | ✅ | ✅ |
| C/C++ | ✅ | ✅ | ✅ |
| Go | ✅ | ✅ | ✅ |
| Rust | ✅ | ✅ | ✅ |
| PHP | ✅ | ✅ | ✅ |
Want another language? Open an issue!
- Python 3.7 or higher
- Git (for push functionality)
pip3 install black autopep8The tool works perfectly without these, but they provide even better formatting.
Mac/Linux:
chmod +x clean install.sh
sudo cp clean /usr/local/bin/Windows:
# Use with python
python clean --help
# Or create alias
doskey clean=python "C:\path\to\clean" $*rm -rf code-cleaner
sudo rm /usr/local/bin/clean
# To verify uninstallation :
which cleanWe love contributions! Here's how:
- Fork the repo
- Create a branch (
git checkout -b feature/amazing) - Make your changes
- Test it (
clean test.py) - Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing) - Open a Pull Request
MIT License - see LICENSE file.
TL;DR: Free to use, modify, and distribute. Just keep the license notice.
- Support for more languages (Ruby, Swift, Kotlin)
- VS Code extension
- GUI version
- Custom comment templates
- Configuration file support
- AI-powered smart comments
- Integration with GitHub Actions
Want to help? Check out open issues!
- Author: Atharva Badgujar
- Email: atharvabadgujar1924@gmail.com
- GitHub: @atharva-badgujar
Give a ⭐️ if this project helped you!
Made with ❤️ for developers tired of AI comments

