dead-code-cleanup

dead-code-cleanup is a skill for Claude Code from jerseycheese/agent-skills. It costs 66 tokens per session (5,538 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. Also seen: positional $N argument.

Part of the workflow-skills plugin — 34 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 34 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 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,538 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.00066 $0.05538
Opus 5.5 $0.00026 $0.02215
Sonnet 5.5 $0.00013 $0.01108
Haiku 4.5 $0.00007 $0.00554

Measured 4d ago against content hash 7c925b45766f, 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 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-cleanup/SKILL.md · 703 lines

How it starts

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

Dead Code Cleanup

Overview

Systematically identifies dead, orphaned, and trivial code across the codebase including components, tests, and Storybook stories. Validates that code is truly unused before removal to prevent breaking changes. Also removes stories that provide no documentation value or only demonstrate rare edge cases.

What Qualifies as Dead/Trivial Code

Dead/Orphaned Code

  • Components never imported - React components with no imports anywhere
  • Unused utilities - Functions/modules with no consumers
  • Orphaned tests - Tests for deleted/moved components
  • Orphaned stories - Storybook stories for deleted/moved components
  • Commented-out code - Code blocks that have been commented out
  • Debug code - Console logs, debug flags, temporary test utilities

Trivial Tests

  • Tests that always pass - Tests with no real assertions or mocked to always succeed
  • Empty render tests - Tests that only verify component renders without crashing
  • Pointless existence tests - Tests that check if a component is defined
  • Snapshot-only tests - Tests with only snapshots and no behavior validation
  • Duplicate tests - Multiple tests checking the same exact behavior
  • Negative reference guards - Tests that read docs/source/CSS/config and only assert a removed string, selector, key, or literal is absent

Trivial Storybook Stories

  • No-value stories - Stories that show the exact same thing as another story
  • Default-only stories - Stories that only render component with no props (when default story exists)
  • Edge case stories - Stories demonstrating extremely rare scenarios unlikely to occur
  • Duplicate states - Multiple stories showing identical visual states
  • Over-specification stories - Stories for every tiny prop variation that adds no documentation value
  • Obvious behavior stories - Stories showing behavior that's self-evident from the component

Examples of trivial stories to remove:

// ❌ Trivial - just default with no props (when Default story exists)
export const Empty: Story = {
  args: {},
};

// ❌ Trivial - rare edge case nobody will encounter
export const WithExactly47Characters: Story = {
  args: {
    text: "This string has exactly forty-seven chars!",
  },
};

// ❌ Trivial - duplicate of existing state
export const LoadingState: Story = {
  args: { loading: true },
};
export const IsLoading: Story = {  // Duplicate!
  args: { loading: true },
};

// ❌ Trivial - no documentation value
export const WithPadding5: Story = {
  args: { padding: 5 },
};
export const WithPadding6: Story = {
  args: { padding: 6 },
};
export const WithPadding7: Story = {
  args: { padding: 7 },
};

// ✅ Keep - demonstrates important state
export const ErrorState: Story = {
  args: {
    error: "Failed to load data",
    onRetry: fn(),
  },
};

// ✅ Keep - shows important variant
export const WithLongContent: Story = {
  args: {
    children: "Very long content that tests text wrapping...",
  },
};

Read the full file on GitHub · 703 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 Changed · -4 lines · -49 tokens per session 7c925b45766f
  2. 1mo ago Changed · +13 lines · +10 tokens per session 32360b86e9c8
  3. 1mo 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 (3 stars, last pushed yesterday), licensed MIT. It adds 66 tokens to every session and 5,538 once invoked, about $0.0003 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

Other skills, from other repositories

chorus-council

Run an LLM council — Claude (correctness), Gemini (edge cases), Cursor (integration), Kilo (maintainability), and you (scope) tackle the same task in parallel. Use when the user wants multiple independent perspectives on a decision, approach, or problem.

valpere/chorus · 62 tokens

chorus-parallel-review

Parallel code review of the current git diff from multiple agents — Claude (correctness/security), Gemini (edge cases), Cursor (integration), Kilo (maintainability), and you (scope/simplicity). Use when the user says "parallel review", "review with all agents", or "chorus review".

valpere/chorus · 69 tokens

tuicr

Use tuicr's review CLI to read and add comments in active TUI review sessions, and launch tuicr in cmux, tmux, Zellij, or Herdr when a user needs an interactive review pane.

agavra/tuicr · 50 tokens

liveagent-code-review

Review an open GitHub pull request or the current local branch and working tree with parallel, independent reviewers and evidence-based validation. Use when the user asks for code review, invokes the Code Review action from Git Review, or explicitly mentions this skill.

Stack-Cairn/LiveAgent · 54 tokens

spec-kitty-runtime-review

Review runtime-owned outputs using the Spec Kitty review workflow surface, then direct approval or rejection with structured feedback. Triggers: "review this work package", "check runtime output", "approve this step", "review WP", "is this WP ready to approve", "check this implementation". Does NOT handle: setup-only…

Priivacy-ai/spec-kitty · 85 tokens

omh-image-cards

This is an OMH img-summary workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

rlaope/oh-my-hermes · 79 tokens