SwiftRelay

← All sprint notes

Claude Haiku 4.5: Your First Code Review Lap

Model splitsEN

A first-pass code review is a check before a teammate takes a closer look. You want to catch obvious mistakes, identify missing tests, and make the change easier to discuss. Claude Haiku 4.5 can help with that initial sweep, provided you give it a clear task and treat its findings as suggestions rather than verdicts.

Think of the model as an extra reader, not the person approving your release. It can point to suspicious code and explain a possible failure. You still need to check whether that failure is real.

Start Claude Haiku 4.5 with One Small Diff

A diff shows the lines added and removed in a change. It is a useful starting point because it keeps the review focused. Instead of pasting an entire repository, share one coherent change: a validation update, a new endpoint, or a fix to a calculation.

Include enough surrounding code to make the change understandable. A function call without its definition may hide important behavior. A database update without the transaction boundary may invite guesses. If the model needs another file, let it ask rather than encouraging it to fill gaps.

  • State the goal: Explain what the change should accomplish in one or two sentences.
  • Provide the diff: Include the changed lines and relevant surrounding functions.
  • Name the constraints: Mention compatibility requirements, expected inputs, and behavior that must stay unchanged.
  • Protect sensitive information: Remove credentials, personal data, and confidential material you are not authorized to share.

Give the Reviewer a Narrow Checklist

A vague request such as “review this code” leaves the model to choose its own priorities. For a first run, ask about correctness, edge cases, error handling, and tests. Keep formatting preferences out of the way unless they affect behavior.

For example, imagine a checkout change that accepts a discount percentage. Useful review questions include whether negative values are rejected, whether values above the allowed maximum are handled, and whether rounding follows the product rules. These are concrete questions you can verify.

Ask the model to separate demonstrated problems from questions that need more context. That distinction helps prevent a plausible concern from sounding like a confirmed bug.

Use This First-Pass Review Prompt

Prompt: Review the following diff as a first-pass code reviewer. Focus on correctness, input boundaries, error handling, and missing tests. Avoid style-only suggestions. For each finding, identify the file and relevant lines when available, explain the failure scenario, and suggest a way to verify it. Do not invent line numbers or behavior from unseen code. Separate likely defects from questions requiring more context. If you find no supported issues, say so. Here is the intended behavior, followed by the diff.

Put your description and diff after that instruction. If the response becomes a long list of speculative warnings, ask it to retain only findings supported by the supplied code. A short, defensible review is more useful than a crowded checklist of possibilities.

Verify Each Finding Before Changing Code

Read every finding against the actual implementation. The model may misunderstand a framework convention, overlook a guarantee elsewhere, or suggest a fix that changes intended behavior. Ask what input triggers the issue and what observable result would prove it.

  • Reproduce: Write a failing test or create a small example that demonstrates the concern.
  • Inspect: Check relevant callers, validation layers, and existing tests.
  • Decide: Fix confirmed defects, dismiss unsupported claims, and record unresolved questions for the human reviewer.

A clean response is not proof that the change is safe. Run your normal tests and checks, and keep human review for security-sensitive decisions, architecture, and product intent.

Set Up a Repeatable Review Lap with SwiftRelay

If you want to try this workflow through a shared API entry point, SwiftRelay offers pay-as-you-go, per-token access to Claude Haiku 4.5. It works with Claude Code and OpenAI-compatible SDKs. Use https://api.fastapirelay.com as the bare host for Claude Code; OpenAI-compatible SDKs use https://api.fastapirelay.com/v1.

Sign up for SwiftRelay to try a small review with the gift credit available to new accounts. Keep the first experiment simple: one diff, one focused prompt, and a manual check of every finding. Save the prompt alongside your review checklist so your next lap starts with the same clear expectations.

Keep reading

Back for another lap?Log in