Kairox Arch Prep
EXAM SCENARIO

Claude Code for continuous integration

How the Claude Code CI scenario works on the CCA-F exam: headless runs, structured output, tool allowlists, independent review and batch jobs.

In the continuous integration scenario, Claude runs inside automated pipelines: reviewing pull requests, fixing lint errors, generating release notes or processing many items overnight. Because nobody is watching each run, questions set here focus on structured output, tight permissions and reliability under failure, drawing on the Claude Code, prompt engineering and context management domains.

The setup you should picture

A pipeline step invokes Claude Code non-interactively with a prompt, asks for machine-readable output, and parses the result to post review comments or fail the build. Larger jobs, such as classifying thousands of records, run as batches on a schedule. A separate review pass may examine changes produced by an earlier step.

Decisions the exam probes

Headless invocation. Non-interactive mode with a prompt flag and JSON output is built for scripts. It should be paired with an explicit allowlist of exactly the tools and commands the job needs.

Permissions without a human. In an interactive session a developer approves risky actions. In CI nobody does, so broad shell access is denied and credentials are limited to what the job requires. Bypassing permission checks "so the job never stalls" is a classic wrong answer.

Parseable, complete output. Results are validated against a schema before use, and a "max_tokens" stop reason is treated as truncation rather than success.

Independent review. A review that runs in the same context as the code it reviews tends to share its assumptions; a separate pass that sees only the diff and the requirements is more useful.

Large jobs. Non-urgent bulk work fits the Message Batches API. Every item has its own status and can be retried idempotently; transient errors are retried with backoff and persistent failures go to a dead-letter queue.

Common traps

How to practise

Script a headless Claude Code run that reviews a small diff and returns findings as JSON, with only read tools allowed. Make the output deliberately long enough to truncate and confirm your script notices. Then write a small batch job with per-item status and simulate a few failures to see how your retry logic behaves.

The six scenarios are listed in Anthropic's official exam guide (version 1.1), with four drawn per sitting. The emphasis described here is our own study guidance, not official exam content.

Practice questions set in this scenario

Original questions, not real exam items. All 10 questions in this scenario also appear in the practice exam.

Practice question 1

Domain 1: Agentic Architecture & Orchestration

Which statements about the agentic loop on the Messages API are correct? Choose two.

  1. A. For client tools, the API runs your tool code on Anthropic's servers and returns the output
  2. B. Your application runs the requested tools and sends the results in the next request
  3. C. A stop_reason of "max_tokens" means Claude finished the task within the token budget
  4. D. Claude keeps earlier tool results between calls, so you only send the newest message
  5. E. The loop continues while stop_reason is "tool_use" and ends at "end_turn" or a limit
Show answer and explanation

Answer: B and E. With client tools, Claude only requests calls; your code runs them and returns tool_result blocks, then calls the API again. The Messages API is stateless, so the conversation is resent each time. The loop runs while Claude asks for tools and ends at end_turn or an application limit. "max_tokens" means the response was cut off, not that the task is complete.

Practice question 2

Domain 2: Claude Code Configuration & Workflows

You must guarantee that Claude Code never edits files under migrations/ in a repository, regardless of what it is asked. Which mechanism is most reliable?

  1. A. A clear rule in the root CLAUDE.md explaining that migrations must never be edited
  2. B. A PostToolUse hook that alerts the team in chat whenever a migration file changes
  3. C. Enforced controls: deny rules and a PreToolUse hook covering every write path, shell included
  4. D. A CLAUDE.md inside migrations/ that warns Claude whenever it works in that folder
Show answer and explanation

Answer: C. CLAUDE.md content is guidance the model usually follows; hooks and permission rules are enforced by the harness. The guarantee only holds if every route to a write is covered — edit and write tools and shell commands — so a PreToolUse hook that inspects tool input and blocks matches, plus deny rules (and, for full certainty, read-only file permissions for the agent process). A PostToolUse alert fires after the damage is done.

Other scenarios