Key points
- The -p (or --print) flag runs Claude Code non-interactively: it processes the prompt, prints, and exits.
- --output-format json with --json-schema produces structured output a pipeline can parse, for example to post inline PR comments.
- CLAUDE.md is how CI-invoked Claude Code learns testing standards, fixture conventions and review criteria.
- Session context isolation: the session that generated code is a weaker reviewer of it than an independent instance.
- Re-running a review after new commits should include the prior findings so only new or unaddressed issues are reported.
- Test generation needs the existing test files in context to avoid duplicating covered scenarios.
Common misconceptions
- "The interactive command works the same in CI." Without -p it waits for input that never comes.
- "A script can reliably parse prose findings." Wording shifts; a JSON schema does not.
- "The session that wrote the code knows it best, so it reviews best." It also carries the reasoning that produced the bugs.
Watch for
- Workarounds such as feeding stdin or environment variables that do not exist instead of -p.
- Review threads that double on every push because resolved findings are reposted.
- Generated tests that repeat what the suite already covers.
Practice Task 3.6
Start with the free 10-question check to see where you stand across all five domains. In CCA Prep Studio, 56 practice items cover this task, each tracked toward your mastery score.