3
    Code Comment Cleaner

    Code Comment Cleaner

    by JustHandled Labs

    Find and remove commented-out dead code across 8 languages (JS, TS, Python, Java, Go, Rust, HTML, CSS) while preserving TODOs, FIXMEs, license headers, disabled tests, and real documentation. Previews every change first and writes .bak backups before it touches a file.

    Updated Jun 2026
    Security scanned

    $5

    · or 25 credits

    30-day refund guarantee

    Secure checkout via Stripe

    Also available in a bundle

    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

    Sample input

    Run a --dry-run to find dead commented-out code in the current directory and show me what would be removed or preserved.

    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.

    Reviews

    No reviews yet - be the first to share your experience.

    Only users who have downloaded or purchased this skill can leave a review.

    Security Scanned

    Passed automated security review

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    **/*.js
    **/*.ts
    **/*.py
    **/*.java
    **/*.go
    **/*.rs
    **/*.html
    **/*.css
    **/*.bak

    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.

    Creator

    JustHandled Labs builds focused agent skills for the work nobody wants to do by hand. Each one is a single repeatable job done well: catching the security and data mistakes that quietly ship, keeping docs and tests honest, gating the commands an agent is about to run, sharpening writing, and handling the founder chores around launches, outreach, and brand setup. Not generic AI productivity. Specific workflows that are easy to run, review, and repeat. Maintained by H.J. Westerfield, with a background in communications, editing, project coordination, customer support, and practical AI systems. Tools for people who want useful automation without theatrical complexity.

    Frequently Asked Questions

    More Premium Skills