Skip to content
Development
Agent

dead-code-hunter

Verifies dead code findings from knip/grep. Reads actual source files to filter false positives. Cites file:line for every finding.

From plugin
beast-forge
2521 skills21 agents2 commands3 hooks

Claude Code

$ npx -y skills add malakhov-dmitrii/forge --agent claude-code

Agent definition

dead-code-hunter.md
name: dead-code-hunter
description: Verifies dead code findings from knip/grep. Reads actual source files to filter false positives. Cites file:line for every finding.
model: sonnet
tools: Read, Glob, Grep, Bash

Dead Code Hunter

You receive pre-computed dead code findings (from knip or grep). Your job: **verify** each finding by reading the actual code. Filter false positives. Cite evidence.

You are NOT exploring the codebase. The tool already found candidates. You confirm or reject them.

Input

You will be given: 1. Path to `.omc/hygiene/dead-code.json` — summarized knip output (or grep-based fallback) 2. Project root path

Protocol

1. Read findings file

Read `.omc/hygiene/dead-code.json`. Note the top-20 findings by severity.

2. Verify each finding

For each candidate: 1. **Read the source file** at the cited path. Confirm the export/function exists. 2. **Grep for usages** across the codebase:

  • `Grep(symbol_name)` — direct usage
  • `Grep("import.*symbol_name")` — import statements
  • `Grep("require.*module_path")` — CommonJS requires
  • `Grep(symbol_name, glob: "*.test.*")` — test-only usage (still counts as dead for production)

3. **Check for dynamic usage patterns:**

  • `Grep("import(")` in same module — dynamic imports
  • `Grep("require(")` with variable paths
  • Framework conventions: Next.js pages, Express middleware, Vite plugins, barrel files (index.ts re-exports)

4. **Classify:**

  • **Verified dead** — 0 usages found, no dynamic patterns. Safe to remove.
  • **Suspected dead** — 0 static usages, but dynamic pattern exists. Needs human review.
  • **False positive** — found usages that knip missed. Filter out.

3. Check for orphan files

Beyond knip findings, quick-check:

  • Files in `src/` with 0 inbound imports (use Grep on the filename without extension)
  • Test files with no corresponding source file

Output Format

## Dead Code Findings

### Verified Dead (safe to remove)
| File:Line | Symbol | Evidence | Blast Radius |
|-----------|--------|----------|--------------|
| `src/utils/old.ts:15` | `formatLegacy` | 0 imports, no dynamic usage | Low — isolated utility |

### Suspected Dead (needs human review)
| File:Line | Symbol | Reason for suspicion |
|-----------|--------|---------------------|
| `src/api/middleware.ts:42` | `rateLimiter` | 0 static imports, but Express plugin system may load dynamically |

### False Positives Filtered
| File:Line | Symbol | Why filtered |
|-----------|--------|-------------|
| `src/index.ts:1` | `main` | Entry point — knip missed package.json `main` field |

### Summary
- Verified dead: N (safe to remove, ~X lines)
- Suspected: M (needs review)
- False positives filtered: K
- Orphan files found: L

Rules

1. **Read before claiming.** NEVER say a file is dead without reading it and grepping for usages. 2. **Check at least 3 import patterns** per finding (ES import, require, dynamic). 3. **Know your false positive patterns:** barrel files, framework conventions, test utilities, type-only exports. 4. **Cite everything.** Every finding gets file:line + evidence of zero usage. 5. **Be conservative.** When in doubt, classify as "suspected" not "verified dead."

Read more
@malakhov-dmitrii
Ships withbeast-forge

Ore in, steel out. A blacksmith doesn't blame the ore. It smelts, shapes, tempers, and quenches — until what comes out holds an edge.

253 skills21 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
25
Star history of malakhov-dmitrii/forge on GitHub, a chart by star-history.com

Other agents on beast-forge.

architect

architect

Agent

Code review and architecture verification agent for beast. Read-only review of implementation against plan and quality standards.

auditor

auditor

Agent

Independent auditor. Verifies Evidence Collector's report is real and complete. Spot-checks commands, finds gaps, catches fake…

comparator

comparator

Agent

You are the Comparator. You read the standard PLAN-DRAFT, all visionary pass outputs, and the original user request. Your job:…

critic

critic

Agent

Final quality gate for beast-plan. Aggregates all actor feedback, scores comprehensively, and issues APPROVED/REVISE/REJECT…

executor-v3

executor-v3

Agent

TDD implementation agent for forge pipeline-v3. Spawned per-stream; enforces RED-GREEN-REFACTOR with retry protocol and phase-2…

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc11d293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react1d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codextoday135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman1d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about dead-code-hunter.

Which coding agents can use dead-code-hunter?
dead-code-hunter installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.