/graph-it-live:dead-code-hunter Which project, folder, or file do you want to scan for dead code?from Graph-It-Live
Scans dependency graphs to find uncalled symbols and unreferenced files, producing a ranked, safety-annotated deletion plan. Useful before refactors, after feature removal, or for code hygiene.
Ships in Graph-It-Live. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Systematic scan of the dependency graph to surface orphan symbols and unreferenced files. Produces a ranked, safety-annotated deletion plan powered by Graph-It-Live.
graph-it --version and graph-it tool --list once and share them across Graph-It skills. Requires
CLI 1.21.0 or later: if older or unreadable, say so, name the missing commands, offer
graph-it update, and use only what --help and tool --list show. Do not install the CLI
automatically. Without it, use only an equivalent MCP tool the host advertises, with its exact
input schema; otherwise explain the gap.graph-it update only after explicit positive confirmation; silence, timeout, refusal, non-TTY
or generic Agent mode is not consent, an explicitly pre-authorized automatic mode is. After success,
refresh version and inventory; a running MCP server needs a host-authorized restart. On failure, keep
a usable CLI, warn once, do not retry.--format toon for everything you read; json only when a script parses the output.No graph-it scan first: every command restores .graph-it/cache/, re-analyzes changed files and
builds the reverse lookup index (who imports what, who calls what) on demand. --reindex rebuilds
from scratch when results look wrong.
Monorepos. Scanning one package finds candidates faster, but "unused" then means unused inside
that package: a sibling package may still import the export. Without --workspace the CLI uses the
nearest project marker (package.json, pyproject.toml, Cargo.toml, go.mod, ...) and exits with
code 3 outside any project; graph-it -w <dir> forces the root. If a command prints Warning: N imports resolve outside the workspace root, sibling-package imports are not indexed. Before recommending a
deletion, confirm there is no consumer from the monorepo root
(graph-it -w <monorepoRoot> tool find_referencing_files --targetPath=<path> --format toon), or state
that the result is limited to the selected package.
For a large or unfamiliar workspace, take a compact baseline before scanning:
graph-it architecture --level units --format toon
Use it to identify packages, public entry points, and generated areas that require review rather than automatic deletion.
graph-it tool scan_dead_code --format toon
graph-it tool scan_dead_code --scopePath=/abs/src --maxFiles=500 --format toon
graph-it tool scan_dead_code --minConfidence=low --format toon # every level, for review
graph-it tool scan_dead_code --verbose=true --format toon # also what was left out, and why
Declared entry points are never listed (package.json main / exports / bin / types, npm's
default index.js, Python scripts, __main__.py, __all__, a Cargo lib crate's pub items, Rust
#[no_mangle], serverless.yml and SAM template.yaml handlers), nor JSX/Vue default exports, nor
the files a graphql-codegen config generates (generatedFiles counts them). --verbose=true lists
them under excluded with the reason (declared:package.json#exports["./x"],
declared:template.yaml#Resources.Fn.Properties.Handler, generated:codegen.yml#generates["src/types.ts"],
convention:framework-default-export).
Every item carries confidence, reasons and evidence (importer count and first importers). The
default lists high items only; byConfidence counts the others and hint says how to list them:
| Confidence | Reasons | Use in the plan |
|---|---|---|
high | importers-use-other-exports: the file is imported, no importer uses the export | Deletion candidate; still run Step 3 for public API and monorepo use |
medium | test-only-use, dynamic-import-in-workspace, convention:decorated, named-in-own-file (drop export rather than delete), name-written-elsewhere (Rust), convention:test-file, convention:generated (edit the generator's input, not the file), published-deep-import (a published package without exports the workspace imports by deep path: outside projects may too) | Review; never delete without the evidence of Step 3 |
low | no-importer: nothing imports the file | Entry point by convention as often as dead (a script, a handler of another deploy tool): review only. A handler that serverless, SAM, or a Dockerfile, compose or Procfile of its folder (or above) names is a declared entry point, never listed (declared:<manifest>#CMD) |
Methods, nested functions and Rust impl members are never reported. Go, Java and C# are not scanned.
--scopePath restricts the scan to a directory inside the workspace. Without --maxFiles every
analysable file in scope is scanned (no upper bound; about 90 s for 12,000 files). --maxFiles caps it
and reports truncated=true with filesBeyondLimit when reached: report that result as partial. A scan surfaces candidates;
confirm each high-priority candidate in Step 3 before recommending deletion.
Whole files first (CLI 1.25.1 or later: unreferencedFiles appears in graph-it tool scan_dead_code --help).
On a legacy codebase, unreferenced files are the cheapest deletions; list them before the exports:
graph-it tool scan_dead_code --unreferencedFiles=true --verbose=true --format toon
graph-it check src --unreferencedFiles --format markdown # a table for a human
| Confidence | Reasons | Use in the plan |
|---|---|---|
medium | test-only-use: only tests import the file; testImporters lists them | Quick cleanup win: delete the file with those tests (or their cases on it) |
low | no-importer alone | Possible ghost file: delete unless it is run by name (script, config, tool entry) |
low | no-importer plus dynamic-import-in-workspace, convention:generated or published-deep-import | Review the reason before deleting |
low or medium | cascade: only dead files and tests import it; via lists the dead importers | Delete with (after) the files in via |
Every dead file also has tests: the test files that import nothing but dead files, to delete with it.
Dead cycles (two files importing each other, nothing else importing either) are listed by cascade.
Test files, manifest entry points, files whose path a non-test file writes (named-in:esbuild.js,
named-in:package.json, a CI workflow or task runner, working-directory and cd honoured; a lint or format config names nothing), files a bundler loads
(import.meta.glob, new URL(..., import.meta.url), an HTML page's src / href, never its inline data), JSX/Vue default exports, framework route files
(convention:framework-route: Next.js, SvelteKit, Remix / React Router, Nuxt, Astro, Expo Router, Gatsby, Storybook),
migrations folders (convention:migration), .d.ts files, tool configs (*.config.ts, .<tool>rc.ts, vercel.ts), files a folder's .gitignore
ignores and Python package __init__.py are left out (excluded with --verbose). A file a barrel re-exports counts as imported: delete an unreferenced
barrel first, then scan again.
scan_dead_code uses static analysis. A symbol may be used dynamically, from outside the indexed
workspace, or through a reference type the scan does not cover. For each symbol candidate, seek
independent incoming-reference evidence, type-only references included. Verify tool names and
parameters with graph-it tool --list and graph-it tool <name> --help first:
graph-it tool get_impact_analysis --filePath=/abs/src/a.ts --symbolName=fn --format toon # runtime and type-only dependents
graph-it tool find_referencing_files --targetPath=/abs/src/a.ts --format toon # incoming file references
query_call_graph callers describe call sites and resolved runtime references (REFERENCES:
callbacks, JSX components); they are not a complete reference check. For a file candidate, check
incoming file references and separately rule out entry points and public API use. MCP fallback: use
only the host's exact tool name and input schema.
Do not use query_call_graph callers alone for this check: they hold calls and resolved references only, so a symbol re-exported, passed through a name the graph cannot resolve, or used as a type (MCP and CLI leave USES out without includeTypeOnly) reports 0 callers while still in use.
A ghost file may contain multiple symbols. Do not recommend deleting it until incoming-reference checks, entry-point checks, and external/public-use review are complete.
Apply this risk classification:
| Risk Level | Criteria | Action |
|---|---|---|
| Candidate for safe review | No relevant incoming references confirmed (including type-only references when supported); not a public API export or entry point | Review manually before deletion |
| Possible ghost file | No incoming file references confirmed and not an entry point | Review file contents and external/public use |
| Unconfirmed | Only call sites checked, confirmation unavailable/partial, or relevant reference types unsupported | Do not recommend deletion |
| Review first | Symbol is exported from a barrel (index.ts) | Check if barrel is consumed externally |
| Do not delete | Dynamic call patterns detected (eval, string-based dispatch) | Flag only |
| Test-only | Only called from test files (test-only-use, medium) | Evaluate — may be intentional |
| Test-only file | unreferencedFiles item at medium: only its testImporters import it | Delete with its tests — a quick cleanup win |
Write a Deletion Plan with the template in references/report-template.md: scan totals, possible
ghost files, symbol candidates for manual review, barrel exports to review first, test-only symbols,
then the recommended deletion order. Every row states its reference evidence.
package.json exports field — symbols exported via package entry points are always liveline is the declaration's first line, not its JSDocnoUnusedLocals, ESLint) — delete it in the same batchgraph-it check src/utils/format.ts --format toon
find_unused_symbols is file-scoped; graph-it check takes a file, a folder or nothing (the whole
workspace), like scan_dead_code with --scopePath. Both take --minConfidence; a scan
(graph-it check [folder] --verbose) also lists the excluded exports with their reason.
obj[methodName](), require(variable)) is invisible to static analysis — always review before deleting@Component, @Injectable) may make symbols appear unused but they're resolved at runtime — exclude framework entry files from the scanWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
dead-code, unused-code, code-cleanup, dependency-graph, refactoring
5 skills in this plugin
/graph-it-liveAnalyze code dependencies, call graphs, and architecture using the graph-it CLI. Use this skill
whenever the user wants to understand how their code is connected — even if they don't say
"dependency graph" explicitly. Trigger for: "what calls this function", "who uses this class",
"is it safe to delete X", "what breaks if I change Y", "show me the architecture", "trace the
execution from main", "find circular imports", "give me an overview of this module", "what imports
this file", "impact analysis", "review this PR", "review this diff",
"is this change risky", breaking changes, unused exports, dead code detection, codemap, file logic,
module resolution, graph-it, dependency graph, reverse dependencies.
/graph-it-refactorUse when refactoring multiple files, changing exported signatures or interfaces, moving or renaming symbols, deleting dead code, reorganizing dependencies, or fixing complex regressions. Maps impact with Graph-It-Live before editing, then verifies after./onboarding-expressAI-guided architectural tour of any codebase — entry points, business logic, and the most complex
module in one structured pass, powered by Graph-It-Live. Use this skill whenever someone is new to
a codebase or wants a quick orientation. Trigger for: "I just joined this team", "explain this repo
to me", "give me a project overview", "where is the main logic", "what is the entry point",
"I need to understand the architecture before starting", "walk me through this codebase",
"which module is the most complex", "find the business logic", "I'm about to refactor and need
to understand the structure first", onboarding, project walkthrough, architecture tour,
découvrir le projet, visite guidée, point d'entrée, logique métier, module complexe.
/pr-reviewReview pull requests and Git diffs with Graph-It-Live risk, breaking-change, dependency-impact,
cycle, unused-export, and test-candidate evidence. Use when asked to review a PR, inspect a diff,
assess merge risk, check a branch before merging, create a Graph-It-Live review gate, or explain
review-pr results. Trigger for: "review this PR", "review this diff", "is this safe to merge",
"check merge risk", "analyze changed files", "PR review", "code review my branch", "revoir cette PR",
"analyser ce diff", "risque de merge".
npx claudepluginhub magic5644/graph-it-live --plugin graph-it-liveOther plugins' skills for the same job