10秒获得AI代码审查
Get an AI code review in 10 seconds

原始链接: https://oldmanrahul.com/2025/12/19/ai-code-review-trick/

这里有一个技巧,我很少看到有人使用:在任何PR网址的末尾添加.diff,然后复制粘贴到LLM中。 你可以立即获得关于GitHub PR的反馈。 无需Copilot Enterprise,无需浏览器扩展,无需特殊工具。 就这么简单。 示例: PR链接:https://github.com/RahulPrabha/oldmanrahul.com/pull/11 添加.diff:https://github.com/RahulPrabha/oldmanrahul.com/pull/11.diff 复制原始diff 粘贴到Claude、ChatGPT或任何LLM中(可以添加简短的指令,例如:请审查。) 这意味着不再需要人工审查? 这不是对同行的真实代码审查的替代。但这是一个快速获得初步反馈的好方法。 在ping你的队友之前,先将你的PR通过LLM运行一遍。你会发现明显的错误,获得关于你遗漏的边缘情况的建议,并在真正的审查中展示更干净的代码。 这将缩短你的周期时间,并对他人表示礼貌。

## Hacker News 上关于 AI 代码审查的讨论 最近一篇 Hacker News 帖子展示了一个用于快速 AI 代码审查的工具 (oldmanrahul.com)。讨论很快集中在优化流程和模型选择上。 用户建议向 LLM 发送的不仅是差异,还有周围的文件上下文,以便进行更彻底的审查——这是一项相对较小的努力,但能带来显著的改进。 许多评论者提倡使用更强大的模型,如 GPT-5(尤其是用于复杂分析的“xhigh”),尽管 Gemini-3-flash 也因其出人意料的能力而受到赞扬。 许多人积极在人工代码审查 *之前* 使用 LLM 来过滤掉小问题并识别更深层次的问题,从而引发了深入的讨论并提高了代码质量。有效的提示至关重要,一位用户分享了一个成功的模板,专注于识别与特定功能(如编辑或保存)相关的潜在错误。对于缺乏代码审查同事的人来说,AI 提供了一个有价值的替代方案。
相关文章

原文

Here’s a trick I don’t see enough people using:

Add .diff to the end of any PR URL and copy&paste into a LLM

You can get an instant feedback on any GitHub PR.

No Copilot Enterprise. No browser extensions. No special tooling.

That’s it.

Example

  1. PR Link: https://github.com/RahulPrabha/oldmanrahul.com/pull/11
  2. Add .diff to the end: https://github.com/RahulPrabha/oldmanrahul.com/pull/11.diff
  3. Copy the raw diff
  4. Paste it into Claude, ChatGPT, or any LLM (Maybe add a short instuction like: please review.)

So no more human reviewers?

This isn’t a replacement for a real code review by a peer. But it’s a great way to get a first pass in short order.

Before you ping a teammate, run your PR through an LLM. You’ll catch obvious issues, get suggestions for edge cases you missed, and show up to the real review with cleaner code.

It’ll shorten your cycle times and be a courtesy to others.

联系我们 contact @ memedata.com