remove-deadcode

remove-deadcode is a skill for Claude Code, Codex from znlgis/my-opencode-deepseek-config. It costs 92 tokens per session (785 once invoked), scanned A, original, MIT.

A cautious procedure for finding and deleting code that is proven to be unused, including files, exports, functions, variables, and imports. It checks references, tests, re-exports, reflection, and framework entry points before removal.

In plain words
What is it for?
Use it to prune orphaned files, unused exports, functions, variables, and imports after a refactor or during code cleanup.
Why use it?
It reduces clutter left behind by refactors without assuming that an apparently unused symbol is safe to delete. Verification helps avoid breaking code that is reached indirectly.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to prune orphaned files, unused exports, functions, variables, and imports after a refactor or during code cleanup.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/znlgis/my-opencode-deepseek-config/remove-deadcode
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 znlgis/my-opencode-deepseek-config --skill remove-deadcode
Clone the repo
git clone --depth 1 https://github.com/znlgis/my-opencode-deepseek-config

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 remove-deadcode

README.md
[![agentmods](https://agentmods.dev/badge/skills/znlgis/my-opencode-deepseek-config/remove-deadcode/github.svg)](https://agentmods.dev/skills/znlgis/my-opencode-deepseek-config/remove-deadcode)
Your own site
<a href="https://agentmods.dev/skills/znlgis/my-opencode-deepseek-config/remove-deadcode"><img src="https://agentmods.dev/badge/skills/znlgis/my-opencode-deepseek-config/remove-deadcode/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 remove-deadcode

Your own site · 80×15
<a href="https://agentmods.dev/skills/znlgis/my-opencode-deepseek-config/remove-deadcode"><img src="https://agentmods.dev/badge/skills/znlgis/my-opencode-deepseek-config/remove-deadcode.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 785 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00092 $0.00785
Opus 5.5 $0.00037 $0.00314
Sonnet 5.5 $0.00018 $0.00157
Haiku 4.5 $0.00009 $0.00078

Measured 1mo ago against content hash 8302a924c0ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

remove-deadcode 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 1mo 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.

opencode/skills/remove-deadcode/SKILL.md · 78 lines

How it starts

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

Remove Dead Code

Delete code that is provably unreferenced — without breaking anything. The rule is simple: prove it's dead before you delete it. A confident-looking unused symbol is often reached through a barrel export, a test, reflection, or a framework entry point. Verify first. For behavior-preserving complexity reduction (simplify without deleting), use the simplify skill.

Phase 1: Scan (parallel)

Fire independent detectors at once and collect candidates:

  • Compiler / linter unused flags — e.g. TypeScript tsc --noUnusedLocals --noUnusedParameters, ESLint no-unused-vars, Go deadcode/staticcheck, Python vulture, Rust cargo +nightly udeps / dead-code warnings.
  • Orphaned files — source files not imported by any other file.
  • Unused exports — exported symbols never imported elsewhere.
  • LSP references — "find all references" returning only the definition.

Delegate broad searches to explore subagents in parallel when the codebase is large; keep each search scoped to one question.

Phase 2: Verify each candidate (before deleting)

For every candidate, confirm it is genuinely dead. Discard it (keep the code) if any of these is true:

  • It is re-exported through a barrel/index file that external code imports.
  • It is referenced by tests, fixtures, or snapshots.
  • It is a framework/tooling entry point (route handler, CLI command, migration, plugin hook, main, serializer) discovered by convention, not import.
  • It is reached by reflection, dynamic import, string key, or DI container.
  • It is part of a published public API (@public, exported package surface).

Re-run "find references" (LSP) immediately before each edit — the graph may have changed as you removed earlier items.

Phase 3: Delete in conflict-free batches

  • Group removals by file: everything in the same file goes in the same batch, so parallel edits never collide.
  • Remove the symbol/file and its now-unused imports.
  • Stage precisely: git add <specific files> — never git add -A.

Read the full file on GitHub · 78 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. 1mo ago Changed · +1 lines 8302a924c0ce
  2. 1mo ago First seen · 77 lines · 92 tokens per session scan A 20e7b123d8d9

Subscribe to this mod's changes

remove-deadcode is a skill published in the GitHub repository znlgis/my-opencode-deepseek-config (59 stars, last pushed yesterday), licensed MIT. It adds 92 tokens to every session and 785 once invoked, about $0.0004 per session on Opus 5.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-30.

Related

Other skills, from other repositories