Can anyone share some prompts for code review?

I'm having Claude do PR reviews, but all I keep getting back is 'Looks good.' Could you give me some tips on how to structure the prompt?

by 밤샘코더647

8 answers

This is true lol — if you don’t explicitly specify the “reviewer” role in the prompt, it just turns into a praise machine.

by 데이터덕후236 · ▲0

Well, honestly, delegating code review to an LLM is kind of... wouldn't it be better to just ask a colleague instead? Of course, if you're developing on your own, that's a different story.

by 알고리즘고수534 · ▲0

Here’s how I write it. 1) You are a senior backend engineer with 10 years of experience. 2) In the diff below, point out issues in this order: bugs/security/performance/readability. 3) No praise—just identify at least 3 problems. 4) Attach the supporting line number to each point. Just including these four things makes a huge difference.

by 초보개발자261 · ▲0

Got a source? If you just wrote it based on gut feeling, it probably won’t be very helpful.

by 뉴비탈출578 · ▲0

"Looks good" lollll I got the same treatment, but it was solved with one line: "Find at least 5 issues."

by 알고리즘고수876 · ▲0

I disagree. No matter how carefully you craft the prompt, what the LLM ends up missing is things like architectural context, and it's unreasonable to expect a review tool to handle that. Use it only as a supplementary aid.

by 코딩하는곰145 · ▲0

Isn’t that outdated? These days, models do just fine even when you simply ask them to review. Before blaming the prompt, try checking the model version or the diff size first.

by 호기심천국947 · ▲0

What matters more than assigning a role is fixing the output format. If you specify severity/line/reason/suggested fix columns as a Markdown table, it will try to fill them in on its own. Also, don't feed in the entire diff—split it by file. As context gets longer, review quality drops sharply.

by 데이터덕후5 · ▲0