/codebase-maintenance:dead-code-removalfrom codebase-maintenance
Identifies and safely deletes unused functions, classes, exports, and files. Verifies unused across repo, handles dynamic references, prunes imports, and runs tests.
Ships in codebase-maintenance. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Dead code increases maintenance overhead and confuses developers. Verify a symbol is truly unused across the entire repository, then delete it outright — never comment it out.
Verify unused — search the entire repository. Do not assume code is dead just because the current file doesn't use it:
grep -rn "symbolName" . --include="*.ts" --include="*.tsx" # all references
grep -rn "from ['\"].*module-name" src/ # import sites
git log -3 --oneline -- path/to/suspect-file # recent touches
Ecosystem tools can shortcut the inventory when available (e.g., knip or ts-prune for TypeScript exports, vulture for Python).
Check for dynamic invocation. Be wary of dynamically invoked code — reflection, dependency injection by string name, ORM mappers, route tables, config-driven dispatch:
grep -rn "\"symbolName\"\|'symbolName'" . # string-keyed references
If there is any doubt, leave it alone or ask the user.
Delete aggressively. Once confirmed unused, delete the code. Do not comment it out.
Prune dependencies. If you delete the only code that was using an imported module, remove the import statement as well.
Run tests. Always run tests and/or type checkers (e.g., tsc --noEmit) after removal to ensure you didn't accidentally break a hidden dependency.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dead-code, code-cleanup, refactoring, tree-shaking, code-maintenance
npx claudepluginhub yeaight7/agent-powerups --plugin codebase-maintenance9 skills in this plugin
/ai-slop-cleanerUse when a working code path feels bloated, noisy, or over-abstracted, when asked to clean up or deslop AI-generated code, or when a reviewer-only anti-slop pass is requested./architecture-simplificationUse when a codebase carries over-engineered abstractions, unnecessary layers, or redundant logic that should be collapsed without changing behavior./context-retrieval-loopUse when about to refactor, rename, or remove code, assessing dead code before deletion, or unsure of the blast radius of a change./dependency-cleanupUse when package manifests carry unused or redundant third-party dependencies that slow builds, widen the security surface, or complicate updates./incremental-migrationUse when migrating APIs, libraries, or patterns across a large codebase and a single mega-commit would be too risky to review or merge./naming-and-structure-cleanupUse when naming conventions or file structure drift across a project and need to be made consistent without changing business logic.Other plugins' skills for the same job