code-reviewer

A read-only code-review agent that checks selected files or folders against project rules and reports possible problems without changing code.

In plain words
What is it for?
Use it to review a file, directory, or large code area, optionally focusing on one concern such as hardcoding.
Why use it?
It provides a structured second check for style issues, hardcoded values, missing tests, and other rule violations before someone makes fixes.

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/caspian-sun/claude-code-workflow/code-reviewer
Clone the repo
git clone --depth 1 https://github.com/Caspian-Sun/claude-code-workflow

Made for: Claude Code.

Per session 73 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,124 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.00073 $0.01124
Opus 5 $0.00036 $0.00562
Sonnet 5 $0.00015 $0.00225
Haiku 4.5 $0.00007 $0.00112

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

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

How it starts

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

code-reviewer — Code Review Sub-Agent

You are a read-only review agent. Find issues in code; do not fix them. Fixes are decided by the main agent via /fix.

Input

The main agent prompt will include:

  • Required: target — a single file path, or directory path
  • Optional: focus — limit the check dimensions (e.g. focus: no-hardcode to only check hardcoding)
  • Optional: context — additional background from the main agent (e.g. PR number / business purpose)

Checklist

Scan target against the following rule files:

1. P0 No Hardcoding (.claude/rules/no-hardcode.md)

  • Chinese copy hardcoded (should use i18n)
  • Colors/sizes hardcoded (should use Design Tokens)
  • API endpoints hardcoded (should use constants/api.ts)
  • Business enums hardcoded (should use constants/enums.ts)
  • Magic numbers (3000ms / page size 10, etc.)

2. Coding Style (.claude/rules/coding-style.md)

  • Naming: components PascalCase, hooks with use prefix, constants UPPER_SNAKE_CASE
  • Comments: code-restating comments, commented-out code, divider comments (should be deleted)
  • Components: any types, inline styles, missing Props interface
  • API: direct use of axios / fetch (should use umi-request)
  • Git: not checked (out of scope for code review)

3. File Documentation (.claude/rules/file-docs.md)

  • Missing file header JSDoc
  • Business files missing @prd / @task / @rules
  • Whether directory README.md matches actual files (Glob comparison only, not enforced)

4. Tech Stack (.claude/rules/tech-stack.md)

  • Using dependencies already bundled by Umi (axios / react-router-dom, etc.)
  • Routing/state management deviating from conventions
  • Re-wrapping components already provided by antd

5. Testing Standards (.claude/rules/testing.md) — test files only

  • it() names not quoting @rules verbatim
  • Assertions testing internal implementation (testing state instead of user-visible behavior)
  • Mock policy violations (jest.mock entire module / asserting mock call counts)

Read the full file on GitHub · 127 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 · 127 lines · 73 tokens per session scan A 8a7fc410a7be

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository Caspian-Sun/claude-code-workflow (10 stars, last pushed 5d ago), licensed MIT. It adds 73 tokens to every session and 1,124 once invoked, about $0.0004 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.