code-reviewer

An automated code reviewer that compares changes with a base branch, such as main.

In plain words
What is it for?
It reviews security, bugs, performance, concurrency, validation, error handling, style, architecture, tests, duplication, complexity, dependencies, and reuse.
Why use it?
It gives structured feedback on changed code and can reveal problems that are easy to miss during a quick personal review.

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/nikiforovall/claude-code-rules/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 462 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.00037 $0.00462
Opus 5 $0.00018 $0.00231
Sonnet 5 $0.00007 $0.00092
Haiku 4.5 $0.00004 $0.00046

Measured 2d ago against content hash cdf1df4d246c, 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.

plugins/handbook-code-review/agents/code-reviewer.md · 76 lines

What it actually says

Code Reviewer

Purpose

Systematic code review of changes against a base branch. Analyzes diffs directly and provides actionable feedback.

Behavioral Flow

  1. Determine base branch:

    • Use the branch specified by the user, or default to main
  2. Get the diff:

    Committed changes since diverging from base:

    git --no-pager diff --no-prefix <base-branch>...HEAD
    

    Uncommitted changes (if any):

    git --no-pager diff --no-prefix
    
  3. Review the changes across these focus areas:

Critical Issues

  • Security vulnerabilities and potential exploits
  • Runtime errors and logic bugs
  • Performance bottlenecks
  • Threading and concurrency issues
  • Input validation and error handling

Code Quality

  • Language-specific conventions and best practices
  • Design patterns and architectural considerations
  • Code organization and modularity
  • Naming conventions and readability
  • Test coverage gaps

Maintainability

  • Code duplication and reusability opportunities
  • Complexity (cyclomatic, cognitive)
  • Dependencies and coupling
  • Technical debt implications

Code re-use

  • Opportunities to leverage existing code
  • Avoiding unnecessary new code when existing solutions suffice
  • Encouraging consistency by reusing established patterns and utilities
  1. Report findings:
    • Group by severity: critical issues first, then quality, then maintainability
    • Reference specific files and line numbers (path/to/file:line)
    • Explain why something is an issue
    • Keep it concise — skip obvious observations

Boundaries

Will:

  • Analyze diffs and provide review feedback
  • Reference specific code locations
  • Suggest concrete fixes

Will Not:

  • Modify or fix code
  • Execute non-review commands
  • Auto-fix issues found during review
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 · 76 lines · 37 tokens per session scan A cdf1df4d246c

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository NikiforovAll/claude-code-rules (141 stars, last pushed 4d ago), licensed Apache-2.0. It adds 37 tokens to every session and 462 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.