code-cleaner

Remove unused code from changed TypeScript/JavaScript files via git diff analysis.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/gihwan-dev/claude-setup --skill code-cleaner-gihwan-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-cleaner
Source: https://github.com/gihwan-dev/claude-setup/tree/main/skills/code-cleaner
Command: npx skills add https://github.com/gihwan-dev/claude-setup --skill code-cleaner-gihwan-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the removal of unnecessary code, such as dead exports, unused functions, and leftover console logs, from your TypeScript/JavaScript files after AI code generation or development.

Core Features & Use Cases

  • Dead Code Elimination: Identifies and removes unused exports, functions, types, and interfaces.
  • Console Log Removal: Cleans up debugging console.log statements.
  • Git Diff Analysis: Focuses on changes within specified files using git diff.
  • Adaptive Parallelization: Optimizes analysis for a small number of files (sequential) versus a larger number (parallel analysis, sequential modification).
  • Use Case: After an AI assistant generates a complex code module, use this Skill to ensure only the essential, actively used code remains, improving code quality and maintainability.

Quick Start

Use the code-cleaner skill to remove unused code from the files changed in the current git diff.

Frequently Asked Questions about code-cleaner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically remove dead code and unused exports from changed TypeScript files?

You can remove dead code and unused exports from changed TypeScript files by analyzing git diffs to identify and delete unused functions, types, and interfaces. This Skill targets modified files to eliminate unnecessary code, ensuring only actively used code remains for better maintainability.

What is the best way to clean up console logs and unused functions after AI code generation?

Cleaning up console logs and unused functions after AI code generation is best handled by automating code hygiene through git diff analysis. This identifies and removes leftover debugging statements and dead code, ensuring only essential, actively used code remains in your project.

Does this dead code removal tool analyze the entire repository or just the changed files?

This dead code removal tool analyzes just the changed files by evaluating git diffs, rather than scanning the entire repository. It focuses on modifications in your TypeScript and JavaScript files to selectively eliminate unused exports, functions, and console logs.

How does adaptive parallelization handle dead code elimination for multiple JavaScript files?

Adaptive parallelization handles dead code elimination by sequentially analyzing a small number of JavaScript files, while processing larger sets through parallel analysis followed by sequential modification. This optimizes the cleanup of unused code across multiple changed files efficiently.

Can I use this tool to remove unused types and interfaces from my JavaScript project?

Yes, you can remove unused types and interfaces from your JavaScript project using this tool. It identifies and eliminates dead exports, unused functions, types, and leftover console logs by analyzing the git diff of your changed files.

When should I not use automated refactoring to remove unused code?

You should not use automated refactoring to remove unused code when your files have not been tracked by git or lack recent diffs, as this tool relies on git diff analysis to identify changes. It is specifically designed to clean up modified TypeScript and JavaScript files.