Study FAQ
How do I reduce false positives in Claude code review with explicit finding criteria?
Also asked as 2
- What review rules help Claude distinguish a demonstrated bug from a speculative finding?
- How should I evaluate whether a stricter Claude review prompt reduced noise without hiding defects?
Answer
Define a reportable defect through its required evidence, scope and exclusions, then evaluate both false alarms and missed defects. Instructions such as “be conservative” leave the reporting threshold ambiguous and can hide findings without establishing better accuracy.
For a comment-accuracy category, require a contradiction between the stated behavior and the actual implementation, a current location and a concrete input or path demonstrating it. If attempts counts retries already performed and the contract allows at most three, attempts < 3 rejects another retry at three; attempts <= 3 permits a fourth. Inspect the caller's counting convention before reporting the latter as a defect. A preferred wording or unverified off-by-one suspicion does not meet that rule.
State which changes and paths are in scope and whether style belongs in the report. Keep impact, introduction history and verification separate: a pre-existing authorization defect can remain severe, while a confident naming preference can remain nonblocking. Excluded paths and categories remain explicit coverage limitations. A developer dismissal needs an adjudicated reason; duplicate, accepted risk and out of scope do not automatically mean false positive.
Use a fixed, independently labeled evaluation set with category counts. In a teaching set with TP=12, FP=8, FN=8 and TN=72, precision is 12/20=60%, recall is 12/20=60%, and false-positive rate is 8/80=10%. The 40% false share among posted findings has a different denominator from FPR. With no posted findings, precision is undefined rather than 100%.
For a noisy category, add discriminating positive and negative examples, revise its rule and retest held-out cases under the same scope. If automated posting is paused, record the resulting coverage gap and the evidence required to restore it. Track recall and reviewer burden so fewer reports cannot masquerade as a complete improvement.
Anthropic guidance on explicit instructions and examples · Measurable evaluation criteria
Full explanation
Design prompts with explicit criteria to improve precision and reduce false positives
Learning material · CCAR-F
Read the full explanation