Cursor plugin — Find and report dead code in your project: unused imports, variables, functions, exports, and unreachable code. Report-first and language-agnostic — works for any language by inferring syntax from the file. Optionally remove findings in one go when you ask.
- Structured reports — File, line, type, symbol, and a clear remediation so you can fix or remove with confidence.
- Verification-first — The agent searches the codebase for references before marking something unused, reducing false positives.
- Scope control — Run on the current file, a folder, or the whole workspace; skip paths like
node_modules and dist by default.
- Safe by default — Report only; no edits unless you explicitly ask to remove or fix dead code.
- From this repo: In Cursor, add a plugin from a Git URL:
https://github.com/raksbisht/dead-code-finder, or clone the repo and add the plugin from the dead-code-finder folder.
- From the marketplace: Install from the Cursor Marketplace when published.
/add-plugin https://github.com/raksbisht/dead-code-finder
| Skill |
Description |
dead-code-find |
Find and report dead code; language-agnostic (infers from file syntax); verify by reference search; report-only by default; optional removal when you ask. |
| Rule |
Description |
dead-code-finder-policy |
When the user asks to find/remove dead code or unused imports/exports, run the dead-code-find skill. |
| Command |
Description |
dead-code |
Run the dead-code finder (default: current file; report-only). |
- Command:
/dead-code — runs on the current file and prints a report.
- Chat:
- "Find dead code in this file" / "Find unused imports in src/" / "Audit dead code in the project"
- "Remove the dead code you found" (after a report) to apply safe removals.
- Scope examples:
- "Find dead code" → current file
- "Find dead code in src/" →
src/
- "Find unused exports in the whole project" → workspace (with skip paths applied)
| Type |
What it means |
| Unused import |
Something imported/included but never used in the file (language rules for type-only use apply). |
| Unused variable |
Declared but never read. |
| Unused function |
Defined but never called in the analyzed scope. |
| Unused export |
Exported but not referenced elsewhere in the analyzed scope (scope-only; may be used outside). |
| Unreachable code |
Code after return/throw/exit or in a branch that never runs. |
Works for any language: the agent infers import/export and control flow from the file’s syntax. Reference search is used to avoid false positives. Unused-export checks are limited to the scope you set; the report notes when something might still be used outside that scope.
MIT