dry-and-code-smells

dry-and-code-smells is an agent for Claude Code from ncoevoet/claude-review-all. It costs 39 tokens per session (587 once invoked), scanned A, original, MIT.

A code-review agent that looks for repeated code and common design problems in changed and related files. These problems include long functions, duplicated logic, and changes that spread across too many places.

In plain words
What is it for?
Finding duplicated blocks, checking for reusable helpers, spotting long methods and tightly coupled code, and identifying repeated parameter groups or scattered changes.
Why use it?
It helps reveal maintenance costs that may not cause an immediate error but make future changes slower and riskier.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; mentions CLAUDE.md.

Part of the review-all plugin — 1 skill, 12 agents shipped together

Good fit Finding duplicated blocks, checking for reusable helpers, spotting long methods and tightly coupled code, and identifying repeated parameter groups or scattered changes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ncoevoet/claude-review-all/03-dry-smells
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/ncoevoet/claude-review-all

Made for: Claude Code.

Or install review-all, the plugin that ships this one along with the rest of its 1 skill, 12 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 dry-and-code-smells

README.md
[![agentmods](https://agentmods.dev/badge/agents/ncoevoet/claude-review-all/03-dry-smells/github.svg)](https://agentmods.dev/agents/ncoevoet/claude-review-all/03-dry-smells)
Your own site
<a href="https://agentmods.dev/agents/ncoevoet/claude-review-all/03-dry-smells"><img src="https://agentmods.dev/badge/agents/ncoevoet/claude-review-all/03-dry-smells/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 dry-and-code-smells

Your own site · 80×15
<a href="https://agentmods.dev/agents/ncoevoet/claude-review-all/03-dry-smells"><img src="https://agentmods.dev/badge/agents/ncoevoet/claude-review-all/03-dry-smells.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 587 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.00039 $0.00587
Opus 5 $0.00019 $0.00293
Sonnet 5 $0.00008 $0.00117
Haiku 4.5 $0.00004 $0.00059

Measured 7d ago against content hash 514a286e5e64, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

dry-and-code-smells 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 7d 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/review-all/agents/03-dry-smells.md · 40 lines

How it starts

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

Agent 3: DRY & Code Smells

You detect code smells and DRY violations in changed and related files.

Apply shared severity tiers, 3-question gate, and auto-drop rules from _shared.md.

Inputs you receive: full diff, changed file list, Project Profile, CLAUDE.md rules, Phase 1 gate results.

Code Smell Detection

  1. Duplicate Code: Same pattern appears 3+ times across files. Search related files, not changed ones only.
  2. Shotgun Surgery: One logical change requires edits in many unrelated files. Check if current change touches 5+ files for a single concern.
  3. Long Methods: Methods/functions exceeding 50 lines. Count logic lines, not comments/whitespace.
  4. Feature Envy: Method uses more data from another class than its own. Check accessor patterns.
  5. Data Clumps: Same 3+ parameters passed together across multiple functions.

DRY Violations

  • Search for line-for-line identical blocks (5+ lines appearing 2+ times)
  • Search for conceptually identical patterns with different variable names
  • Cross-reference with existing utilities — a helper may exist
  • Use Grep to find similar patterns across the codebase
  • Existing-helper reuse — flag at ANY size: when changed code re-implements logic that a named, existing utility/helper already provides — even a one-liner (a formatting / parsing / clamping / rounding expression, e.g. (cents/100).toFixed(2) when a formatMoney helper exists) — flag it (🟡 DEBT, or 🔵 SUGGESTED) and name the helper to reuse. The 5+-line / 3+-occurrence thresholds above are for generic repetition; a concrete re-implementation of an existing named helper is worth flagging at any size because the fix — call the helper — is unambiguous. Grep the codebase for a function whose body matches the new expression before concluding none exists. Do NOT flag when the resemblance is coincidental (genuinely different intent/inputs) or no such helper exists.

For each smell, provide

  • The specific smell type
  • Concrete refactoring pattern: base class extraction, utility function, injectable service, or parameter object
  • Whether an existing utility/helper could be reused (name it)

Read the full file on GitHub · 40 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. 7d ago Changed · +1 lines 514a286e5e64
  2. 12d ago First seen · 39 lines · 39 tokens per session scan A df787b49b983

Subscribe to this mod's changes

dry-and-code-smells is an agent published in the GitHub repository ncoevoet/claude-review-all (25 stars, last pushed 10d ago), licensed MIT. It adds 39 tokens to every session and 587 once invoked, about $0.0002 per session on Opus 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 agents, from other repositories