get_dead_code
Identifies unused code in projects using import/call graph analysis or entry-point reachability detection to help developers remove unnecessary files and improve codebase maintainability.
Instructions
Dead code detection. Two modes: (1) "multi-signal" (default) combines import graph, call graph, and barrel export analysis with confidence scores. (2) "reachability" runs forward BFS from auto-detected entry points (tests, package.json main/bin, src/{cli,main,index}, routes, framework-tagged controllers) — stricter but more accurate when entry points are enumerable. Pass entry_points to add custom roots. Both modes emit _methodology and _warnings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_pattern | No | Filter by file glob pattern (e.g. "src/tools/%") | |
| threshold | No | [multi-signal mode] Min confidence to report (default: 0.5 = at least 2 of 3 signals) | |
| limit | No | Max results (default: 50) | |
| mode | No | Detection algorithm (default: multi-signal) | |
| entry_points | No | [reachability mode] Extra entry-point file paths (repo-relative) |