A Two-Pass Verification Prompt for Catching Claude’s Calculation Errors

Macro photo of a green printed circuit board representing a verification pass in an automated pipeline

Catch Claude’s calculation errors by splitting the task into two passes instead of one: a first prompt that produces a draft answer, and a second step that asks Claude to verify that draft against explicit test criteria before it’s returned. Anthropic’s own prompt engineering documentation says this verification instruction “catches errors reliably, especially for coding and math,” and recommends running it as a separate, loggable step rather than folding everything into one long prompt. The walkthrough below builds both passes with prompts you can copy directly, plus the one current model where adding this step does more harm than good.

Photo: Peter Shanks from Hobart, Australia, CC BY 2.0, via Wikimedia Commons.

Why a single prompt isn’t enough for anything with arithmetic in it

A single prompt asks Claude to produce an answer and move on; nothing in that flow asks it to go back and check the arithmetic against the original numbers. Anthropic’s documentation treats this as a known gap and names a specific fix: appending an instruction that tells Claude to verify its answer against stated criteria before finishing, which the documentation says works “especially for coding and math.” The fix is cheap to add, and per Anthropic’s own prompt-chaining guidance, it’s most useful as a separate step you can inspect rather than a line buried inside a longer prompt. Multi-step financial math is a common place this shows up in practice, since each added operation, such as a discount, then tax, then a fee, is another point where the order of operations can quietly flip.

Step 1 — Write the draft prompt

The draft prompt is the ordinary task prompt, unchanged. Keep it separate from the verification step on purpose: that separation is what lets you log, inspect, or replace either half independently later.

You are calculating a final invoice total.

Inputs:
- Subtotal: $4,280.00
- Discount: 12% off subtotal
- Tax: 8.25% applied after the discount
- Shipping: flat $35.00, added after tax

Calculate the final total, showing each step.

Listing the inputs as discrete labeled values, instead of burying them in a paragraph, matters for step two: the verification pass needs concrete numbers to check against, not prose it has to re-extract and potentially misread on its own.

Step 2 — Add the verification pass, with concrete criteria

A generic “check your work” instruction gives Claude nothing specific to check against. Anthropic’s documentation recommends the opposite: “verify your answer against [test criteria],” naming explicit criteria rather than a vague request. The prompt below takes the draft answer from step one and the original inputs, then lists four concrete checks.

Here is a draft answer to the invoice calculation above:
[paste the draft output from step 1]

Verify this answer against these specific checks before confirming it:
1. Does the discount apply to the subtotal only, not to tax or shipping?
2. Is tax calculated on the post-discount amount, not the original subtotal?
3. Is shipping added after tax, not before?
4. Do the four numbers (subtotal, discount, tax, shipping) combine correctly to produce the stated final total?

If any check fails, show the corrected calculation. If all checks pass, confirm the answer unchanged.

Each check is doing a different job, which is why four is the right number rather than one. Check 1 catches an order-of-operations mistake — applying the discount to the wrong base. Check 2 catches a tax-base error, where tax gets calculated before the discount instead of after. Check 3 catches a common shipping-timing mistake, since flat shipping fees are often (incorrectly) taxed. Check 4 is a pure arithmetic cross-check that’s independent of the three logic checks above it, which means it can catch a plain transcription or addition error even when the reasoning behind each step was correct.

Before and after: what the verification pass actually catches

Here is the kind of mistake check 2 is built to catch, worked through with the same invoice numbers from step one. A flawed draft that applies tax to the original subtotal instead of the post-discount amount — an easy slip when a prompt doesn’t spell out the order of operations — produces a total that’s wrong by exactly the tax rate applied to the discount amount.

StepFlawed draftCorrected after verification
Discount (12% of $4,280.00)$513.60$513.60
Post-discount subtotal$3,766.40$3,766.40
Tax (8.25%)$353.10 — calculated on the original $4,280.00$310.73 — calculated on the post-discount $3,766.40, per check 2
Shipping$35.00$35.00
Final total$4,154.50$4,112.13

The $42.37 gap between the two totals comes entirely from which amount tax gets applied to — a detail that’s easy to state correctly in an instruction and just as easy to drop silently when a model works through several steps in a row. Check 4, the pure arithmetic cross-check, would also fail here even if checks 1 through 3 somehow passed, which is why the verification prompt runs all four rather than stopping at the first one that seems relevant.

Step 3 — Chain it as two separate calls, not one prompt

Anthropic’s chaining documentation is explicit about why this should be two API calls instead of one: “each step is a separate API call, so you can log, evaluate, or branch at any point.” In practice, that means the draft output from step one becomes an input to step two, and the result of step two decides what happens next — accept the answer, retry the draft, or flag the case for a human if the checks keep failing. This maps onto Anthropic’s documented three-step self-correction pattern of draft, review against criteria, and refine. For pure calculation-checking, you can often collapse the last two steps into one call: instead of a separate “refine” pass, ask the verification prompt to output the corrected number directly when a check fails, since the correction is usually arithmetic rather than a rewrite that needs its own review.

The one model where you should remove this instruction

Anthropic’s documentation calls out Claude Opus 5 as an exception: it verifies its own work well without being told to, and a verification instruction carried over from an earlier prompt template can cause over-verification on Opus 5, adding tokens and latency for no accuracy gain. The documentation’s advice is specific — remove the instruction for Opus 5 rather than trying to soften its wording. If your pipeline runs the same prompt template across several models, that’s a reason to keep the verification instruction in a separate, conditionally-included block rather than hard-coded into the base prompt.

When the extra call isn’t worth it

Not every calculation needs a second pass. A single addition with two numbers and no intermediate steps rarely benefits from a verification call — there’s nothing for the four-check structure above to meaningfully check that a glance wouldn’t catch just as fast. The pattern earns its cost specifically when a calculation has more than one step, when the order those steps run in changes the result, or when a wrong answer would reach someone before a human reviews it. The invoice example above qualifies on all three counts: three sequential operations (discount, tax, shipping), an order that changes the answer if swapped, and a total that often goes straight into a customer-facing document.

Where adaptive thinking changes the picture

On current models, adaptive thinking handles most multistep reasoning internally, which is part of why Anthropic’s own documentation says Claude’s reasoning “frequently exceeds what a human would prescribe” through manual chain-of-thought instructions. Explicit two-pass chaining is still worth keeping for a narrower reason than catching every error: it lets you inspect the intermediate draft output and enforce a specific pipeline structure, which a single call with internal thinking doesn’t expose. If the output also needs to stay in a predictable shape so the verification step can parse it programmatically, embedding a JSON schema directly in the prompt keeps the draft pass structured enough for step two to check it reliably, and the same inspection principle applies to grounding prompts that stop Claude from answering outside the provided documents — both are about giving a later step in the pipeline something concrete to check against, not just a vague instruction to “be careful.”

Make it count: log and evaluate every pass

A two-pass pattern is only as useful as your ability to see when it actually changes an answer. Logging both the draft and the verification result lets you measure how often checks fail, which is the only honest way to know whether the extra call is earning its cost on your specific workload. A regression test suite for Claude prompts covers one way to wire that logging into an evaluation pipeline instead of eyeballing outputs by hand, and the same discipline applies to citation-style verification — prompting Claude to cite the exact sentence behind every claim is the same pattern applied to factual accuracy instead of arithmetic.

None of this makes Claude incapable of arithmetic mistakes — it makes the mistakes visible at a point in the pipeline where you can still do something about them. That’s the actual value of the second pass: not a guarantee of correctness, but a checkpoint that catches a known class of error before it reaches whoever is reading the final number.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top