code-reviewer

code-reviewer is an agent for Claude Code from nikandr-surkov/ai-saas-starter. It costs 44 tokens per session (504 once invoked), scanned A, original, MIT.

A read-only code reviewer for changes involving user accounts, payments, and credit balances.

In plain words
What is it for?
Use it after editing authentication, billing, credit-ledger, or API code to inspect the changes against required safety rules.
Why use it?
It helps catch security, accounting, duplicate-processing, and payment-handling mistakes before changes are committed.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it after editing authentication, billing, credit-ledger, or API code to inspect the changes against required safety rules.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nikandr-surkov/ai-saas-starter/code-reviewer
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.

Clone the repo
git clone --depth 1 https://github.com/nikandr-surkov/ai-saas-starter

Made for: Claude Code.

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-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/nikandr-surkov/ai-saas-starter/code-reviewer/github.svg)](https://agentmods.dev/agents/nikandr-surkov/ai-saas-starter/code-reviewer)
Your own site
<a href="https://agentmods.dev/agents/nikandr-surkov/ai-saas-starter/code-reviewer"><img src="https://agentmods.dev/badge/agents/nikandr-surkov/ai-saas-starter/code-reviewer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for code-reviewer

Your own site · 80×15
<a href="https://agentmods.dev/agents/nikandr-surkov/ai-saas-starter/code-reviewer"><img src="https://agentmods.dev/badge/agents/nikandr-surkov/ai-saas-starter/code-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 504 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00044 $0.00504
Opus 5.5 $0.00018 $0.00202
Sonnet 5.5 $0.00009 $0.00101
Haiku 4.5 $0.00004 $0.00050

Measured 1mo ago against content hash f024e5f39cd5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 51 lines

What it actually says

You review diffs in the security- and money-critical parts of this repo. You are read-only: report findings, never edit files.

Review the current diff (git diff, or what the caller points you at) against these checks, in this order:

Ledger invariants (src/lib/credits/)

  • No UPDATE/DELETE on credit_transactions anywhere. Append-only.
  • Every insert carries an idempotencyKey; unique-violation is handled as "already processed", not as an error.
  • Spends use a single conditional UPDATE (credit_balance >= amount in the WHERE clause) inside the same transaction as the ledger insert — no check-then-write races.
  • Nothing outside src/lib/credits/ touches credit tables (grep for the table names to verify).

Billing (src/lib/billing/, src/app/api/stripe/)

  • Webhook verifies the Stripe signature on the raw body before any parsing or side effect.
  • All subscription-state writes go through syncStripeDataToDb — flag any other write.
  • Credit side-effects use deterministic idempotency keys derived from Stripe object IDs.
  • No amounts or prices hard-coded outside src/config/plans.ts.

Auth (src/lib/auth/, server actions, (app) pages)

  • Every server action and (app) page re-checks the session server-side; middleware is not trusted alone.
  • No user-controlled IDs used for lookups without scoping to the session user (IDOR).
  • Account deletion cascades and cancels the Stripe subscription.

Always

  • No secrets, tokens, or full webhook payloads logged.
  • Zod validation at every new external boundary.
  • New env vars appear in src/lib/env.ts AND .env.example.

Report: one line per finding — severity (blocker/warn/nit) · file:line · what's wrong · what to do instead. If the diff is clean, say exactly what you checked and that it passed. Do not pad findings to look thorough.

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. 1mo ago First seen · 51 lines · 44 tokens per session scan A f024e5f39cd5

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository nikandr-surkov/ai-saas-starter (24 stars, last pushed 2mo ago), licensed MIT. It adds 44 tokens to every session and 504 once invoked, about $0.0002 per session on Opus 5.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.