dead-code-removal

dead-code-removal is a skill for Claude Code, Codex from yeaight7/agent-powerups. It costs 24 tokens per session (574 once invoked), scanned A, original, Apache-2.0.

A workflow for finding and deleting code that is no longer used, such as functions, classes, exports, or files.

In plain words
What is it for?
Use it when removing a feature, cleaning up after a migration, or investigating unused-code warnings from tests or code-quality tools.
Why use it?
It prevents abandoned code from making a project harder to understand and maintain, while checking for hidden or dynamic uses first.

Skill for Claude CodeCodex

Part of the codebase-maintenance plugin — 8 skills, 4 commands, 3 agents shipped together

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/yeaight7/agent-powerups/dead-code-removal
Any agent
npx skills add yeaight7/agent-powerups --skill dead-code-removal
Clone the repo
git clone --depth 1 https://github.com/yeaight7/agent-powerups

Made for: Claude Code, Codex.

Or install codebase-maintenance, the plugin that ships this one along with the rest of its 8 skills, 4 commands, 3 agents.

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-removal

README.md
[![agentmods](https://agentmods.dev/badge/skills/yeaight7/agent-powerups/dead-code-removal.svg)](https://agentmods.dev/skills/yeaight7/agent-powerups/dead-code-removal)
Your own site
<a href="https://agentmods.dev/skills/yeaight7/agent-powerups/dead-code-removal"><img src="https://agentmods.dev/badge/skills/yeaight7/agent-powerups/dead-code-removal.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 574 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.00024 $0.00574
Opus 5 $0.00012 $0.00287
Sonnet 5 $0.00005 $0.00115
Haiku 4.5 $0.00002 $0.00057

Measured 3d ago against content hash b5fa170a06be, 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-removal 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 3d 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.

plugins/codebase-maintenance/skills/dead-code-removal/SKILL.md · 63 lines

How it starts

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

Purpose

Dead code increases maintenance overhead and confuses developers. Verify a symbol is truly unused across the entire repository, then delete it outright — never comment it out.

When to Use

  • A symbol, file, or export looks unused
  • A feature removal or migration left orphaned helpers behind
  • A coverage or lint report flags unreachable code

Inputs

  • The candidate symbols/files to remove
  • The repo's test and type-check commands

Workflow

  1. Verify unused — search the entire repository. Do not assume code is dead just because the current file doesn't use it:

    grep -rn "symbolName" . --include="*.ts" --include="*.tsx"    # all references
    grep -rn "from ['\"].*module-name" src/                       # import sites
    git log -3 --oneline -- path/to/suspect-file                  # recent touches
    

    Ecosystem tools can shortcut the inventory when available (e.g., knip or ts-prune for TypeScript exports, vulture for Python).

  2. Check for dynamic invocation. Be wary of dynamically invoked code — reflection, dependency injection by string name, ORM mappers, route tables, config-driven dispatch:

    grep -rn "\"symbolName\"\|'symbolName'" .    # string-keyed references
    

    If there is any doubt, leave it alone or ask the user.

  3. Delete aggressively. Once confirmed unused, delete the code. Do not comment it out.

  4. Prune dependencies. If you delete the only code that was using an imported module, remove the import statement as well.

  5. Run tests. Always run tests and/or type checkers (e.g., tsc --noEmit) after removal to ensure you didn't accidentally break a hidden dependency.

Output

  • The deletion diff plus, per removed symbol, the search evidence that it was unused

Verification

  • Whole-repo search performed per symbol — including string-keyed/dynamic references
  • No commented-out code left behind
  • Orphaned imports pruned along with the dead code
  • Tests and type checker green after removal

Read the full file on GitHub · 63 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. 3d ago First seen · 63 lines · 24 tokens per session scan A b5fa170a06be

Subscribe to this mod's changes

dead-code-removal is a skill published in the GitHub repository yeaight7/agent-powerups (6 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 24 tokens to every session and 574 once invoked, about $0.0001 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.