dead-code-eliminator

dead-code-eliminator is a skill for Claude Code, Codex from SkillMedev/legacy-modernization. It costs 90 tokens per session (894 once invoked), scanned A, a copy of dead-code-eliminator, MIT.

A guided workflow for proving that code is no longer reachable before deleting it, including related tests, fixtures, configuration, and feature flags.

In plain words
What is it for?
Use it when cleaning up after a migration, retiring a feature, shrinking a large module, or estimating work in an unfamiliar codebase.
Why use it?
It reduces the risk of removing code that is still used indirectly, such as through string-based lookups, registries, scheduled jobs, or runtime configuration.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when cleaning up after a migration, retiring a feature, shrinking a large module, or estimating work in an unfamiliar codebase.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmedev/legacy-modernization/dead-code-eliminator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SkillMedev/legacy-modernization --skill dead-code-eliminator
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/legacy-modernization

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dead-code-eliminator

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/dead-code-eliminator/github.svg)](https://agentmods.dev/skills/skillmedev/legacy-modernization/dead-code-eliminator)
Your own site
<a href="https://agentmods.dev/skills/skillmedev/legacy-modernization/dead-code-eliminator"><img src="https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/dead-code-eliminator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dead-code-eliminator

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmedev/legacy-modernization/dead-code-eliminator"><img src="https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/dead-code-eliminator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 894 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00090 $0.00894
Opus 5.5 $0.00036 $0.00358
Sonnet 5.5 $0.00018 $0.00179
Haiku 4.5 $0.00009 $0.00089

Measured 20d ago against content hash 960a4568cb4b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dead-code-eliminator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to dead-code-eliminator — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/dead-code-eliminator/SKILL.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Dead Code Eliminator

Delete code only after converging evidence proves it dead, then remove it in reversible slices that include its tests, fixtures, config, and flags.

Workflow

  1. Scope one cluster. Pick a single symbol, file, or feature to prove dead. Do not batch unrelated removals - a regression must point to one change.
  2. Gather static evidence. Run the language's dead-code detector (ts-prune or knip for TS/JS, vulture for Python, deadcode for Go) and a dependency grapher (madge) or IDE "find usages". Record what each reports unreachable.
  3. Gather runtime evidence. Check production coverage or profiling data over a representative window - at least 30 days for user-facing paths, 90+ days for code tied to monthly or quarterly jobs - and telemetry: was this endpoint, job, or branch hit this quarter? A symbol is a deletion candidate only when static analysis AND runtime evidence agree. One signal alone produces false positives that take down prod.
  4. Hunt the dynamic callers static tools miss. Grep the symbol name as a string (reflection, string-keyed dispatch, serialization). Check DI containers, registries, ORM hooks, cron/queue workers, and feature-flag config. Search infra repos and other services. Public API surface and library exports are reachable by definition unless you control every consumer.
  5. Classify the kind of dead, because each is removed differently. Unreachable (no path calls it) → delete. Unused (callable, never called) → delete. Redundant (duplicates a live path) → repoint callers first. Dormant-behind-a-flag (flag off for a cycle) → retire the flag first, then delete its branch.
  6. Soft-delete risky removals first. Replace the suspect path with log-and-throw, or gate it behind a kill flag while keeping the code, for one full business cycle - 30 days minimum, 90 for anything touching monthly or quarterly processes. If nothing fires the log, proceed. For low-risk leaf code, skip to step 7.
  7. Delete in a focused PR. Remove the code AND its tests, fixtures, config, flags, and now-orphaned imports. Keep the diff under roughly 400 changed lines so it is reviewable in one sitting; a bigger cluster gets split into multiple PRs. Let CI and the type-checker catch references the search missed. No formatting or refactors in the same diff.

Read the full file on GitHub · 41 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +2 lines · +1 tokens per session 960a4568cb4b
  2. 1mo ago First seen · 39 lines · 89 tokens per session scan A fa1ad0f4793a

Subscribe to this mod's changes

dead-code-eliminator is a skill published in the GitHub repository SkillMedev/legacy-modernization (2 stars, last pushed 21d ago), licensed MIT. It adds 90 tokens to every session and 894 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to dead-code-eliminator, differing in 0 lines, and is treated as a copy.