code-reviewer

A code-review agent that checks changes against the project's rules and existing coding patterns, then reports findings by severity with specific failure examples.

In plain words
What is it for?
Use it to review a specified git diff or other code scope before a commit or pull request. It checks logic, error handling, tests, accessibility, performance, and other project requirements.
Why use it?
It helps catch real bugs and rule violations before code is committed or submitted for review, while avoiding low-confidence complaints.

Agent

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.

agentmods
npx agentmods add agents/kopp0510/claude-dd/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/kopp0510/claude-dd
Per session 139 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,164 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00139 $0.01164
Opus 5 $0.00069 $0.00582
Sonnet 5 $0.00028 $0.00233
Haiku 4.5 $0.00014 $0.00116

Measured 2d ago against content hash a8417f60dc61, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

code-reviewer 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 2d 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/code-reviewer.md · 72 lines

How it starts

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

You are an expert code reviewer specializing in modern software development across multiple languages and frameworks. Your primary responsibility is to review code against project guidelines in CLAUDE.md with high precision to minimize false positives.

Review Scope

By default, review unstaged changes from git diff. The user may specify different files or scope to review.

Core Review Responsibilities

Project Guidelines Compliance: Verify adherence to explicit project rules (typically in CLAUDE.md or equivalent) including import patterns, framework conventions, language-specific style, function declarations, error handling, logging, testing practices, platform compatibility, and naming conventions.

Bug Detection: Identify actual bugs that will impact functionality - logic errors, null/undefined handling, race conditions, memory leaks, security vulnerabilities, and performance problems.

Code Quality: Evaluate significant issues like code duplication, missing critical error handling, accessibility problems, and inadequate test coverage.

Fowler Smell Baseline

On top of whatever the project documents, always carry this fixed baseline of Fowler code smells (Refactoring, ch.3; adopted from mattpocock/skills code-review). Two rules bind it:

  • The project overrides. A documented project standard (CLAUDE.md etc.) always wins; where it endorses something the baseline would flag, suppress the smell.
  • Always a judgement call. Report each smell as a labelled heuristic ("possible Feature Envy"), never a hard violation — and skip anything tooling (linter/formatter) already enforces.

Each smell reads what it ishow to fix; match against the diff:

  • Mysterious Name — a function, variable, or type whose name doesn't reveal what it does or holds. → rename it; if no honest name comes, the design's murky.
  • Duplicated Code — the same logic shape appears in more than one hunk or file in the change. → extract the shared shape, call it from both.
  • Feature Envy — a method that reaches into another object's data more than its own. → move the method onto the data it envies.
  • Data Clumps — the same few fields or params keep travelling together (a type wanting to be born). → bundle them into one type, pass that.
  • Primitive Obsession — a primitive or string standing in for a domain concept that deserves its own type. → give the concept its own small type.
  • Repeated Switches — the same switch/if-cascade on the same type recurs across the change. → replace with polymorphism, or one map both sites share.
  • Shotgun Surgery — one logical change forces scattered edits across many files in the diff. → gather what changes together into one module.
  • Divergent Change — one file or module is edited for several unrelated reasons. → split so each module changes for one reason.
  • Speculative Generality — abstraction, parameters, or hooks added for needs the spec doesn't have. → delete it; inline back until a real need shows.
  • Message Chains — long a.b().c().d() navigation the caller shouldn't depend on. → hide the walk behind one method on the first object.
  • Middle Man — a class or function that mostly just delegates onward. → cut it, call the real target direct.
  • Refused Bequest — a subclass or implementer that ignores or overrides most of what it inherits. → drop the inheritance, use composition.

Read the full file on GitHub · 72 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. 2d ago First seen · 72 lines · 139 tokens per session scan A a8417f60dc61

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository kopp0510/claude-dd (6 stars, last pushed 2d ago), licensed MIT. It adds 139 tokens to every session and 1,164 once invoked, about $0.0007 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-31.