AnthropicClaude Certified Architect – Foundations2026-103.6 Integrate Claude Code into CI/CD pipelines
Auto-Retry Flaky Tests
Completed by opening the official lab
Why it matters
Section 3.6 runs Claude Code where no one reads its reply. This workflow shows a later step acting on Claude’s verdict, which is safe only when that verdict is structured and checked.
What to practise
A workflow_run trigger starts the job after a CI failure, anthropics/claude-code-action reads the failed logs, and claude_args passes --json-schema with required is_flaky, confidence and summary fields. The validated result arrives as one structured_output JSON string that later steps parse. Watch the gates: the job reruns CI only when is_flaky is true and confidence is at least 0.7; a less confident flaky verdict only asks for manual review. Notice that the pull request comment checks is_flaky alone, so it announces a retry even when the confidence gate skipped one.
How it fits
The action and its inputs are the controls of 3.6.1; note that claude_args carries only the schema, so turns and tools stay at their defaults. The schema and the gate on its fields are 3.6.2: compare structured_output with the plain JSON result envelope, and ask what the retry step should do if a field is missing.