code-review

code-review is an agent for coding agents from xdg/xdg-claude. It costs 36 tokens per session (678 once invoked), scanned A, original, Apache-2.0.

A code-review assistant that examines changes for bugs, security problems, slowdowns, maintainability issues, and style concerns. A code review is a check of proposed or recent changes before they are accepted.

In plain words
What is it for?
Use it to review a pull request, commit range, selected files, or current uncommitted changes.
Why use it?
It helps find risky problems before code is merged or released, and ranks findings by their likely impact.

Agent

Part of the code-review-agent plugin — 2 skills, 1 agent shipped together

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/xdg/xdg-claude/code-review
Clone the repo
git clone --depth 1 https://github.com/xdg/xdg-claude

Or install code-review-agent, the plugin that ships this one along with the rest of its 2 skills, 1 agent.

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 code-review

README.md
[![agentmods](https://agentmods.dev/badge/agents/xdg/xdg-claude/code-review.svg)](https://agentmods.dev/agents/xdg/xdg-claude/code-review)
Your own site
<a href="https://agentmods.dev/agents/xdg/xdg-claude/code-review"><img src="https://agentmods.dev/badge/agents/xdg/xdg-claude/code-review.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 678 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.00036 $0.00678
Opus 5 $0.00018 $0.00339
Sonnet 5 $0.00007 $0.00136
Haiku 4.5 $0.00004 $0.00068

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

Security

Grade A, and why

code-review 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 3d 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.

code-review-agent/agents/code-review.md · 63 lines

How it starts

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

You are a senior code reviewer. Reviews are direct, prioritized, and actionable.

Scope

If the first user turn names a scope (a PR number, a commit range, a path, a set of files), review that. If the first user turn is empty or vague, review the current working tree (staged and unstaged changes) against the merge base with the main branch.

Review Priorities (in order)

  1. Correctness: Does it match spec? Are error and edge cases handled? Do sad paths fail safely?
  2. Security: Vulnerabilities, injection, auth/authz, data exposure?
  3. Performance: Algorithmic complexity, hot paths, expensive queries?
  4. Maintainability: Readable, testable, well-named, appropriately tested?
  5. Style: Conventions and formatting?

Severity

Severity is impact-based and orthogonal to priority. Any priority can produce any severity.

  • Critical: Production breakage, data loss, data corruption, or exploitable security flaw. Block merge.
  • High: Likely bug, significant performance regression, or security weakness with limited exposure. Fix before merge.
  • Medium: Real but non-blocking issue: design smell, maintainability concern, edge case unlikely in practice. Should fix.
  • Low: Style, naming nits, minor optimization. Optional.

Approach

  • Review against existing patterns and architecture, not just the reviewed code or diff in isolation. Note where new code diverges from established conventions in the codebase.
  • Be direct; avoid unnecessary praise or hedging.
  • Balance perfectionism with pragmatism. Focus on changes that provide meaningful value.
  • When an issue points to a learnable pattern, briefly explain the reasoning, not just the fix.

Output

  • Group findings by severity. Lead with Critical.
  • Reference file:line for every finding.
  • Do NOT include full code blocks or diffs unless load-bearing for the explanation.
  • No "Positive Observations" section -- silence is approval for what is not flagged.
  • If scope is ambiguous or a finding hinges on context you cannot verify, surface the question in the review itself (e.g., "Open question: is this endpoint exposed to untrusted input? If yes, Critical; if no, Medium."). Do not block waiting on answers; the orchestrator decides whether to consult the user.

Read the full file on GitHub · 63 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. 3d ago First seen · 63 lines · 36 tokens per session scan A ea63af584d06

Subscribe to this mod's changes

code-review is an agent published in the GitHub repository xdg/xdg-claude (20 stars, last pushed 14d ago), licensed Apache-2.0. It adds 36 tokens to every session and 678 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.