Skip to content
Back to skills

Deadcode

ASecurity

find and remove dead code. scans for unused files, exports, dependencies, and types using knip. lists every finding with reasoning before deleting anything. Triggers: deadcode, dead code, unused code, clean up code, remove unused, prune dependencies.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 16, 2026
ai-agentstypescriptbashapi

Works with

  • api

Security analysis

A100/100

Scanned October 16, 2026

npx -y skills add tommylower/cortex --skill deadcode --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Deadcode?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Deadcode
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tommylower-deadcode/badge)](https://www.skillsdirectory.com/skills/tommylower-deadcode)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: deadcode
description: "find and remove dead code. scans for unused files, exports, dependencies, and types using knip. lists every finding with reasoning before deleting anything. Triggers: deadcode, dead code, unused code, clean up code, remove unused, prune dependencies."
---

# deadcode

scan the project for unused code, list every finding with reasoning, then clean up after approval.

## steps

1. **run knip** to detect dead code:
   ```bash
   npx knip
   ```

2. **present findings as a table** with columns:
   - item (file, export, dependency, or type)
   - location (file path and line number)
   - reason it's flagged (nothing imports it, no file references it, etc.)

3. **verify each finding** before recommending deletion:
   - grep the codebase for references (imports, dynamic requires, string references)
   - check if it's used in scripts, configs, or tests that knip might miss
   - check if it's a public API entry point that external consumers use
   - flag anything uncertain as "needs review" instead of "safe to delete"

4. **wait for approval** before making any changes. never auto-delete.

5. **after approval**, make changes and run the build to confirm nothing broke.

## what it catches

- **unused files**: components, utils, pages that nothing imports
- **unused exports**: exported functions, types, constants that nothing outside the file uses
- **unused dependencies**: packages in package.json that no file imports
- **unused devDependencies**: dev packages that no config or script references
- **unlisted dependencies**: packages used in code but missing from package.json
- **unused types**: exported TypeScript types with no external consumers

## rules

- never delete without showing findings and getting approval first
- always verify with grep before calling something unused. knip can miss dynamic imports, barrel files, and config references
- always run the build after cleanup to catch breakage
- if a dependency is only used in a script (not src/), check scripts before flagging
- commit cleanup separately from feature work

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.