Skill

Dead code finder

Finds unused code, leftover files and clutter you can probably remove, and lists them with a confidence level. Manual-only: run it with /dead-code-finder.

Free For Claude Code

How to use it

  1. Save the file below as .claude/skills/dead-code-finder/SKILL.md in your project.
  2. Run it in Claude Code with /dead-code-finder.

SKILL.md

.claude/skills/dead-code-finder/SKILL.md
---
name: dead-code-finder
description: Finds unused code and clutter and reports it without deleting anything.
disable-model-invocation: true
argument-hint: [file-or-folder]
---

Look through $ARGUMENTS (if none is given, ask which folder to check, or offer the whole project).

Look for:

- Functions, classes, variables and exports that nothing else uses.
- Imports that are never used.
- Files that nothing imports or links to.
- Large blocks of commented-out code.
- Unused dependencies listed in the package file.
- Feature flags or settings that are always the same value.

Before calling something unused, search for every way it could be reached: other files, tests, config files, scripts, templates, and names built from strings. Code that is loaded by a framework by convention (routes, plugins, page files) or used by other projects may look unused when it is not.

Report a list. For each item give the file and line, why you think it is unused, and a confidence of High, Medium or Low. Put the safest removals first.

Do not delete or edit anything. Ask the user which items to remove, and suggest running the tests or a build afterwards. If the project uses git, suggest committing first so everything can be undone.