dead-code-cleanup

dead-code-cleanup is an agent for Claude Code from jeffrigby/somepulp-agents. It costs 51 tokens per session (1,783 once invoked), scanned A, original, MIT.

A collection of tools for checking a codebase's security, speed, libraries, code quality, unused code, and documentation. A codebase is the complete set of source files and related project code.

In plain words
What is it for?
Use it to audit a project, investigate security or performance concerns, find unused imports and files, review dependencies, and maintain documentation.
Why use it?
It brings several kinds of maintenance checks into one broader audit instead of requiring separate reviews for each area. It also includes a process for checking suspected unused code before cleanup.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter; mentions subagents; names the TodoWrite tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the codebase-health plugin — 6 skills, 7 agents shipped together

Good fit Use it to audit a project, investigate security or performance concerns, find unused imports and files, review dependencies, and maintain documentation.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add jeffrigby/somepulp-agents
Claude Code
/plugin install codebase-health

Made for: Claude Code.

Or install codebase-health, the plugin that ships this one along with the rest of its 6 skills, 7 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-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/agents/jeffrigby/somepulp-agents/dead-code-cleanup/github.svg)](https://agentmods.dev/agents/jeffrigby/somepulp-agents/dead-code-cleanup)
Your own site
<a href="https://agentmods.dev/agents/jeffrigby/somepulp-agents/dead-code-cleanup"><img src="https://agentmods.dev/badge/agents/jeffrigby/somepulp-agents/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/agents/jeffrigby/somepulp-agents/dead-code-cleanup"><img src="https://agentmods.dev/badge/agents/jeffrigby/somepulp-agents/dead-code-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,783 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.00051 $0.01783
Opus 5.5 $0.00020 $0.00713
Sonnet 5.5 $0.00010 $0.00357
Haiku 4.5 $0.00005 $0.00178

Measured 3mo ago against content hash 391c1b871635, 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 3mo 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-health/agents/dead-code-cleanup.md · 212 lines

How it starts

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

Dead Code Cleanup Agent

You are a dead code detection agent that finds unused code and helps users clean it up. You use automated tools (knip for JS/TS, deadcode for Python) combined with manual verification to filter false positives.

Example Invocations

CRITICAL: Verify Before Reporting

Dead code tools return many false positives. You MUST verify each finding before including it in your report. Never report unverified findings to the user.

Workflow

Phase 1: Detection

  1. Auto-detect project type:

    "${CLAUDE_PLUGIN_ROOT}"/scripts/dead-code-detect.sh --format json
    
  2. If tool not installed, inform user:

    • Knip: npm install -g knip or use npx knip
    • Deadcode: pip install deadcode
  3. Run detection:

    • For JS/TS: npx knip --reporter json
    • For Python: deadcode .

Phase 2: Verification (CRITICAL)

For EACH flagged item, you MUST:

  1. Read the flagged code using the Read tool
  2. Search for dynamic references:
    • Use Grep to search for the item name in strings
    • Look for import(, require(variable), getattr, eval
  3. Check framework patterns:
    • React components: Search for JSX usage <ComponentName
    • Decorators: Check for @decorator patterns above the item
    • Re-exports: Is this in an index.ts/index.js barrel file?
  4. Mark each item:
    • "verified" - genuinely unused
    • "false_positive" - has dynamic usage or framework pattern

Read the full file on GitHub · 212 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. 3mo ago First seen · 212 lines · 51 tokens per session scan A 391c1b871635

Subscribe to this mod's changes

dead-code-cleanup is an agent published in the GitHub repository jeffrigby/somepulp-agents (9 stars, last pushed 2mo ago), licensed MIT. It adds 51 tokens to every session and 1,783 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 agents from other repositories

dead-code-cleanup next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dead-code-cleanupjeffrigby/somepulp-agentsAgent92mo agoMITA51Claude Code
verifierBekbolotM/repo-doctorAgent14mo agoMITA40Claude Code
evidence-based-investigatortestdouble/hanAgent365todayMITA85Claude Code
streaming-revieweravelikiy/great_ctoAgent11716d agoMITA38Claude Code
ci-resolveravelikiy/great_ctoAgent11716d agoMITA48Claude Code
error-handling-reviewerOutSystems/outsystems-mcpAgent50todayMITA24Claude Code
failure-hunterromiluz13/cc10xAgent1671mo agoMITA48Claude Code