SWE - Dead Code Auditor

SWE - Dead Code Auditor is an agent for Claude Code from chrisallenlane/claude-swe-workflows. It costs 42 tokens per session (1,308 once invoked), scanned A, original, MIT.

A code audit agent that finds code which appears unused or impossible to reach, such as unreferenced functions, unused imports, unreachable branches, or dead files. It reports evidence and confidence instead of deleting anything.

In plain words
What is it for?
It examines symbols, modules, dependencies, unreachable statements, commented-out code, and code used only by tests, then produces advisory findings for another tool or person to act on.
Why use it?
Unused code adds reading and maintenance work, but a mistaken deletion can break a product. Confidence levels and cited evidence help a developer decide what is safe to investigate or remove.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the claude-swe-workflows plugin — 22 skills, 37 agents shipped together

Good fit It examines symbols, modules, dependencies, unreachable statements, commented-out code, and code used only by tests, then produces advisory findings for another tool or person to act on.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor
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.

Clone the repo
git clone --depth 1 https://github.com/chrisallenlane/claude-swe-workflows

Made for: Claude Code.

Or install claude-swe-workflows, the plugin that ships this one along with the rest of its 22 skills, 37 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 SWE - Dead Code Auditor

README.md
[![agentmods](https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor/github.svg)](https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor)
Your own site
<a href="https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor"><img src="https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor/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 SWE - Dead Code Auditor

Your own site · 80×15
<a href="https://agentmods.dev/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor"><img src="https://agentmods.dev/badge/agents/chrisallenlane/claude-swe-workflows/swe-dead-code-auditor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 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,308 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.00042 $0.01308
Opus 5.5 $0.00017 $0.00523
Sonnet 5.5 $0.00008 $0.00262
Haiku 4.5 $0.00004 $0.00131

Measured 12d ago against content hash 249a3a0b25fc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

SWE - Dead Code Auditor 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 12d 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.

agents/swe-dead-code-auditor.md · 82 lines

How it starts

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

Purpose

Audit a codebase for dead code — code that cannot execute or that nothing references — and report it with evidence and honest confidence. This is an advisory role. You catalog; another skill removes.

Dead code is complexity for free: it burdens every reader, every search, and every refactor while contributing nothing. But a false dead-code finding is worse than none — deleting live code breaks the product. Your value is calibration: every finding carries the evidence that supports it and a confidence tier the operator can act on.

What Counts as Dead

  • Unreferenced symbols — functions, methods, classes, constants, variables with no callers or readers.
  • Dead files and modules — never imported or required by anything reachable from an entry point.
  • Unreachable code — statements after unconditional returns/throws; branches whose conditions cannot be true.
  • Unused imports and dependencies — imports nothing in the file uses; manifest dependencies nothing imports.
  • Commented-out code — blocks of disabled code (version control already remembers it).
  • Tests-only code — source whose only references are its own tests: the tests keep it "alive," but no production path reaches it.
  • Dead configuration — config keys, environment variables, and feature flags that are defined but never read (or read but the enabled branch is gone).

Out of scope: code that runs but shouldn't (obsolete-but-live is /review-repo value and /review-repo architecture territory), and duplicate code (/review-repo architecture catalogs it; /refactor removes it).

Confidence Discipline

Calibrate before you catalog. First, survey the codebase for dynamic-dispatch patterns — reflection, string-built symbol names, plugin registries, convention-based loading (routes, hooks, DI containers), getattr/send/_G style access. Their presence caps the confidence any reference-search finding can earn, and the survey result leads your report.

Second, establish the roots. An application's roots are its entry points. A library's roots include its exported public API — an exported symbol is not dead merely because the repo never calls it. State which project type you determined and why.

Read the full file on GitHub · 82 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. 12d ago First seen · 82 lines · 42 tokens per session scan A 249a3a0b25fc

Subscribe to this mod's changes

SWE - Dead Code Auditor is an agent published in the GitHub repository chrisallenlane/claude-swe-workflows (21 stars, last pushed 13d ago), licensed MIT. It adds 42 tokens to every session and 1,308 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-11-18.

Related

SWE - Dead Code Auditor compared with agents from other repositories

SWE - Dead Code Auditor next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
SWE - Dead Code Auditorchrisallenlane/claude-swe-workflowsAgent2113d agoMITA42Claude Code
orc-code-fixerHigorAlves/orcAgent72d agoMITA39Claude Code
reviewerwesammustafa/Claude-Code-Everything-You-Need-to-KnowAgent3.7k2d agononeA35Claude Code
predictive-analystsoftspark/ai-toolkitAgent18012d agoApache-2.0A35Claude Code
streaming-revieweravelikiy/great_ctoAgent11713d agoMITA38Claude Code
adversarial-reviewereugenelim/agent-ready-repoAgent35todayApache-2.0A142Claude Code
quality-engineereugenelim/agent-ready-repoAgent35todayApache-2.0A172Claude Code