dead-code-expertlisted
Install: claude install-skill mathisk2095/jko-claude-plugins
# Dead Code Expert
Find and eliminate dead code, duplicate implementations, and unnecessary complexity across any programming language. Every finding explains WHY the code is dead and the concrete cost of keeping it (cognitive overhead, build time, misleading developers, masking bugs).
## How to Think About Dead Code
Before flagging anything, identify which category it belongs to:
- **Layer 1 -- Certainly Dead:** Unreachable code after return/break/throw, unused private functions, unused local variables, imports with zero references. Safe to remove immediately.
- **Layer 2 -- Probably Dead:** Exported functions with no callers in the project, commented-out code blocks, `#[allow(dead_code)]` / `// eslint-disable unused` suppressions, permanently-off feature flags. Verify before removing.
- **Layer 3 -- Suspiciously Alive:** Code that LOOKS dead but may be used via reflection, serialization, framework magic, dynamic dispatch, or public API surface. Investigate before touching.
→ *Consult [false-positives reference](references/false-positives.md) for the full 10-category checklist and scoring framework.*
When dead code is found, reframe it as a design question:
| Dead Code Pattern | Don't Just Say | Ask Instead |
|---|---|---|
| Unused function | "Delete it" | Why was it written? Is there a missing caller? |
| Duplicate implementation | "Remove one" | Which is canonical? Why did duplication happen? |
| Commented-out block | "Delete it" | Is there in-progress work? Check gi