unused-code-cleaner

Detect and remove unused imports, functions, and classes in Python, JavaScript, and Java.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/wollfoo/codex-cli --skill unused-code-cleaner-wollfoo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unused-code-cleaner
Source: https://github.com/wollfoo/codex-cli/tree/main/skills/unused-code-cleaner
Command: npx skills add https://github.com/wollfoo/codex-cli --skill unused-code-cleaner-wollfoo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill identifies and removes unused code elements such as imports, functions, and classes across various programming languages, helping to maintain a clean and efficient codebase.

Core Features & Use Cases

  • Static Code Analysis: Detects dead code using AST and module analysis.
  • Multi-language Support: Works with Python, JavaScript, and Java.
  • Safe Removal: Implements validation and backup procedures before deletion.
  • Use Case: After refactoring a large Python project, use this Skill to automatically find and remove any functions or imports that are no longer called, reducing code bloat and potential errors.

Quick Start

Run the unused-code-cleaner skill to analyze the current project for dead code and suggest removals.

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 detect and remove dead code in Python, JavaScript, and Java?

Dead code removal is handled by performing static code analysis to build dependency graphs and identify unused imports, functions, and classes across Python, JavaScript, and Java. It then executes incremental removal with safety checks and validation.

What is static code analysis for dead code and when should I run it?

Static code analysis for dead code identifies unused elements like imports and classes without executing the program. You should run it proactively after refactoring, feature removal, or before production deployment to ensure code hygiene and reduce bloat.

Can this dead code cleaner safely remove unused functions without breaking my project?

Yes, it safely removes unused functions by implementing validation and backup procedures before deletion. It builds dependency graphs and executes incremental removal with safety checks to ensure project integrity is maintained.

Does this static analysis tool work for finding unused imports across multiple programming languages?

Yes, this static analysis tool works for finding unused imports across multiple programming languages. It specifically supports Python, JavaScript, and Java by analyzing abstract syntax trees and module dependencies to locate dead code.

What's the best way to clean up unused classes and functions after a major refactoring?

The best way to clean up unused classes and functions after refactoring is to run a static analysis skill that builds dependency graphs to automatically find and safely remove dead code elements that are no longer called.

Are there limitations to removing dead code through automated static analysis?

Automated dead code removal through static analysis relies on AST and module analysis to build dependency graphs. While it includes safety checks and validation before incremental deletion, dynamic calls or reflection might not be detected by static analysis alone.