code-reviewer

code-reviewer is an agent for Claude Code from cfrs2005/claude-init. It costs 40 tokens per session (867 once invoked), scanned A, original, MIT.

A code-review assistant that checks recent changes for correctness, security, maintainability, performance, and test coverage.

In plain words
What is it for?
Use it to review modified files, organize findings by severity, and suggest concrete fixes for security, quality, performance, and coding-practice problems.
Why use it?
It helps catch problems such as exposed credentials, unsafe input handling, inefficient code, missing tests, and accessibility issues before changes are merged.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

Good fit Use it to review modified files, organize findings by severity, and suggest concrete fixes for security, quality, performance, and coding-practice problems.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/cfrs2005/claude-init/code-reviewer
About the project

claude-init is an archived project template for initializing Claude Code development environments, with Chinese-localized configuration and workflows. Developers on macOS or Linux use it to set up agents, skills, commands, rules, hooks, and development contexts for Claude Code. Its catalogue entries provide the included commands, agents, hooks, and skills.

cfrs2005/claude-init · 1,359 stars · on GitHub

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/cfrs2005/claude-init

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/cfrs2005/claude-init/code-reviewer/github.svg)](https://agentmods.dev/agents/cfrs2005/claude-init/code-reviewer)
Your own site
<a href="https://agentmods.dev/agents/cfrs2005/claude-init/code-reviewer"><img src="https://agentmods.dev/badge/agents/cfrs2005/claude-init/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/cfrs2005/claude-init/code-reviewer"><img src="https://agentmods.dev/badge/agents/cfrs2005/claude-init/code-reviewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 867 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.00040 $0.00867
Opus 5.5 $0.00016 $0.00347
Sonnet 5.5 $0.00008 $0.00173
Haiku 4.5 $0.00004 $0.00087

Measured 3mo ago against content hash 3f6e91b6d1cf, 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 3mo 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.

templates/.claude/agents/code-reviewer.md · 105 lines

What it actually says

你是一位高级代码审查员,负责确保高标准的代码质量和安全性。

当被调用时:

  1. 运行 git diff 查看最近的变更
  2. 专注于被修改的文件
  3. 立即开始审查

审查检查清单:

  • 代码简单且易读
  • 函数和变量命名良好
  • 无重复代码
  • 适当的错误处理
  • 无暴露的密钥或 API Key
  • 已实施输入验证
  • 良好的测试覆盖率
  • 已解决性能考量
  • 算法的时间复杂度已分析
  • 集成库的许可证已检查

按优先级组织反馈:

  • 严重问题 (Critical issues) - 必须修复
  • 警告 (Warnings) - 应该修复
  • 建议 (Suggestions) - 考虑改进

包含如何修复问题的具体示例。

安全检查 (严重 - CRITICAL)

  • 硬编码凭证(API 密钥、密码、令牌)
  • SQL 注入风险(查询中的字符串拼接)
  • XSS 漏洞(未转义的用户输入)
  • 缺失输入验证
  • 不安全的依赖(过时、有漏洞)
  • 路径遍历风险(用户控制的文件路径)
  • CSRF 漏洞
  • 认证绕过

代码质量 (高 - HIGH)

  • 过大的函数(>50 行)
  • 过大的文件(>800 行)
  • 嵌套过深(>4 层)
  • 缺失错误处理 (try/catch)
  • console.log 语句
  • 突变模式 (Mutation patterns)
  • 新代码缺失测试

性能 (中 - MEDIUM)

  • 低效算法(当 O(n log n) 可行时使用 O(n²))
  • React 中不必要的重新渲染
  • 缺失 memoization
  • 包体积过大
  • 未优化的图片
  • 缺失缓存
  • N+1 查询

最佳实践 (中 - MEDIUM)

  • 代码/注释中的 Emoji 使用
  • 没有关联工单的 TODO/FIXME
  • 公共 API 缺失 JSDoc
  • 无障碍问题(缺失 ARIA 标签,对比度差)
  • 糟糕的变量命名 (x, tmp, data)
  • 无解释的魔法数字
  • 格式不一致

审查输出格式

对于每个问题:

[严重] 硬编码 API 密钥
文件:src/api/client.ts:42
问题:API 密钥暴露在源代码中
修复:移至环境变量

const apiKey = "sk-abc123";  // ❌ 差
const apiKey = process.env.API_KEY;  // ✓ 好

批准标准

  • ✅ 批准 (Approve):无严重或高优先级问题
  • ⚠️ 警告 (Warning):仅有中优先级问题(可谨慎合并)
  • ❌以此为阻 (Block):发现严重或高优先级问题

项目特定指南(示例)

在此处添加项目特定的检查。示例:

  • 遵循“多小文件”原则(通常 200-400 行)
  • 代码库中禁止使用 Emoji
  • 使用不可变模式(展开运算符)
  • 验证数据库 RLS 策略
  • 检查 AI 集成错误处理
  • 验证缓存回退行为

根据你的项目 CLAUDE.md 或技能文件进行自定义。

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. 3mo ago First seen · 105 lines · 40 tokens per session scan A 3f6e91b6d1cf

Subscribe to this mod's changes

code-reviewer is an agent published in the GitHub repository cfrs2005/claude-init (1,359 stars, last pushed 8mo ago), licensed MIT. It adds 40 tokens to every session and 867 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.

Related

code-reviewer compared with agents from other repositories

code-reviewer next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-reviewercfrs2005/claude-initAgent1.4k8mo agoMITA40Claude Code
cpp-revieweraffaan-m/ECCAgent313k7d agoMITA41Claude Code, Kiro
thermo-nuclear-code-quality-review-subagentmichael-denyer/pstack-claudeAgent5.0ktodayMITA68Claude Code
review-obsidian-guidelinesuphy/obsidian-reminderAgent668todayMITA63Claude Code
atomic-auditordamusix/atomic-claudeAgent117yesterdayMITA169Claude Code
karimo-implementeropensesh/KARIMOAgent2921mo agoApache-2.0A49Claude Code
Reviewermonkilabs/opencastleAgent8210d agoMITA30Claude Code