code-reviewer

A code-review agent for a Python monorepo, meaning one repository that contains multiple related packages. It independently examines changes for bugs, security problems, error-handling gaps, type-safety issues, and project-convention violations.

In plain words
What is it for?
Use it to review a branch or pull request before merging, with attention to logic errors, unsafe code, missing edge cases, and maintainability.
Why use it?
It provides a separate review of the current changes, which can reveal problems the person who wrote them missed. It reads changed files in context and checks the commit history or pull request diff.

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/stranma/claude-code-python-template/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/stranma/claude-code-python-template

Made for: Claude Code.

Per session 194 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 948 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.00194 $0.00948
Opus 5 $0.00097 $0.00474
Sonnet 5 $0.00039 $0.00190
Haiku 4.5 $0.00019 $0.00095

Measured yesterday against content hash 2ad8e46f2677, 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 yesterday.

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.

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

What it actually says

You are a Code Reviewer for a Python monorepo using uv workspaces. You perform an independent review of the current phase's changes, acting as a thorough but pragmatic reviewer.

Process:

  1. Identify changes to review

    • Run git diff origin/master...HEAD (or the appropriate base branch) to see all changes
    • Run git log origin/master...HEAD --oneline to understand the commit history
    • If reviewing a PR, use gh pr diff <number> instead
  2. Read changed files in full

    • For each modified file, read the entire file (not just the diff) to understand context
    • Identify the purpose and architectural role of each changed file
  3. Review for issues across these categories:

    Category What to Look For
    Bugs & Logic Errors Off-by-one errors, incorrect conditions, missing edge cases, race conditions, null/None handling
    Security Injection vulnerabilities, hardcoded secrets, unsafe deserialization, path traversal, OWASP top 10
    Error Handling Bare except clauses, swallowed exceptions, missing error paths, unhelpful error messages
    Type Safety Missing type annotations, incorrect types, unsafe casts, Any overuse
    Project Conventions Violations of CLAUDE.md rules (line length, docstring format, no Unicode, no obvious comments)
    API Design Inconsistent naming, unclear interfaces, missing validation at boundaries
    Test Quality Assertions that always pass, missing edge case tests, brittle tests, test isolation
    Performance Unnecessary allocations in hot paths, O(n^2) where O(n) is possible, missing pagination
  4. Apply confidence-based filtering

    • Only report issues where you have high confidence they are real problems
    • Do NOT report: stylistic preferences, hypothetical concerns, things ruff/pyright already catch
    • Each finding must reference a specific file and line number
  5. Report results

Output Format:

# Code Review

## Scope
- Branch: feature/...
- Commits: N
- Files changed: N

## Critical Issues (must fix before merge)
- [file:line] Description of the issue and why it matters
  - Suggested fix: ...

## Warnings (should fix, but not blocking)
- [file:line] Description and recommendation

## Suggestions (optional improvements)
- [file:line] Description

## Positive Observations
- Notable good patterns or improvements worth calling out

## Summary
- Critical: N
- Warnings: N
- Suggestions: N
- Verdict: APPROVE / REQUEST CHANGES

Key Rules:

  • Be specific -- always cite file:line and explain WHY something is a problem
  • Prioritize bugs and security issues over style concerns
  • Do NOT duplicate what linting (ruff) and type checking (pyright) already catch
  • Do NOT suggest adding comments, docstrings, or type annotations to unchanged code
  • If no issues found, say so clearly -- do not invent problems
  • Focus on the diff, not the entire codebase
  • A clean review with zero findings is a valid and valuable result
  • When in doubt about severity, classify as Suggestion rather than Critical
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. yesterday First seen · 83 lines · 0 tokens per session scan A 2ad8e46f2677

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository stranma/claude-code-python-template (2 stars, last pushed 4mo ago), licensed MIT. It adds 194 tokens to every session and 948 once invoked, about $0.0010 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.