Free Claude Certified Architect - Foundations (CCAR-F) Study Resources
Free to use right now: 460 practice questions with explanations, 22 study notes and 240 flashcards. Questions follow the five domains of the published foundations outline, so practice matches how the exam is structured. Nothing here is a brain dump, and BrainyBee is not the exam vendor — the CCAR-F exam itself is booked and paid for separately.
460
Practice Questions
22
Study Notes
240
Flashcards
CCAR-F exam prep
Preparing for CCAR-F? Start practising now.
Free to use right now: 460 practice questions with explanations, 22 study notes and 240 flashcards. Questions follow the five domains of the published foundations outline, so practice matches how the exam is structured. Nothing here is a brain dump, and BrainyBee is not the exam vendor — the CCAR-F exam itself is booked and paid for separately.
The timed mock is assembled to the blueprint's 60 questions from this bank each time you start one.
Practise, read why an answer was wrong, study that domain, practise again.
The diagnostic draws questions from every domain in the exam guide, so each domain has enough evidence behind it. You answer at your own pace; nothing is charged and no card is asked for.
Each question carries a written explanation, and your results break down by exam domain so you can see which areas are costing you marks rather than guessing at them.
Study notes and flashcards for this certification are on this page and in the workspace, and the free AI tutor will answer follow-up questions about anything you just got wrong. The free tutor has fair-use limits.
Come back and practise again — a fresh set each time, and a full-length timed paper when you want to rehearse the real sitting. Your readiness estimate moves with the evidence; it is an estimate, not a probability of passing.
The diagnostic draws questions from every domain in the exam guide, so each domain has enough evidence behind it. You answer at your own pace; nothing is charged and no card is asked for.
$0 to study
Public study material, practice tests and the free AI tutor cost nothing. The free tutor has fair-use limits.
Optional AI credit top-ups start at $5, and premium usage is charged from your wallet.
No subscription and no card are needed to start free practice. The certification exam fee is separate and goes to the exam vendor.
The Claude Certified Architect – Foundations exam asks one kind of question over
and over: given this production system, which design holds up? It is not a
recall test about API parameters. Almost every item puts a working system in
front of you, breaks something about it, and offers four plausible repairs.
The exam at a glance
Items
60
Time limit
120 minutes
Structure
4 scenarios drawn from a bank of 6
Item format
Multiple-choice and multiple-response; each item states how many to select
Passing score
720 scaled, on 100–1,000
Delivery
Proctored — online or test centre, via Pearson VUE
Validity
12 months from the date awarded
The blueprint
Five domains, weighted. The weights are approximate proportions of scored
items, and they are the single best guide to where your study hours belong.
Domain weights
1 · Agentic Architecture & Orchestration
27%
2 · Tool Design & MCP Integration
18%
3 · Claude Code Configuration & Workflows
20%
4 · Prompt Engineering & Structured Output
20%
5 · Context Management & Reliability
15%
Domain 1 is the largest single block and Domain 5 the smallest, but the spread
is narrow — there is no domain you can afford to skip, and no domain that will
carry you on its own.
What the scenario draw means for you
The domains do not distribute evenly across the scenarios either. Prompt
engineering and structured output live mostly in the extraction and CI
contexts; the multi-agent and support contexts carry orchestration and context
management. So the draw moves your domain mix, which is why the practice papers
here draw four scenarios apiece rather than dealing a fixed blend.
A study sequence that works
From cold to exam-ready
1
Read the six scenario briefs first
They are short, and every question you will ever see is framed by one of them. Meeting a scenario for the first time in a practice paper wastes the reading time on orientation instead of on the question.
You are building a customer support resolution agent using the Claude Agent SDK. The agent handles high-ambiguity requests like returns, billing disputes, and account issues. It has access to your backend systems through custom Model Context Protocol (MCP) tools (get_customer, lookup_order, process_refund, escalate_to_human). Your target is 80%+ first-contact resolution while knowing when to escalate.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
1 of 6 — four are dealt at random
Primary domains
3
Questions in this hive
45
Primary domains
Agentic Architecture & Orchestration
Tool Design & MCP Integration
Context Management & Reliability
What the exam asks inside this context
Enforcement before money moves. Identity verification ahead of a refund is the canonical prerequisite-gate item, and the correct answer is programmatic every time. A refund above a threshold gets intercepted and rerouted to escalation, not talked out of.
Tool descriptions with boundaries. The four named tools are deliberately close together, and questions turn on what a description fails to say — a threshold, an input format, an edge case.
When to escalate. Three legitimate triggers: the customer asks for a human, policy is silent or has an exception, or the agent cannot make progress. Frustration is not one of them, and neither is a low self-reported confidence.
Facts that survive a long conversation. Amounts, dates, order numbers and statuses belong in a persistent case-facts block outside the summarized history, because summarization is what eats them.
You are using Claude Code to accelerate software development. Your team uses it for code generation, refactoring, debugging, and documentation. You need to integrate it into your development workflow with custom slash commands, CLAUDE.md configurations, and understand when to use plan mode vs direct execution.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
2 of 6 — four are dealt at random
Primary domains
2
Questions in this hive
50
Primary domains
Claude Code Configuration & Workflows
Context Management & Reliability
What the exam asks inside this context
Configuration scope. Which CLAUDE.md level reaches a teammate, which slash command directory is shared, and why a new joiner is missing instructions that work perfectly for everyone else.
Plan mode against direct execution. Scope decides it. A single-file fix with a clear stack trace is executed; a migration across forty-five files is planned first.
Skills and their frontmatter. context: fork for verbose or exploratory work, allowed-tools to keep a skill from doing damage, argument-hint for a missing parameter.
Iterative refinement. Concrete input/output examples and failing tests, rather than more description. Interacting problems go in one message; independent ones are better fixed one at a time.
You are building a multi-agent research system using the Claude Agent SDK. A coordinator agent delegates to specialized subagents: one searches the web, one analyzes documents, one synthesizes findings, and one generates reports. The system researches topics and produces comprehensive, cited reports.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
3 of 6 — four are dealt at random
Primary domains
3
Questions in this hive
47
Primary domains
Agentic Architecture & Orchestration
Tool Design & MCP Integration
Context Management & Reliability
What the exam asks inside this context
What a subagent inherits. Nothing. Not the parent conversation, not earlier findings, not memory between invocations — so the synthesis subagent gets the complete prior findings in its prompt or it does not have them.
Decomposition that covers. Slice a topic too narrowly and every slice is complete while the cross-cutting question is owned by nobody. Partition scope, by subtopic or by source type, before the subagents start.
Errors that a coordinator can act on. Failure type, what was attempted, partial results, alternatives. A generic 'search unavailable' is technically true and useless.
Provenance through synthesis. Claim-source mappings with URLs, document names and excerpts, preserved and merged rather than compressed away — plus dates, so a year-old figure is not read as a contradiction.
You are building developer productivity tools using the Claude Agent SDK. The agent helps engineers explore unfamiliar codebases, understand legacy systems, generate boilerplate code, and automate repetitive tasks. It uses the built-in tools (Read, Write, Bash, Grep, Glob) and integrates with Model Context Protocol (MCP) servers.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
4 of 6 — four are dealt at random
Primary domains
3
Questions in this hive
30
Primary domains
Tool Design & MCP Integration
Claude Code Configuration & Workflows
Agentic Architecture & Orchestration
What the exam asks inside this context
Which built-in for which job. Grep searches contents, Glob matches paths, Edit needs a unique anchor and Read plus Write is the fallback when there is not one.
Learning a codebase without reading it all. Grep to entry points, Read to follow imports and trace flows. Reading everything up front fills the context with files the task never touches.
Scoped tool sets. An agent holding explore, edit and deploy together will eventually edit during an investigation. The fix is the tool list, not an instruction.
MCP servers alongside the built-ins. Project versus user scope, environment variable expansion for tokens, and a description good enough that the agent does not fall back to Grep.
Scenario brief168 words
Scenario 5: Claude Code for Continuous Integration
Scenario 5: Claude Code for Continuous Integration
You are integrating Claude Code into your Continuous Integration/Continuous Deployment (CI/CD) pipeline. The system runs automated code reviews, generates test cases, and provides feedback on pull requests. You need to design prompts that provide actionable feedback and minimize false positives.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
5 of 6 — four are dealt at random
Primary domains
2
Questions in this hive
36
Primary domains
Claude Code Configuration & Workflows
Prompt Engineering & Structured Output
What the exam asks inside this context
Running non-interactively. -p, or the job hangs. Then --output-format json with --json-schema, because inline PR comments need parseable findings rather than prose to scrape.
Precision over emphasis. Explicit categorical criteria — report bugs and security, skip minor style — rather than asking for high-confidence findings only.
Independent review. The session that generated the code is the worst reviewer of it, because it holds the reasoning that produced the mistake.
Repeat runs. Prior findings go into context with an instruction to report only new or unaddressed issues, or every re-run posts the same comments again.
You are building a structured data extraction system using Claude. The system extracts information from unstructured documents, validates the output using JavaScript Object Notation (JSON) schemas, and maintains high accuracy. It must handle edge cases gracefully and integrate with downstream systems.
Passage quoted verbatim from the official CCAR-F exam guide v1.0, section 5.
This scenario on the exam
Scenario
6 of 6 — four are dealt at random
Primary domains
2
Questions in this hive
45
Primary domains
Prompt Engineering & Structured Output
Context Management & Reliability
What the exam asks inside this context
Guaranteed shape. tool_use with a JSON schema, and tool_choice set so a tool is actually called — 'any' when the document type is unknown, forced when one extraction must run first.
Schema design against fabrication. Optional and nullable fields where the source may be silent; an 'unclear' enum value and 'other' plus a detail string where the categories may not fit.
Validation that catches meaning. Schemas remove syntax errors and leave semantic ones. calculated_total beside stated_total, and a conflict_detected boolean, put the check in the output shape.
Retry, and knowing when not to. Retry with the specific validation errors attached. Do not retry when the information is simply absent from the document.
Domain 1 is the biggest block on the exam, and nearly all of it reduces to one question: what is actually in control? The loop is controlled by stop_reason, not by reading the assistant's text. Ordering is controlled by a prerequisite gate, not by an instruction. A subagent's scope is controlled by the tools it was given, not by what it was told. Read every Domain 1 stem for the mechanism, and you will find that the distractors are almost always the version where a person is trusting the model to cooperate.
Domain 1 at a glance
Blueprint weight
27% of scored items
Task statements
7
Questions in this hive
66
Flashcards in this hive
48, one per published objective
What the guide measures here
Design and implement agentic loops with proper termination conditions
Orchestrate multi-agent systems with coordinator-subagent patterns
Configure subagent invocation, context passing, and spawning
Implement multi-step workflows with enforcement and handoff patterns
Apply Agent SDK hooks for tool call interception and data normalization
Design task decomposition strategies for complex workflows
Manage session state, resumption, and forking
The order to learn them in
Working through Domain 1
1
The agentic loop
Start with the agentic loop. Everything else in the domain sits inside one, and the three termination anti-patterns are the most reliably examined facts here.
Hands-on Lab1,199 words
Domain 1 Project — build a support agent, then make it a team
Domain 1 Project — build a support agent, then make it a team
One system, seven stages. You start with a single agent that can call two
tools and finish with a coordinator delegating to subagents across resumable
sessions. Every stage is one of Domain 1's seven task statements, so finishing
the project is finishing the domain's practical half.
Domain 1 is 27% of the exam, the largest block, and nearly all of it reduces to
one question: what is actually in control? You cannot answer that from
reading. You answer it by writing the loop, watching it stop for the wrong
reason, and fixing it.
The project at a glance
Domain
1 · Agentic Architecture & Orchestration (27%)
Stages
7, one per task statement
Difficulty
Intermediate
Total time
180 minutes
You need
Python 3.10+, the anthropic SDK, an API key
Based on
Exam guide Preparation Exercises 1 and 4
What you will be able to do
Write an agentic loop that terminates on stop_reason and explain why the other three termination strategies are wrong
Enforce a business rule in code and say when a prompt instruction is not enough
Build a coordinator that delegates to subagents and explain what each subagent does and does not inherit
Choose between a fixed pipeline and adaptive decomposition, and justify the choice from the task rather than from preference
Decide between resuming a session, forking it, and starting fresh with an injected summary
Before you start
Three commands and a smoke test. Do this before stage 1 — a setup problem
discovered halfway through a loop looks exactly like a loop bug, and you will
spend the difference debugging the wrong thing.
No key yet? Create one in the Anthropic Console. Every stage in this project
costs a few cents at most; the loop you build sends short messages.
Now put this in agent.py and run python agent.py:
python
import anthropic
response = anthropic.Anthropic().messages.create( model="claude-opus-5", max_tokens=64, messages=[{"role":"user","content":"Reply with the single word ready."}],)print(response.stop_reason, response.content[0].text)
You should see end_turn ready. If you do, the install works, the key works,
and you have already met the one field the whole of stage 1 turns on.
If instead you see an authentication error, the key is wrong or not exported in
this shell. If the import fails, the virtualenv is not active — the source
line above has to be re-run in every new terminal.
Build it in this order
The order is not the guide's. It is the order the system needs: enforcement has
to have a loop to enforce, hooks intercept calls the loop is already making, and
a coordinator is only worth having once there is decomposition to hand out.
Seven stages
1
1.1 · The loop · 30 min
BUILD — Two tools — lookup_order and a calculator — and a loop that calls the Messages API, branches on stop_reason, executes every tool_use block, and appends BOTH the assistant message and a user message carrying the tool results. WHY — Everything after this sits inside this loop, and it is the most reliably examined thing in the domain. Branching on stop_reason rather than on content is the difference between an agent that works and one that works on your test cases. YOU SHOULD SEE — History growing by exactly two messages per tool iteration, each tool_result carrying the tool_use_id of the call it answers, and the loop exiting only on stop_reason or the safety cap. TRAP — Appending the tool results but not the assistant message, or the reverse. Either one leaves the model reasoning from the same information twice, and the symptom is an agent that repeats a call rather than one that errors. STUCK? — Print response.stop_reason on every iteration before you write any branching at all. Half the bugs in this stage are visible the moment you can see the value the loop is supposed to be reading.
Stage 1 in full
The four steps
Send the whole conversation. Read stop_reason. If it is tool_use, run
the tools, append the results, and go again. If it is end_turn, you are
done. The Messages API is stateless — everything the model knows on iteration
four is something your loop put in the request.
Beyond the two values the guide names
The exam guide keys tool_use and end_turn — the two a basic loop
branches on, and the two you will be graded on. The live API returns five more,
and a loop that assumes anything other than end_turn means tool_use will
mishandle all of them:
stop_reason
What it means
end_turn
Finished naturally. Stop.
tool_use
Wants one or more tools. Run them and continue.
max_tokens
Hit your max_tokens ceiling. The response is truncated.
stop_sequence
Hit a stop sequence you supplied.
pause_turn
Paused a long-running turn and can be resumed.
refusal
Declined on safety grounds, on an otherwise normal 200 response.
model_context_window_exceeded
Filled the context window before max_tokens. Truncated.
refusal arrives on a successful HTTP response, so a loop that only checks
status codes treats it as ordinary output — and its stop_details identifies
the policy category. The safe default is to treat anything other than
end_turn as "not finished, find out why".
For the exam, know the two. For production, handle the seven.
Parsing natural language. Checking whether Claude said "I'm done".
Ambiguous by construction — it may have finished the first file and be about to
open the second.
An iteration cap as the primary stopping mechanism. It either cuts off work
that needed twelve iterations or burns seven on a task that finished in three. A
cap is a safety net; it is not a design.
Treating assistant text as completion. Claude routinely returns explanatory
text alongside a tool_use block in the same response — "Let me look up your
order" and the lookup arrive together. Text presence says nothing about whether
the agent is finished.
Multiple choice · Medium
An agent sometimes terminates early when Claude returns text alongside a tool call. The loop decides it is finished by checking whether the first content block has type text. Users report incomplete answers on complex queries. What should change?
Reference implementation
Work the stage first. This is what a finished stage 1 looks like, and the base
every later stage modifies.
python
import ast
import operator
import anthropic
client = anthropic.Anthropic()MODEL ="claude-opus-5"MAX_ITERATIONS =20TOOLS =[{"name":"lookup_order","description":"Look up an order by id. Returns status, total and placed_at.","input_schema":{"type":"object","properties":{"order_id":{"type":"string"}},"required":["order_id"],},},{"name":"calculator","description":"Evaluate an arithmetic expression and return the result.","input_schema":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],},},]# A whitelist evaluator, not eval(). A tool is an execution surface the model# chooses to invoke, so its blast radius is a design decision — this one can add,# subtract, multiply and divide numbers, and can do nothing else._OPS ={ast.Add: operator.add, ast.Sub: operator.sub, ast.Mult: operator.mul, ast.Div: operator.truediv}defcalculate(expression):defwalk(node):ifisinstance(node, ast.Constant)andisinstance(node.value,(int,float)):return node.value
ifisinstance(node, ast.BinOp)andtype(node.op)in _OPS:return _OPS[type(node.op)](walk(node.left), walk(node.right))ifisinstance(node, ast.UnaryOp)andisinstance(node.op, ast.USub):return-walk(node.operand)raise ValueError("unsupported expression")return walk(ast.parse(expression, mode="eval").body)defrun_tool(name, tool_input):if name =="lookup_order":return"status=delivered total=129.99 placed_at=2026-08-02"if name =="calculator":try:returnstr(calculate(tool_input["expression"]))except ValueError as error:returnf"Error: {error}"return"Unknown tool"defrun_agent(prompt): messages =[{"role":"user","content": prompt}]for _ inrange(MAX_ITERATIONS): response = client.messages.create( model=MODEL, max_tokens=16000, tools=TOOLS, messages=messages
)# Anything other than end_turn is "not finished, find out why".if response.stop_reason =="end_turn":returnnext(b.text for b in response.content if b.type=="text")if response.stop_reason =="refusal":returnf"Declined: {response.stop_details.category}"if response.stop_reason !="tool_use":returnf"Stopped early: {response.stop_reason}"# The assistant turn goes back verbatim — the tool_use blocks in it are# what each tool_result below refers to. messages.append({"role":"assistant","content": response.content})# Every result in ONE user message. Splitting them teaches the model to# stop calling tools in parallel. results =[{"type":"tool_result","tool_use_id": block.id,"content": run_tool(block.name, block.input),}for block in response.content
if block.type=="tool_use"] messages.append({"role":"user","content": results})print("WARNING: safety cap reached — the loop should have ended on stop_reason")return"Terminated by safety cap"if __name__ =="__main__":print(run_agent("Look up order A-4417 and tell me what a 20% refund would be."))
Three details worth reading twice. The refusal branch reads stop_details,
which is populated for that value alone. The loop is a for over the cap
rather than a while True with a counter, so the cap is structurally a bound
— exactly what the anti-pattern says it should be. And the calculator walks a
whitelisted syntax tree rather than calling eval: a tool is an execution
surface the model decides to invoke, and a lab that ships eval teaches the
opposite of what Domain 2 is about.
Prove stage 1 before moving on
Break the append on purpose: stop adding the tool_result message and re-run.
The agent should call the same tool again — the repeated-call symptom seen
from the inside.
Log stop_reason every iteration. A two-tool prompt should print tool_use,
tool_use, end_turn.
Confirm the safety cap never trips on a normal query. If it does, the loop is
not terminating on stop_reason and stage 1 is not finished.
When you get stuck
Every stage above ends with a STUCK? line — the first thing worth checking,
which is usually the thing actually wrong.
Past that, in the app: the Help button in this page's toolbar sends the
tutor the section you are currently reading, together with the project's title,
so you can ask "why does this not work" without pasting anything in. It knows
which stage you are on.
Print stop_reason before you branch on it. Most of stage 1's failures stop being mysterious the moment the value is on screen.
Print the message list, not just the reply. Almost every bug in stages 1 to 3 is a message that was not appended, appended twice, or appended in the wrong role. The history is the state; look at the state.
Change one thing. These stages compose, so a stage that breaks after you edited two of them gives you no information about either.
Where the depth lives
This page is for building. The reading is elsewhere, and repeating it here would
put the same claims in three places to drift apart:
The Domain 1 roadmap — what the domain is about, the order to learn it
in, and where it catches people
7 flashcard decks, 48 cards — one card per published objective
66 Domain 1 questions — judgement under exam conditions, inside the six
production scenarios
Sources
CCAR-F Exam Guide v1.0, section 6 — Domain 1's seven task statements, which are this project's seven stages.
CCAR-F Exam Guide v1.0, section 8 — Preparation Exercise 1 (Build a Multi-Tool Agent with Escalation Logic) and Exercise 4 (Design and Debug a Multi-Agent Research Pipeline). This project merges them: exercise 1 is the loop-and-enforcement half, exercise 4 the coordinator half.
Anthropic Messages API reference — the stop_reason set, stop_details, the tool_result message shape, and the parallel-tool-use rule.
The tool-use round trip, from the API documentation
The exam guide describes the agentic loop in prose. This is the same loop as the API documents it: the exact message shapes, the exact field names, and the full set of values that decide whether your loop runs again.
One turn, in full
A client tool round trip is three messages. Your request defines the tool; Claude answers with a tool_use block; you run the tool and send a tool_result back.
You sendmessages plus a tools array. Each tool carries a name, a description, and an input_schema.
Claude replies with stop_reason: "tool_use" and one or more tool_use blocks. Each block has an id, a name, and an input object.
You append two messages — the assistant turn verbatim, then a user turn whose content is a tool_result block carrying tool_use_id and content. The tool_use_id must match the id from step 2.
You send again. Claude uses the result to answer.
Where the code runs
The documentation splits tools by where they execute, and it is worth holding because it decides whether you write a handler at all.
Kind
Runs
You handle results?
Client tools
In your application
Yes — you send tool_result
Anthropic-schema client tools
In your application
Yes — schema is published, execution is yours
Server tools
On Anthropic's infrastructure
No — results come back in the same response
bash and text_editor are client tools with Anthropic-published schemas. web_search, web_fetch and code_execution are server tools.
Every stop_reason value
This is the set the loop branches on. The exam guide keys two of them; the API returns seven.
Value
Meaning
What you do
end_turn
Claude finished naturally
Use the response
tool_use
Claude is calling a tool
Run it, append the result, send again
max_tokens
Hit the max_tokens you set
Treat as truncated; raise the limit or continue
stop_sequence
Emitted one of your stop_sequences
Read the stop_sequence field for which
pause_turn
Server-tool loop hit its iteration limit
Send the assistant content back to continue
refusal
Declined on safety grounds
Read stop_details; retry on a fallback model
model_context_window_exceeded
Filled the context window before max_tokens
Treat the response as truncated
Two details the documentation is specific about: refusal returns HTTP 200, not an error, and the pause_turn iteration limit for server-side tool loops defaults to 10.
tool_choice
tool_choice constrains a single request. The default is {"type": "auto"}, which lets Claude decide whether to call a tool at all.
Setting
Guarantee
auto
None — Claude may return text instead
any
A tool will be called, but not which one
tool with a name
That specific tool is called
none
No tool is called
disable_parallel_tool_use: true limits a turn to at most one tool call.
Strict tool use
Adding strict: true to a custom tool definition makes Claude's calls match your schema exactly. That eliminates a class of shape error and does nothing about semantics — a schema-valid call can still put the right value in the wrong field.
Claude Certified Architect - Foundations (CCAR-F) Practice Questions
Try 15 sample questions from a bank of 460. Answers and detailed explanations included.
Q1medium
The same subagent type is invoked twice in one run. What does the second invocation remember from the first?
A.
Its own prior output, but not the coordinator's reasoning
B.
Whatever the coordinator explicitly re-sent, and nothing else
C.
The full history of both invocations, since it is one agent type
D.
A compressed summary retained between invocations of a type
Show answer & explanation
Correct Answer: B
Subagents share no memory between invocations, so a second call is an agent that has never met the first. This surprises people more than the absence of parent context, and it is why anything needed has to be written into each prompt.
Q2medium
Two refactoring approaches should be compared from the same codebase analysis. What does forking give you?
A.
One session that evaluates both approaches in sequence
B.
Two branches that periodically synchronise their findings
C.
Two independent branches, each holding the shared baseline
D.
A single branch that can be rewound between the approaches
Show answer & explanation
Correct Answer: C
The expensive common analysis is done once and inherited by both, and the branches then diverge without any channel between them. Comparing what they produce happens outside, afterwards.
Q3medium
"It breaks on null values" names a symptom. What does a test case with input and expected output add?
A.
A reproduction the developer can run independently
B.
Evidence that the failure occurs more than once
C.
A record of the bug for the issue tracker
D.
The behaviour you want, which the complaint leaves open
Show answer & explanation
Correct Answer: D
Skipping the row, substituting a default and failing loudly are all defensible readings of the same complaint. Showing the row you expect out settles which one, in a form that can become a test.
Q4hard
Your codebase-exploration agent finished a long investigation yesterday. Why does the guidance say starting a NEW session with a structured summary can be MORE reliable than resuming that one?
A.
Because resuming imports stale tool results that no longer reflect current state, while a fresh session with an injected structured summary carries only valid conclusions
B.
Because new sessions are always cheaper
C.
Because resumed sessions cannot use tools
D.
Because structured summaries bypass the context window
Show answer & explanation
Correct Answer: A
The trade-off: resumption preserves context including tool results that may be stale; a fresh session with a structured summary keeps the valid conclusions and drops the outdated raw state. Cost, tool access, and context-window mechanics are not the stated rationale.
Q5hard
Match each situation to its tool_choice setting. Which pairing is correct per the guidance?
A.
Unknown document type - force one fixed schema regardless of type
B.
Output must be structured - use auto; the model may pick the best schema
C.
Document type unknown, multiple extraction schemas exist, output must be structured - use any; enrichment must not run before a specific extraction - force that named tool
D.
Ordering must be guaranteed - use any and trust the model ordering
Show answer & explanation
Correct Answer: C
The two applied rules: any guarantees A tool call while letting the model choose among schemas (unknown type, multiple schemas); forced named-tool selection guarantees a SPECIFIC extraction runs first (ordering before enrichment). B and C misassign auto/any; D discards the schema-per-type design.
Q6easy
In a coordinator-subagent system, a search subagent finishes and its findings are needed by an analysis subagent. How do they travel?
A.
The search subagent passes them directly to the analysis subagent
B.
They return to the coordinator, which decides what analysis receives
C.
Both subagents read from a shared workspace the coordinator maintains
D.
The analysis subagent requests them from search when it needs them
Show answer & explanation
Correct Answer: B
The pattern routes every message through one hub, and that constraint is what buys observability in a single place, one consistent error policy, and control over what each agent is allowed to see. Direct paths between spokes remove all three.
Q7medium
A pipeline step parses a tool result and has no use for prose. Which setting fits?
A.
auto, letting the model decide whether a tool is needed
B.
A forced named tool, guaranteeing which one runs
C.
any, guaranteeing a tool call rather than conversational text
D.
auto, with an instruction forbidding prose in the prompt
Show answer & explanation
Correct Answer: C
The requirement is that something structured comes back, not that a particular tool runs. Forcing a name over-constrains when several tools would serve, and an instruction against prose is a request rather than a guarantee.
Q8hard
A library migration's approach has just been decided in plan mode. What happens next?
A.
Planning continues, since the migration spans many files
B.
The plan is re-validated in a second planning session
C.
Direct execution, since the work is now well-scoped
D.
The work is split into per-file planning sessions
Show answer & explanation
Correct Answer: C
The planning is what made the remaining work well-scoped, so continuing in plan mode adds ceremony and no information. The modes divide by phase rather than by how big the task is.
Q9medium
Why must a subagent distinguish an access failure from a valid empty result?
A.
Because only it knows which occurred, and they differ
B.
Because empty results are cheaper to transmit than failures
C.
Because the coordinator retries every failure automatically
D.
Because access failures must be logged for audit purposes
Show answer & explanation
Correct Answer: A
Both arrive looking like no data, and the component that ran the query is the only one positioned to say which it was. One needs a retry decision and the other is a true answer.
Q10hard
A reviewer insists one 200-file mega-review prompt is more efficient than the chained pattern. Beyond attention dilution, what concrete failure mode of the single-pass approach does the guidance's pattern prevent?
A.
Higher API latency per token
B.
Contradictory findings - the single pass asserts incompatible things about how files interact because no pass owns the cross-file view
C.
Loss of git blame information
D.
Inability to use tools during review
Show answer & explanation
Correct Answer: B
The chained pattern pairs per-file local passes with a dedicated integration pass precisely so cross-file analysis is owned somewhere; a single diluted pass produces contradictory findings about file interactions because nothing systematically checks them together. Latency, tool access, and git metadata are not the failure mode cited.
Q11hard
Task: add comprehensive tests to a legacy codebase of unknown structure. What decomposition sequence does the guidance prescribe?
A.
First map the codebase structure, identify high-impact areas, then create a prioritized plan that adapts as dependencies are discovered
B.
Ask the model to write one test for every public function in a single pass
C.
Start with the largest file and work downward by size
D.
Write tests file-by-file in alphabetical order until time runs out
Show answer & explanation
Correct Answer: A
The guidance's open-ended decomposition: map structure first, identify high-impact areas, then build a prioritized plan that adapts as dependencies surface. Alphabetical, exhaustive-single-pass, and size-ordered approaches ignore impact and discovered structure.
Q12hard
Why is the SAME Claude session that generated code less effective at reviewing it than an independent instance?
A.
Review requires a different programming language
B.
The same session cannot read its own output files
C.
The generating session's license expires after writing code
D.
Session context isolation: the generating session retains its reasoning context and is less likely to question its own decisions, unlike an independent review instance
Show answer & explanation
Correct Answer: D
The guidance's session-context-isolation point: the authoring session carries the reasoning that produced the code and rarely challenges it; a fresh instance reviews without that sunk reasoning. Licensing, language, and file access are invented limitations.
Q13easy
An extended exploration session has filled up with verbose discovery output, and you want to carry on working in that same session. Which mechanism does the guidance name?
A.
/compact, which reduces the context the session is carrying
B.
context: fork, declared in the session's frontmatter
C.
--resume, which reloads the session with less of its history
D.
/clear, which empties the context so the session can continue
Show answer & explanation
Correct Answer: A
/compact is what the guidance names for reducing context usage during an extended exploration session that has filled with verbose discovery output. Clearing the context would discard the findings the session exists to accumulate, resuming is for continuing a session later rather than shrinking one in progress, and context: fork isolates a skill's execution rather than compacting a session.
Q14easy
Why is a hook a guarantee where a system prompt instruction is not?
A.
Hooks run before the model produces any output at all
B.
Hooks are written in code, which contains no ambiguity
C.
Hooks are evaluated by the API rather than the application
D.
Hooks sit between the agent and the tool, outside the model
Show answer & explanation
Correct Answer: D
Being outside the model is the whole of it — there is no wording the model could produce that persuades a hook not to run, because the model is not the thing running it. Where the code lives matters more than what it is written in.
Q15hard
Subagents emit structured claim-source mappings correctly, and the final report still cannot attribute claims. What went wrong?
A.
The mappings were emitted in the wrong field order
B.
The synthesis agent did not preserve them through the merge
C.
The subagents omitted relevant excerpts from the mappings
D.
The coordinator reordered the findings before synthesis
Show answer & explanation
Correct Answer: B
The objective places an obligation at both ends — emit the mapping, and preserve and merge it downstream. Getting only the first half is a common failure because the agent doing the combining had no instruction to keep it.
Claude Certified Architect - Foundations (CCAR-F) Flashcards
240 flashcards for spaced-repetition study. Showing 30 sample cards below.
Agentic loops(6 cards shown)
Question
What drives each turn of the agentic loop?
Answer
stop_reason. A value of tool_use means Claude wants tools run: execute them, append the results, send again. end_turn means it has finished. The loop is a while keyed on that field — never on anything in the assistant's text.
Question
Where do tool results go between iterations?
Answer
Into the conversation history, as a tool_result message alongside the assistant message that requested it. The API is stateless between calls, so the history you send is the only thing carrying the result forward.
Question
Model-driven control flow versus a pre-configured decision tree — what actually differs?
Answer
A decision tree routes on surface keywords and cannot adapt once it has branched. In an agentic loop Claude picks the next tool from the full context, including what earlier tools returned, which is what lets it handle an ambiguous request.
Question
Sketch the agentic loop's control flow.
Answer
While stop_reason is tool_use: run the requested tools, append their results to the history, and call again. Break when it is end_turn. No turn counters, no keyword matching.
Question
Your agent repeats a mistake the validator already caught. What did the loop fail to do?
Answer
Add the tool results to the context between iterations. Without them the next request is identical to the last one, so the model has nothing new to reason from and makes the same call again.
Question
Name the three loop-termination anti-patterns.
Answer
Parsing natural-language text for phrases like 'I have completed your request'; using an arbitrary iteration cap as the PRIMARY stopping mechanism; and treating any non-empty assistant text as completion. A cap is a runaway backstop, not the design.
Batch processing strategy(8 cards shown)
Question
State the Message Batches API's three headline terms.
Answer
50% cost savings, a processing window of up to 24 hours, and no guaranteed latency SLA. The saving is paid for in time, and the absent SLA is the part that decides suitability.
Question
Which workloads belong in a batch, and which must never be?
Answer
Non-blocking, latency-tolerant work: overnight reports, weekly audits, nightly test generation. Never a blocking workflow such as a pre-merge check — nobody can wait up to 24 hours to merge.
Question
Can a batch request run an agentic tool loop?
Answer
No. The batch API does not support multi-turn tool calling within a single request — it cannot execute a tool mid-request and feed the result back. Work needing a loop belongs on the synchronous API.
Question
How do you know which batch response answers which request?
Answer
The custom_id you set on each request comes back on its response. Without it, correlating a returned result to its input is guesswork.
Question
Match the API to the workflow: a pre-merge check, and a weekly analysis.
Answer
Synchronous for the pre-merge check — it blocks a person. Batch for the weekly analysis — nothing waits on it, so the 50% saving costs nothing that matters.
Question
You owe a 30-hour SLA and batches take up to 24. How often do you submit?
Answer
Every 4 hours. Worst case a document waits the full 4-hour window before submission and then the full 24-hour processing, which is 28 — inside 30. Submission frequency is what makes an SLA survive an unguaranteed processing window.
Question
Part of a batch failed. What do you resubmit?
Answer
Only the failed items, identified by custom_id, with whatever modification the failure calls for — chunking the documents that exceeded context limits, for instance. Resubmitting the whole batch pays twice for everything that already worked.
Question
What do you do before sending 10,000 documents through a batch?
Answer
Refine the prompt on a sample. First-pass success is what a batch's economics rest on — a flaw found on document one is found on all 10,000, and every resubmission cycle spends the saving again.
Grep — file CONTENTS, for patterns like function names, error messages or import statements. The question it answers is "where does this text appear", not "which files exist".
Question
Which tool matches file paths?
Answer
Glob — file NAMES and extensions. It answers "which files exist by this pattern" and never looks at what is inside them.
Question
Read/Write versus Edit — what is each for?
Answer
Read and Write handle the whole file. Edit makes a targeted modification by matching unique text, so it changes one place without rewriting everything around it.
Question
Edit fails because the anchor text appears more than once. What is the fallback?
Answer
Read the file, then Write it back with the change. Retrying Edit with the same non-unique anchor fails identically — the fallback is the reliable path, not a workaround for a broken tool.
Question
You need every caller of a function across the codebase. Which tool?
Answer
Grep. Callers are content, and the same goes for tracking down where an error message is produced — both are searches through what files say rather than what they are named.
Question
You need every test file under a directory tree. Which tool?
Answer
Glob, with a pattern like **/*.test.tsx. It is a naming question, so it never opens a file.
Question
There is no unique anchor for the change you need. Walk through the alternative.
Answer
Read the full contents, apply the change to what you have, and Write the result. You are supplying the whole file rather than asking the tool to locate a spot that cannot be located.
Question
How do you build understanding of an unfamiliar codebase?
Answer
Incrementally: Grep for entry points, then Read to follow the imports and trace the flows that matter. Reading everything up front fills the context with files the task never touches and dilutes attention on the ones it does.
Question
A function is re-exported through wrapper modules. How do you find its real usage?
Answer
Identify all the exported names first, then search for each name across the codebase. Searching only the original name finds the wrappers and misses every call that goes through them.
Claude Code in CI/CD(7 cards shown)
Question
Which flag runs Claude Code non-interactively?
Answer
-p, also spelled --print. It is what makes the CLI usable inside an automated pipeline, where there is nobody to answer a prompt.
Question
Which two flags enforce structured output in CI?
Answer
--output-format json and --json-schema. The first makes the output machine-readable; the second makes it conform to a shape the pipeline can rely on.
Question
How does a CI-invoked run learn your project's conventions?
Answer
From CLAUDE.md — testing standards, fixture conventions, review criteria. CI has no conversation history to draw on, so anything not written down is unavailable to it.
Question
Why not have the session that wrote the code review it?
Answer
It is less effective at reviewing its own changes. It carries the reasoning that produced them, so the assumptions behind a mistake are shared rather than examined. An independent instance sees the diff without the story.
Question
Your CI job hangs waiting for input. What was missing?
Answer
The -p flag. Without it the run expects interaction, and a pipeline with nobody at the keyboard waits until it times out.
Question
You want findings posted as inline PR comments. What produces them?
Answer
--output-format json with --json-schema, giving machine-parseable structured findings the pipeline can place on specific lines. Prose has to be scraped, and scraping is where line numbers get lost.
Question
Your re-run after new commits repeats every comment from the last review. What is missing?
Answer
The prior findings in context, plus an instruction to report only new or still-unaddressed issues. Each run is independent, so without the earlier review it rediscovers everything and posts it again.