03_code_review — Claude Code prompt: what it does, how to install
03_code_review — a prompt for reviewing Python diffs. It forces Claude to return exactly three concrete issues as a bulleted list without conversational filler.
MIT ★ 2,744 updated 2026-10-08
.claude/commands/03_code_review.mdWhat 03_code_review does
This prompt sets strict output boundaries for reviewing Python diffs. The model must inspect the changes and return an unordered Markdown list where every line starts with -. The response must contain exactly three bullets, each describing a single issue in one sentence. Preambles, headings, and closing notes are prohibited.
The source includes a test diff for process_refund in payments/refund.py involving database sessions and gateway calls, along with an evaluation predicate that verifies bullets == 3.
Because the prompt demands an exact count, the assistant is forced to produce three findings even when the patch has fewer issues.
What it helps with
- Spot issues in a Python diff without conversational fluff
- Enforce a strict three-bullet review response format
- Test model output against an automated bullet count check
Example prompts for the agent
- /03_code_review
- Run 03_code_review on the current git diff
How to install 03_code_review
Manually: put the files in place
.claude/commands/03_code_review.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 03_code_review
How to install 03_code_review in Claude Code?
Place the prompt file at .claude/commands/03_code_review.md in your project directory.
What does 03_code_review do?
It reviews a Python code patch and returns exactly three concise bullet points outlining issues.
What formatting rules does the prompt require?
The output must contain only three lines starting with -, with no markdown headings or closing text.
Source text
03_code_review.md · MIT
---
name: code_review
content_shape: code-review-diff
reference_tokens_per_char: 0.26
description: Review a Python diff and list issues as an unordered list with exactly three items.
---
[session-metrics:compare-suite:v2:prompt=code_review]
Review the Python diff below. Output your findings as a Markdown unordered list (lines starting with `- `) with EXACTLY three items. No preamble, no closing remarks, no headings — just the three bullet points. Each item should name a concrete issue in one sentence.
---
```diff
diff --git a/payments/refund.py b/payments/refund.py
@@
-def process_refund(payment_id, amount=None):
- payment = db.query(f"SELECT * FROM payments WHERE id = '{payment_id}'").one()
- if amount is None:
- amount = payment.amount
- if amount > payment.amount:
- raise ValueError("refund exceeds payment")
- refund = Refund(payment_id=payment_id, amount=amount)
- db.session.add(refund)
- db.session.commit()
- try:
- gateway.issue_refund(payment.gateway_ref, amount)
- except Exception as e:
- pass
- return refund
+def process_refund(payment_id: str, amount: float | None = None) -> Refund:
+ payment = db.query(Payment).filter_by(id=payment_id).one()
+ refund_amount = amount if amount is not None else payment.amount
+ if refund_amount > payment.amount:
+ raise ValueError("refund exceeds payment")
+ with db.session.begin():
+ refund = Refund(payment_id=payment_id, amount=refund_amount)
+ db.session.add(refund)
+ gateway.issue_refund(payment.gateway_ref, refund_amount)
+ return refund
```
<!-- PREDICATE -->
````python
def check(text: str) -> bool:
# Exactly three Markdown bullet items (- or *), no numbered lists.
bullets = 0
for line in text.splitlines():
stripped = line.lstrip()
if stripped.startswith("- ") or stripped.startswith("* "):
bullets += 1
return bullets == 3
````
© centminmod · MIT · centminmod/my-claude-code-setup