CCAR-F - Claude Code Configuration & Workflows - Section 3.6

Integrate Claude Code into CI/CD pipelines.

The print flag runs Claude Code non-interactively so a pipeline job cannot hang waiting for input, and JSON output with a supplied schema produces machine-parseable findings for inline pull request comments. CLAUDE.md carries the project context a CI-invoked run needs. Candidates should feed prior review findings back on re-runs so only new or unaddressed issues are reported, and should note that the session which generated code reviews it less effectively than an independent instance.

print flag for non-interactive modeJSON output format with schemaCLAUDE.md as CI contextsession context isolationduplicate PR comment avoidance

Practice question for this objective

Free sampleClaude Code Configuration & Workflowsmedium

A platform team runs Claude Code as an automated pull request reviewer in the CI pipeline for a payments service. The job triggers on every push to an open branch and reviews the full branch diff against trunk each time. Reviewers report that a typical pull request with nine pushes carries the same four findings repeated nine times, so genuinely new findings are buried in the thread. Which change most effectively addresses the reported symptom?

  • ATrigger the review job only when the pull request is first opened, so later pushes to the branch reuse the findings already posted rather than producing fresh ones.
  • BAdd a line to the project CLAUDE.md instructing the reviewer to avoid repeating a comment it has posted before on the same pull request, and cite that rule in the review prompt.
  • CHave the job fetch the review comments already posted on the pull request and pass them to Claude Code as context, instructing it to raise only findings that are not already present. Correct
  • DResume the earlier run with the --resume flag so the reviewer carries forward the findings it produced on the previous push to the same branch and skips them.
A CI run starts with no memory of earlier runs, so prior pull request comments must be fetched and supplied as context. Duplicate comments come from statelessness, not from a missing instruction. Each pipeline run is a fresh session on a fresh runner, so the only reliable way for the reviewer to know what has already been raised is for the job to read the existing pull request comments and pass them in as input alongside the diff.

Why A is wrong: It is tempting because it removes the duplication in one line of workflow configuration, but it also removes review coverage of every commit pushed after the pull request was opened, which is where late fixes and rushed changes usually land.

Why B is wrong: CLAUDE.md is a plausible home for review policy and it is loaded on every run, but it carries instructions rather than history, so the reviewer still has no record of what it posted earlier and cannot act on the rule.

Why C is correct: This supplies the one piece of state a fresh CI run cannot have, namely what was already said on the pull request, so the reviewer can compare its findings against the existing thread while still reviewing the current code in full.

Why D is wrong: Resuming is a real capability and sounds like the right shape of fix, but CI runners are ephemeral and each job starts with no session store from the previous one, so there is nothing on disk to resume.

See more CCAR-F practice questions, answers explained.

More in this domain

Back to all Claude Code Configuration & Workflows objectives, or the CCAR-F cert hub.

Examworthy is not affiliated with or endorsed by Anthropic. Original, blueprint-aligned practice material only.