Code review checklist with Claude
Goal: get a severity-ranked review of a diff focused on correctness—not style nits.
Best for: Claude chat or Claude Code-style workflows. You still run tests and own the merge.
Use AI as a checklist buddy—not an autopilot merger. You still run tests.
Why beginners skip this
Asking Claude to “look at this diff” without severity order wastes the review. Style nits crowd out blockers when you skip a ranked checklist.
Habit this week (Asia/Shanghai): paste one real diff and demand blocker / major / nit—reject invented file names; date the ranked list.
What to paste
- The diff (or changed files), not the whole repo if avoidable
- How to run tests / expected behavior
- Your definition of “blocking”
Goal: Review this diff for correctness bugs that could break production.
Ignore: formatting, import order, comment taste—unless they hide a bug.
Report format:
## Blocking
- [file:line] issue · why · suggested fix direction
## Non-blocking
- ...
## Questions for author
- ...
Boundaries: Do not rewrite the entire file. Quote the risky snippet. If unsure, ask a question instead of asserting.
How to verify: [test command or manual steps]
Diff:
---
[paste]
---
Second pass — security & edges
Example
Filled prompt
Goal: Review this diff for correctness bugs that could break production.
Ignore: formatting, import order—unless they hide a bug.
Report: Blocking / Non-blocking / Questions for author
How to verify: npm test && curl -i localhost:3000/api/orders
Diff: (auth middleware now skips JWT check when header X-Debug=1)
What good output looks like
- Blocking flags the debug bypass as ship-stopper
- Quote shows the risky if-branch
- Questions ask whether X-Debug is stripped in prod
- Pass/fail dated (Asia/Shanghai) sits next to the artifact
From the same diff, list only: authz mistakes, injection risks, secret leakage, and unchecked external input.
If none, say “None found in provided diff” — do not invent.
Make Claude verify
Example
Filled prompt
Diff adds logging of Authorization headers "for debug."
Rank Blocker if secret leakage. Demand fix idea. Nits after blockers.
What good output looks like
- Lists the debug header as authz mistake
- Does not invent SQL injection if none in diff
- Empty categories say “None found”
If you use an agentic coding setup, prefer a fresh review context so it is not biased by the authoring chat. Give it the same checklist. Run your test suite yourself.
Propose 3 regression tests (names + assert idea) for the Blocking items. Do not implement unless I ask.
Do not bookmark-only
Finish Practice now, then tick this guide on your path. Titles unread are not skills.
Close the loop
After Practice now, write one line: what you will refuse next time. That line is the habit.
Example
Filled prompt
Diff logs Authorization header "temporarily."
Blocker for secret leakage + fix idea. Nits after.
Context: real workstream this week (Asia/Shanghai). Name actual files/people.
Constraints: no invented metrics/owners/prices; label Unknowns; stop before send/delete/pay.
Done check: I can mark pass/fail in one minute on the output.
What good output looks like
- Pulls from Project/file named in the ask for “Code review checklist with Claude”
- Standing instructions respected; no silent scope creep
- Decisions quoted or labeled Unclear — never “sounds good”
- One-minute check: does output match claude-code-review-checklist Done?
Red flag
Approving without tests discussed; permission widening unnamed; merging when you cannot state the risk—withdraw.
Save this card
Card: paste real diff → demand blocker / major / nit → reject invented paths. Severity before style.
1. What I shipped: ___ 2. What I refused: ___ 3. What I will never-do again: ___ (date: Asia/Shanghai)
- [ ] Tools/writes paused
- [ ] Refuse-line dated
- [ ] Artifact path saved
- [ ] Next link chosen (or stop)
Before you start
Open the Claude Project (or new chat) you will keep. Confirm the knowledge file or standing instructions for “get a severity-ranked review of a diff focused on correctnes” are the ones you mean—not last month’s paste Guide: claude-code-review-checklist Keep the live artifact visible; a blank practice box means stop and fetch the real job first
- Goal in one line: ___
- Allowed tools: ___
- Forbidden: ___
- Human approve needed for: ___
How to use this week
This week in Claude: paste one real diff and demand a severity-ranked review (blocker/major/nit). Reject invented file names. Save the ranked list on a live artifact—not a blank demo. Write one refuse-line and date the note (Asia/Shanghai). If you only skimmed claude-code-review-checklist, put 25 minutes on the calendar and redo once.
Close the week by quoting aloud the refuse line you actually used once. If you cannot, rerun Practice now and date the pass/fail (Asia/Shanghai).
Pitfalls
Example
Filled prompt
Diff: auth session refresh returns 500 when token expired at midnight UTC.
Severity-ranked review: Blocker/Major/Nit. Each Blocker needs a repro idea.
Ignore comma nits until blockers empty.
What good output looks like
- Names like rejects_request_when_x_debug_set_in_prod
- Assert idea is clear; no full test file dumped
- You still run the suite yourself
| Pitfall | Fix |
|---|---|
| “LGTM” with no criteria | Paste the checklist above |
| Reviewing generated code you never ran | Run tests first |
| Asking for a full rewrite | Ask for findings + direction |
Field note: on one real PR today, refuse merge until correctness, tests, permissions, and readability each have a written yes/no. Date the checklist (Asia/Shanghai).
Practice now
Live card: review a real PR/diff with correctness/tests/permissions/readability—approve or request changes only (Asia/Shanghai).
Today: review one real diff with a checklist: correctness, tests, permissions, readability. Approve or request changes only after all four. Date it (Asia/Shanghai).
Today card (copy) — claude-code-review-checklist: 1. Artifact I will produce: ___ 2. Pass/fail check: ___ 3. Refuse-line if tempted to skip verify/send: ___ (date: Asia/Shanghai) 4. One never-do from this guide: ___
- [ ] Artifact path written
- [ ] Refuse example would say "yes"
- [ ] Dated Asia/Shanghai
One sentence takeaway
Paste a real diff and demand blocker / major / nit—reject invented files. This week: save one ranked review dated (Asia/Shanghai).
Next
Code path · Compare models · Claude Projects · Minimal repro · Coding agent boundaries
Pair with today: open the first Next link (path-code) only after you dated a refuse-line for this guide (Asia/Shanghai).
用 Claude 做代码审阅清单
目标: 按严重度审阅 diff,盯正确性——不是格式洁癖。
适合: Claude 对话或 Claude Code 类工作流。测试与合并仍由你负责。
把 AI 当清单伙伴——不是自动合并器。测试仍由你跑。
为什么新手跳过
只丢一句「帮我看看这份 diff」、不要求严重度排序,审阅就会被文风琐事淹没,挡住真正的阻断项。
本周习惯(Asia/Shanghai):贴一份真实 diff,要求按阻断/重要/琐碎分级;拒绝编造文件名,并把分级清单写上日期。
该贴什么
- diff(或改动文件),尽量别整仓糊进去
- 如何跑测试 / 期望行为
- 你对「阻断级」的定义
目标:审阅此 diff,找可能上线就炸的正确性缺陷。
忽略:格式、import 顺序、注释口味——除非掩盖了 bug。
报告格式:
## 阻断
- [文件:行] 问题 · 原因 · 修复方向
## 非阻断
- ...
## 给作者的问题
- ...
边界:不要整文件重写。引用风险片段。不确定就提问,别武断。
如何验证:[测试命令或手工步骤]
Diff:
[粘贴]
第二轮——安全与边界
实例
填好的提示词
目标:审阅此 diff,找可能上线就炸的正确性缺陷。
忽略:格式、import 顺序——除非掩盖了 bug。
报告:阻断 / 非阻断 / 给作者的问题
如何验证:npm test && curl -i localhost:3000/api/orders
Diff:(鉴权中间件在 header X-Debug=1 时跳过 JWT)
像样的输出大概长这样
- 阻断项标出调试旁路为发版阻塞
- 引用风险 if 分支
- 提问:生产是否剥离 X-Debug
同一 diff,只列:鉴权错误、注入风险、密钥泄露、未校验的外部输入。
没有就写「在所给 diff 中未发现」——不要编造。
让 Claude 可验证
实例
填好的提示词
同一 diff,只列:鉴权错误、注入风险、密钥泄露、未校验的外部输入。
没有就写「在所给 diff 中未发现」——不要编造。
像样的输出大概长这样
- 把调试 header 列为鉴权问题
- diff 里没有就不编造 SQL 注入
- 空类别写「未发现」
若用代理式编程,优先在新会话里审阅,避免被写作聊天带偏。给同一清单。测试套件你自己跑。
为阻断项提议 3 个回归测试(名称 + 断言思路)。我没说实现就先别写代码。
不要只收藏
做完「现在就练一次」,再在路径上打勾。没练过的标题不是技能。
闭环
「现在就练一次」后写一行:下次你要拒绝什么。那一行才是习惯。
红旗
没有测试讨论就点批准;权限或密钥范围扩大未被点名。说不清风险却仍合并——撤回审查。正确性/测试/权限/可读四项缺一不可。
保存这张卡
卡片:贴真实 diff → 要求阻断/重要/琐碎 → 拒绝编造路径。严重度先于文风。
开始前
打开你真正会用的账号/项目。准备好与「用 Claude 做代码审阅清单」相关的真实材料(不要空白练习框)。
默认姿态:在人确认发送/写入之前只出草稿。授予新工具前,先写一条带日期的拒做句(Asia/Shanghai)。
- 一句话目标:___
- 允许的工具:___
- 禁止:___
- 需要人批准:___
本周怎么用
本周一次真实 PR:按清单问正确性、测试、权限、可读性,再决定合入。把过/不过写进笔记并注明日期(Asia/Shanghai)。
常见坑
实例
填好的提示词
为阻断项提议 3 个回归测试(名称 + 断言思路)。我没说实现就先别写代码。
像样的输出大概长这样
- 名称如 rejects_request_when_x_debug_set_in_prod
- 断言思路清楚,不甩整份测试文件
- 测试套件仍由你自己跑
| 坑 | 改法 |
|---|---|
| 没标准就「LGTM」 | 贴上面清单 |
| 没跑过生成代码就审 | 先跑测试 |
| 要整篇重写 | 只要发现 + 方向 |
实例
填好的提示词
任务:get a severity-ranked review of a
场景要点:Claude Project 或长文材料打开;练习编号 4/4。
边界:仅草稿;未知 [?];禁止悄悄发送;禁止编造指标。
返回:可检查产出 + 过/不过理由一行。
像样的输出大概长这样
- 约束贴着「用 Claude 做代码审阅清单」与 claude-code-review-checklist
- 未知标 [?];不编造负责人/数字
- 不可逆动作前停下
- 一分钟内能打过/不过(claude-code-review-checklist #4)
现在就练一次
实卡:用正确性/测试/权限/可读性审真实 PR/diff——只批或只求改(Asia/Shanghai)。
今天(Asia/Shanghai)打开一条小 diff,按四项清单写下过/不过理由各一行。过:四项都有结论;不过:只写了「看起来没问题」。只收藏标题算失败。
今日卡片(可复制)— claude-code-review-checklist: 1. 我要产出的成品:___ 2. 通过/失败标准:___ 3. 若想跳过核验/发送的拒做句:___(日期:Asia/Shanghai) 4. 本篇一条永不做:___
- [ ] 成品路径已写
- [ ] 拒做例句会说「可以」
- [ ] 已标注 Asia/Shanghai 日期
一句话带走
贴真实 diff,按阻断/重要/琐碎分级;拒绝编造文件。本周保存一份带日期的分级审阅。
下一步
编程路径 · 如何选模型 · Claude Projects · 最小复现 · 编程 Agent 边界
今日搭配:先为本篇写上拒做句日期(Asia/Shanghai),再打开下一步里的第一篇(path-code)。
← Back to home · Learn · Tools · Compare · Start