Dead Code Eliminator

Dead Code Eliminator is a skill for Claude Code, Codex from SkillMedev/legacy-modernization. It costs 89 tokens per session (882 once invoked), scanned A, original, 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

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.

agentmods
npx agentmods add skills/skillmedev/legacy-modernization/dead-code-eliminator
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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 882 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00089 $0.00882
Opus 5 $0.00044 $0.00441
Sonnet 5 $0.00018 $0.00176
Haiku 4.5 $0.00009 $0.00088

Measured 4d ago against content hash fa1ad0f4793a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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.

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

How it starts

The opening of the file, as written. The whole thing — 39 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 · 39 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. 4d 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 2mo ago), licensed MIT. It adds 89 tokens to every session and 882 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ghost

Expert in modernizing legacy assets and refactoring older systems for modern missions. Strangler fig pattern, incremental migration, and tech debt elimination.

Rikinshah787/clawarmy · 30 tokens

Breaking Change Detector

Compares two versions of a codebase or API and flags all breaking changes with migration hints.

Notysoty/openagentskills · 23 tokens

topology-planning

Generate a target architecture and migration plan from a discovery summary. Produces a migrationplan.md with target topology, ADRs, phased strategy, and risks. Trigger on: target architecture, migration plan, topology, modernization plan.

sarveshtalele/mcp-skills-registry · 50 tokens

migration-strategy

Migration Strategy: Plans and reviews large-scale system migrations — monolith to microservices, cloud migration, database migration, framework upgrades, and language transitions. Covers strangler fig pattern, parallel running, data migration, feature parity tracking, and rollback strategies. Use when the user…

camilooscargbaptista/cto-toolkit · 99 tokens

code-migrator

Migrate legacy code to modern frameworks, languages, and patterns with automated refactoring and testing.

glincker/claude-code-marketplace · 23 tokens

code-necromancer

Systematic framework for resurrecting and modernizing legacy codebases through archaeology, resurrection, and rejuvenation phases. Activate on "legacy code", "inherited codebase", "no documentation", "technical debt", "resurrect", "modernize". NOT for greenfield projects or well-documented active codebases.

curiositech/windags-skills · 70 tokens