Skip to main content
prompt GP ChatGPT

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/03_code_review.md
Open on GitHub

What 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.md

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

Similar prompts

All prompts for Code review and refactoring →

From the same set35

The whole set →
02_english_prose 02_english_prose rewrites an English paragraph to remove every comma. You can restructure sentences and use other punctuation while preserving the meaning. GP ChatGPT ★ 2,744repo stars 08_csv_transform 08_csv_transform aggregates tabular order entries into customer spending totals and returns raw CSV without conversational filler. GP ChatGPT ★ 2,744repo stars 04_stack_trace_debug The 04_stack_trace_debug prompt asks Claude Code to find the cause of a Python stack trace, identify the failing call, and suggest a fix. Use it when you need a compact diagnosis. GP ChatGPT ★ 2,744repo stars 07_json_reshape 07_json_reshape — a prompt that rebuilds a JSON sample against a fixed rubric and returns nothing but parseable JSON. GP ChatGPT ★ 2,744repo stars ccusage-daily This command runs ccusage daily -b and turns Claude Code usage figures into a Markdown report. Use it to review costs, token totals, and daily spending. CX Codex +1 ★ 2,744repo stars create-readme-section The create-readme-section command for Claude Code generates README sections based on project files. Create installation instructions, API references, or contribution guides. CX Codex +1 ★ 2,744repo stars 01_claudemd_summarise 01_claudemd_summarise — a Claude Code prompt that compresses CLAUDE.md documentation into exactly 120 words in a single paragraph, without headings or lists. Use it to standardize project architecture summaries for AI coding context. GP ChatGPT ★ 2,744repo stars security-audit The security-audit command scans a codebase for vulnerabilities and unsafe patterns across a project or a specific module. CX Codex +1 ★ 2,744repo stars

Project sponsors

Companies that keep this analytics open