dead-code-cleanup

dead-code-cleanup is a skill for Claude Code from jerseycheese/agent-skills. It costs 60 tokens per session (1,754 once invoked), scanned A, original, MIT.

A cleanup tool that finds code, tests, and Storybook examples that are unused, orphaned, commented out, or too trivial to be useful. It checks that items are genuinely unused before removing them.

In plain words
What is it for?
Use it to find unused components and utilities, obsolete tests and stories, debug code, commented-out code, duplicate tests, and low-value snapshots.
Why use it?
It reduces clutter without deleting code that the project still depends on. It also removes tests and examples that provide little confidence or documentation value.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the workflow-skills plugin — 36 skills shipped together

Good fit Use it to find unused components and utilities, obsolete tests and stories, debug code, commented-out code, duplicate tests, and low-value snapshots.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jerseycheese/agent-skills/dead-code-cleanup
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 jerseycheese/agent-skills --skill dead-code-cleanup
Clone the repo
git clone --depth 1 https://github.com/jerseycheese/agent-skills

Made for: Claude Code.

Or install workflow-skills, the plugin that ships this one along with the rest of its 36 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jerseycheese/agent-skills/dead-code-cleanup/github.svg)](https://agentmods.dev/skills/jerseycheese/agent-skills/dead-code-cleanup)
Your own site
<a href="https://agentmods.dev/skills/jerseycheese/agent-skills/dead-code-cleanup"><img src="https://agentmods.dev/badge/skills/jerseycheese/agent-skills/dead-code-cleanup/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-cleanup

Your own site · 80×15
<a href="https://agentmods.dev/skills/jerseycheese/agent-skills/dead-code-cleanup"><img src="https://agentmods.dev/badge/skills/jerseycheese/agent-skills/dead-code-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,754 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 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.00060 $0.01754
Opus 5.5 $0.00024 $0.00702
Sonnet 5.5 $0.00012 $0.00351
Haiku 4.5 $0.00006 $0.00175

Measured 29d ago against content hash 4208949da88d, 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-cleanup 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 29d 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-cleanup/SKILL.md · 169 lines

How it starts

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

Dead Code Cleanup

Overview

Finds code and files whose subject is gone or that nothing uses, and removes them only after proving nothing depends on them. Validate first, delete second.

This skill works in any language. Commands and names below are examples, so swap in the project's own.

Trivial or weak tests and stories (snapshot-only, renders without crashing, toBeDefined, duplicates, negative reference scans) belong to test-reaper. This skill only removes a test or story when its subject is gone (an orphan).

What Qualifies

  • Modules and components never used - nothing imports, loads, or instantiates them
  • Unused functions, classes, and constants - no consumers
  • Unused types and interfaces - definitions with no references
  • Duplicate implementations - several versions of the same functionality
  • Empty functions - do nothing or only return a default
  • Commented-out code - blocks that have been commented out
  • Debug code - debug prints, debug flags, temporary utilities
  • Orphans - tests, stories, fixtures, and assets for something deleted or moved

Detection

Phase 1: Find candidates

Start with the project's own tooling. Check its manifest and docs for a dead-code or unused-import check, then consider the usual tool for the stack (knip for JS/TS, vulture for Python, deadcode for Go, the compiler's unused warnings where it has them). These tools report candidates, not proof, so Phase 2 still applies.

Fall back to a search where no tool covers the code:

# References to a candidate, including untracked work in progress (run once per name it goes by)
git grep -nw --untracked "candidate_name"

# Test, story, and fixture files whose subject may be gone (extend for the project's layout)
git ls-files | grep -E '(^|/)(tests?|__tests__|fixtures)/|[._](test|spec|stories)\.|(^|/)test_'

# Everything but test files, by exact name and folder. A loose ':!*test*' or ':!*spec*' also drops
# source like planning_inspector.gd or latest.py. Extend for the project's layout, and exclude vendored code.
SOURCE=(. ':!*.test.*' ':!*.spec.*' ':!*_test.*' ':!*_spec.*' ':(exclude,glob)**/test_*' ':(exclude,glob)**/test/**' ':(exclude,glob)**/tests/**' ':(exclude,glob)**/__tests__/**')

# Debug leftovers. To scope a pass, run it from that directory. A print is often intentional, so read each hit.
# The pattern fits JS and Python, so add the language's own debug calls: GDScript needs print( and a bare
# breakpoint. Keep \b out of them, because git grep -E on macOS silently matches nothing with it.
git grep -nE 'console\.log|debugger|breakpoint\(\)|DEBUG *= *[Tt]rue' -- "${SOURCE[@]}" ':!*.md' ':!*.json'

Read the full file on GitHub · 169 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. 29d ago Changed · -73 lines · +1 tokens per session 4208949da88d
  2. 1mo ago Changed · +2 lines 258ee79751aa
  3. 1mo ago Changed · -463 lines · -7 tokens per session 220f463368d8
  4. 1mo ago Changed · -4 lines · -49 tokens per session 7c925b45766f
  5. 2mo ago Changed · +13 lines · +10 tokens per session 32360b86e9c8
  6. 3mo ago First seen · 694 lines · 105 tokens per session scan A 868a8a30d484

Subscribe to this mod's changes

dead-code-cleanup is a skill published in the GitHub repository jerseycheese/agent-skills (4 stars, last pushed 4d ago), licensed MIT. It adds 60 tokens to every session and 1,754 once invoked, about $0.0002 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-31.

Related

dead-code-cleanup compared with skills from other repositories

dead-code-cleanup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dead-code-cleanupjerseycheese/agent-skillsSkill44d agoMITA60Claude Code
chorus-councilvalpere/chorusSkill106mo agoMITA62Claude Code, Codex
chorus-parallel-reviewvalpere/chorusSkill106mo agoMITA69Claude Code, Codex
omh-code-reviewrlaope/oh-my-hermesSkill6.4kyesterdayMITA18Claude Code
omh-image-cardsrlaope/oh-my-hermesSkill6.4kyesterdayMITA20Claude Code
liveagent-code-reviewStack-Cairn/LiveAgentSkill2.3kyesterdayMITA54Claude Code, Codex
spec-kitty-runtime-reviewPriivacy-ai/spec-kittySkill1.7k13d agoMITA85Claude Code, Codex