unused-code-cleaner

Detects and removes unused exports, functions, and TS/JS types using git diff analysis.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI-generated code can leave dead or unused code that bloats projects. This skill automatically detects and removes such code from changed TS/JS files to keep codebases lean.

Core Features & Use Cases

  • Detects unused exports, functions, and types by analyzing git diffs and project usage.
  • Removes dead code while preserving necessary exports and safety checks.
  • Use Case: after AI-generated edits, run this skill to prune the modified files and reduce maintenance effort.

Quick Start

Run the cleanup on the latest changes to automatically remove unused code from TS/JS files.

Frequently Asked Questions about unused-code-cleaner

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

FAQPage Schema
How do I automatically remove dead code from TypeScript files after AI edits?

You can automatically remove dead code from TypeScript files by analyzing git diffs and project usage to identify and prune unused exports, functions, and types. This approach uses static analysis with safety checks to ensure referenced code is preserved.

What is the best way to clean up unused exports and functions in a JavaScript codebase?

The best way to clean up unused exports and functions in a JavaScript codebase is to perform diff-based detection and static analysis of code patterns. This allows you to target only unused code while preserving necessary functional behavior.

Can I use git diff analysis to find unused code in TS/JS projects?

Yes, you can use git diff analysis to find unused code in TS/JS projects. By analyzing the latest changes against project usage, you can deterministically detect and remove unused exports, functions, and types from the modified files.

Does automated dead code removal work safely across large codebases?

Automated dead code removal works safely across large codebases by using static analysis and configurable granularity. Built-in safety checks ensure that only unused code is targeted and all referenced code is preserved during the cleanup process.

What are the limitations of using static analysis for dead code removal in JavaScript?

A limitation of using static analysis for dead code removal in JavaScript is that it primarily targets unused exports, functions, and types within changed files. It relies on diff-based detection and safety checks to avoid removing actively referenced code.

When do I need to run code cleanup for AI-assisted code generation workflows?

You need to run code cleanup for AI-assisted code generation workflows immediately after AI edits are applied. This ensures that any dead or unused code left behind by the generation process is pruned, keeping the codebase lean and reducing maintenance effort.