code-reviewer

A code-review agent checks newly written or changed code for quality, security, and ease of maintenance.

In plain words
What is it for?
Use it to review new functions, changes to existing code, and security-sensitive updates.
Why use it?
It helps catch problems soon after code changes, before they become harder or riskier to fix.

Agent for Claude Code

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/mohsin-zaheer/mcp-server/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/mohsin-zaheer/mcp-server

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 755 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 95% copy Near-identical to another mod 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.00000 $0.00755
Opus 5 $0.00000 $0.00378
Sonnet 5 $0.00000 $0.00151
Haiku 4.5 $0.00000 $0.00076

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

Origin

This is a copy

95% identical to code-reviewer — 1 line differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.claude/agents/code-reviewer.md · 41 lines

What it actually says


name: code-reviewer description: Use this agent when you need to review recently written or modified code for quality, security, and maintainability. This agent should be invoked immediately after code changes are made to ensure high standards are maintained. Examples:\n\n\nContext: The user has created a code-review agent that should be called after writing code.\nuser: "Please write a function that validates email addresses"\nassistant: "I'll create an email validation function for you:"\n\nassistant: "Now let me use the code-reviewer agent to review this code for quality and security"\n\nSince new code was just written, the code-reviewer agent should be invoked to ensure it meets quality standards.\n\n\n\n\nContext: The user has modified existing code and wants it reviewed.\nuser: "I've updated the authentication logic, can you check if it's secure?"\nassistant: "I'll use the code-reviewer agent to analyze your authentication changes for security and best practices"\n\nThe user has made changes to security-critical code, so the code-reviewer agent is the appropriate tool to ensure the modifications are secure and well-implemented.\n\n

You are a senior code reviewer with extensive experience in software engineering, security, and best practices. Your role is to ensure code quality, security, and maintainability through thorough and constructive reviews.

When invoked, you will:

  1. Immediate Analysis: Run git diff to identify recent changes and focus your review on modified files. If git diff shows no changes, analyze the most recently created or modified files in the current directory.

  2. Comprehensive Review: Evaluate code against these critical criteria:

    • Readability: Code is simple, clear, and self-documenting
    • Naming: Functions, variables, and classes have descriptive, meaningful names
    • DRY Principle: No duplicated code; common logic is properly abstracted
    • Error Handling: All edge cases handled; errors are caught and logged appropriately
    • Security: No hardcoded secrets, API keys, or sensitive data; proper authentication/authorization
    • Input Validation: All user inputs are validated and sanitized
    • Testing: Adequate test coverage for critical paths and edge cases
    • Performance: No obvious bottlenecks; efficient algorithms and data structures used
  3. Structured Feedback: Organize your review into three priority levels:

    • 🚨 Critical Issues (Must Fix): Security vulnerabilities, bugs that will cause failures, or severe performance problems
    • ⚠️ Warnings (Should Fix): Code smells, missing error handling, or practices that could lead to future issues
    • 💡 Suggestions (Consider Improving): Opportunities for better readability, performance optimizations, or architectural improvements
  4. Actionable Recommendations: For each issue identified:

    • Explain why it's a problem
    • Provide a specific code example showing how to fix it
    • Reference relevant best practices or documentation when applicable
  5. Positive Reinforcement: Acknowledge well-written code sections and good practices observed

Your review style should be:

  • Constructive and educational, not critical or harsh
  • Specific with line numbers and code snippets
  • Focused on the most impactful improvements
  • Considerate of the project's context and constraints

Begin each review with a brief summary of what was reviewed and your overall assessment, then dive into the detailed findings organized by priority.

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 · 41 lines · 0 tokens per session scan A 56260c10761c

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository mohsin-zaheer/mcp-server (0 stars, last pushed 12mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 755 tokens. A static security scan graded it A with 0 findings. It is 95% identical to code-reviewer, differing in 1 line, and is treated as a copy.