CodeSweep is a lightweight, open-source VS Code extension that helps you clean your code by removing all comments and debug logs in one click.
Perfect for preparing production-ready code or cleaning up before sharing with teammates.
- 🗑️ Remove all single-line comments (
//,#,--,;, etc.) - 🧼 Remove all multi-line comments (
/* ... */,<!-- ... -->, etc.) - 🐞 Clean up debug statements like
console.log,print(),System.out.println, etc. - 🌐 Supports 30+ popular languages (JavaScript, HTML, Python, PHP, C++, etc.)
- ⚡ Simple, fast, and effective
- Open the VS Code Marketplace
- Click Install
Or install via the VS Code command palette:
- Open any code file
- Press
Ctrl+Shift+PorCmd+Shift+Pon Mac - Type and run:
CodeSweep: Clean Code - 💥 Done! Comments and debug logs are gone
You can also run CodeSweep commands directly from the right-click menu inside your code editor.
- Open a supported code file (e.g.,
.js,.py,.java,.html, etc.) - Right-click anywhere in the editor
- Select one of the CodeSweep commands, like:
- CodeSweep: Clean Code
- CodeSweep: Remove All Comments
- CodeSweep: Remove Single Line Comments
- CodeSweep: Remove Multiline Comments
- CodeSweep: Remove Debug Logs
This offers a quick and convenient way to clean your code without using the Command Palette.
CodeSweep offers 4 useful commands. You can access them all via the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on Mac).
codesweep.cleanCode✅ Recommended Command – Runs a full cleanup of your code.
This command executes:
- Remove Multiline Comments
- Remove Debug Logs
Ideal before pushing to production or sharing your code.
codesweep.removeAllComments✅ Removes all single-line and multi-line comments from the entire file.
Examples removed:
// This comment is gone
/* This too */
/*
Multi-line
block removed
*/
<!-- This in HTML is also removed -->codesweep.removeSingleLineComments✅ Only removes single-line comments, preserving multiline ones.
Examples removed:
# A Python comment
// A JS comment
-- A SQL commentcodesweep.removeMultilineComments✅ Removes only multi-line comments, useful when you want to preserve inline hints.
Examples removed:
/*
This block is gone
*/
// This one stays<!-- HTML-style comments are removed -->codesweep.removeDebugLogs✅ Detects and removes debug logs like:
console.log("Hello")
print("Debug")
System.out.println("Trace")
debugger;And many more, depending on language.
Helps prevent accidental debug logs in production code.
Includes but not limited to:
- JavaScript, TypeScript, HTML, CSS
- Python, PHP, Ruby, Go, Rust, C/C++, Java
- Bash, PowerShell, Shell, YAML, JSONC, XML, etc.
Because no one wants to ship console.log("hello") or outdated comments to production 😉
CodeSweep helps keep your codebase clean, professional, and production-ready.
Contributions are now open!
- 📖 Please read our Contribution Guide
- 🐛 Found a bug or have a suggestion? Open an issue Thank you for helping make CodeSweep better! 🙌
MIT License – free to use, modify, and distribute.
Open an issue here 👉 GitHub Issues
