Dead code detection strategies, safe removal processes, dependency pruning, and bloat metrics for systematically reducing codebase dead weight. Use when evaluating codebase health during architecture-audit, performing cleanup during cook, reviewing unused dependencies, removing commented-out code, or measuring code bloat.
Identifies and safely removes dead code, unused dependencies, and commented-out blocks to reduce technical debt and improve codebase health.
npx claudepluginhub smileynet/code-spiceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
| Approach | How It Works | Confidence | Limitation |
|---|---|---|---|
| Static analysis | Parse AST, trace references | High for unused exports/functions | Misses dynamic dispatch, reflection |
| Dynamic analysis | Runtime instrumentation, coverage | High for executed paths | Misses rarely-used paths (disaster recovery, seasonal) |
| Combined (SCARF) | Static + dynamic + team review | Highest | Requires team coordination |
| Manual review | Human inspection, git blame | Variable | Doesn't scale; subjective |
| Phase | Action | Checkpoint |
|---|---|---|
| Survey | Run static analysis tools; identify candidates | Candidate list generated |
| Classify | Categorize each: dead, dormant, speculative, deprecated | Each candidate classified |
| Announce | Deprecation warnings; notify stakeholders | Team aware of pending removals |
| Remove | Delete with tests verifying no breakage | All tests pass after removal |
| Follow-up | Monitor production for regressions; verify no side effects | No production issues after 1 week |
For smaller teams: Compress Announce into a PR description or commit message. The key phases are Survey, Classify, and Remove-with-tests.
| Language | Tool | Notes |
|---|---|---|
| JS/TS | Knip | Supersedes ts-prune; handles re-exports, dependencies, and unused files |
| JS/TS | depcheck | Focused on unused npm dependencies |
| Python | Vulture | AST-based dead code detection; configure --min-confidence 80 |
| Python | autoflake | Removes unused imports and variables |
| Java | PMD | Static analysis rules for unused code |
| Go | deadcode | Official Go team tool (1.22+); superior to unused |
| Multi | SonarQube | Cross-language; includes unused code rules |
| False Positive | How to Verify |
|---|---|
| Peer dependency | Check if required by another installed package |
| CLI tool | Check npm scripts, Makefile, CI config |
| Plugin/loader | Check config files (webpack, babel, pytest, etc.) |
| Type-only import | Check .d.ts files and type annotations |
| Indicator | Healthy | Warning | Critical |
|---|---|---|---|
| Unreachable code ratio | <5% | 5-15% | >15% |
| Unused dependency count | 0-2 | 3-5 | >5 |
| Commented-out code blocks | 0 | 1-5 | >5 |
| Single-implementation interfaces | <3 | 3-10 | >10 |
| Evidence | Confidence | Action |
|---|---|---|
| Zero static references + zero runtime coverage | High | Delete (with tests) |
| Zero static refs but in error/recovery path | Medium | Verify with team before deleting |
| Referenced only by tests | Medium | Delete code and tests together |
| Referenced by commented-out code only | High | Delete both |
| Dynamic dispatch possible (reflection, eval) | Low | Instrument before deleting |
| Signal | Action |
|---|---|
| Zero imports in source code | Remove (check for false positives first) |
| Only in devDependencies, not used in scripts | Remove |
| Imported but functionality is unused | Replace with lighter alternative or remove |
| Peer dependency of another package | Keep — removing breaks the dependent |
| Last updated >2 years, no maintained fork | Plan migration to maintained alternative |
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.