
Code Comment Cleaner
Safely detect and remove dead commented-out code while preserving TODOs, notes, and license headers.
- Strip abandoned logic from legacy files before a major refactor.
- Automate codebase technical debt cleanup during PR preparation.
- Identify and remove stale code blocks while keeping critical TODOs and notes.
Secure checkout via Stripe
Included in download
- Strip abandoned logic from legacy files before a major refactor.
- Identify and remove stale code blocks while keeping critical TODOs and notes.
- terminal, file_read, file_write automation included
- Includes example output and usage patterns
See it in action
A real example of what this skill takes in and produces.
Sample output
PREVIEW: 3 candidate removals found.
- lib/auth.ts [L42-45]: Commented-out 'if' block.
- main.py [L12-18]: Block contains 'def' and 'return'. PRESERVED:
- utils.js [L5]: Preservation reason: Contains 'TODO'. Cleanup requires confirmation. Shall I create .bak files and proceed?

Code Comment Cleaner
Safely detect and remove dead commented-out code while preserving TODOs, notes, and license headers.
Secure checkout via Stripe
Included in download
- Strip abandoned logic from legacy files before a major refactor.
- Identify and remove stale code blocks while keeping critical TODOs and notes.
- terminal, file_read, file_write automation included
- Includes example output and usage patterns
- Instant install
See it in action
A real example of what this skill takes in and produces.
Sample output
PREVIEW: 3 candidate removals found.
- lib/auth.ts [L42-45]: Commented-out 'if' block.
- main.py [L12-18]: Block contains 'def' and 'return'. PRESERVED:
- utils.js [L5]: Preservation reason: Contains 'TODO'. Cleanup requires confirmation. Shall I create .bak files and proceed?
About This Skill
The Intelligent Surgical Cleaner for Your Codebase
Code Comment Cleaner is a specialized tool designed to automate the tedious task of "spring cleaning" technical debt. It identifies and removes dead, commented-out code blocks that clutter your files, making your codebase more readable and maintainable without the risk of losing important context.
How it Works
Unlike simple regex deletes, this skill uses a sophisticated two-pass logic. First, it identifies "code indicators" (like brackets, keywords, and assignments) within comments to detect abandoned logic. Second, it runs a strict set of preservation rules. It explicitly protects:
- TODOs, FIXMEs, and developer notes
- License headers and copyright notices
- Disabled tests and natural language documentation
- Multi-line prose and architectural explanations
Safety First Workflow
Built for a developer's peace of mind, the skill never deletes blindly. It generates a detailed preview report showing exactly which lines are targeted and why. Upon confirmation, it creates .bak backups before applying changes. It supports JavaScript, TypeScript, Python, Java, Go, Rust, HTML, and CSS.
Why Pay for This?
Prompting a generic AI to "clean my code" often results in lost documentation or broken license headers. This skill provides a deterministic, repeatable, and safe framework that handles multi-line syntax across 8+ languages while respecting the human-written notes you actually need to keep.
Use Cases
- Strip abandoned logic from legacy files before a major refactor.
- Automate codebase technical debt cleanup during PR preparation.
- Identify and remove stale code blocks while keeping critical TODOs and notes.
- Safely clean multi-language projects (JS, Python, Go) with automated backups.
Known Limitations
- Preview mode is highly recommended before deletion
- May mistake heavily commented code as explanatory (review preview)
- Does not distinguish between intentionally disabled code and dead code
- License headers preserved by default (can be overridden)
- Works best with language-native comment syntax
- Single file mode is more accurate than bulk scanning
How to Install
mkdir -p ~/.claude/skills && curl -sL https://www.agensi.io/api/install/code-comment-cleaner | tar xz -C ~/.claude/skills/Free skills install directly. Paid skills require purchase - use the download button above after buying.
Reviews
No reviews yet - be the first to share your experience.
Only users who have downloaded or purchased this skill can leave a review.
Early access skill
Be the first to review this skill.
Only users who have downloaded or purchased this skill can leave a review.
Security Scanned
Passed automated security review
Permissions
File Scopes
Code Comment Cleaner needs terminal access to run find commands for scanning multiple files and to create backup copies. File read access scans source files for commented code patterns. File write access only occurs after user explicitly confirms "yes" to cleaning; it then creates a .bak backup and writes the cleaned version. No browser, network, or environment access required.
Works with Claude Code and Codex. Creates backups as `.bak` files before any deletion. User confirms each file before changes.