Study FAQ
How should a Claude Code CI review validate findings and avoid duplicate comments after a new commit?
Also asked as 2
- How do I recheck Claude-generated review findings against the current revision?
- What should a CI review retain to distinguish a new bug, an unresolved finding, and a verified fix?
Answer
Bind every review to an exact revision, verify each claimed failure against the code, and retain prior findings with their evidence and disposition. A parseable report or completed Claude Code process does not establish that a defect is real or fixed.
Supply the intended diff, relevant surrounding code, acceptance criteria, shared project guidance and available fixtures. Ask for a concrete failure scenario and source location per finding. A fresh review context can reduce inherited author assumptions, but it still needs the correct checkout and enough evidence.
For a custom headless job using --output-format json with --json-schema, check that structured_output exists before consuming it. Validate its shape, then separately check that each path and line belongs to the reviewed revision and that the failure scenario is supported. Missing or partial input keeps the review incomplete even when the process returns text.
Retain a stable finding identifier, relevant code identity and location, examined revision, scenario, evidence and resolution state. On the next commit, follow moved or renamed code instead of matching only the old line number. Suppress a duplicate only after confirming it represents the same issue.
If a null check was moved before a dereference, rerun the null-input case and record the observed result before marking the finding fixed. A rename that leaves the failing order unchanged remains unresolved. Keep skipped findings distinct from verified repairs.
Before publishing an inline comment, recheck the current head and valid diff coordinates. A concurrent push can make a previously valid location stale. Generating findings and posting comments are separate actions with separate authority. Preserve incomplete checks and review limits rather than presenting them as a clean result.
Full explanation
Integrate Claude Code into CI/CD pipelines
Learning material · CCAR-F
Read the full explanation