Claude Certified Architect - Foundations (CCAR-F) Exam Prep
Agentic loops, tools, MCP, Claude Code, prompts, structured output and context. Each post below stands on its own and is free to read, in the order the course teaches it.
Start with step 1: The Agentic Loop and stop_reasonPosts in course order
- Step 1: The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
Build the loop that turns Claude's tool calls into an agent: send the messages, read stop_reason, run tools while it says tool_use, stop on end_turn, and see the naive text check quit early and a turn cap catch a stuck loop.
- Step 2: Coordinator and Subagents: Decompose, Delegate, Check Coverage, and Call Only the Spokes You Need
A research question about chat or email support goes to a coordinator with four subagents. The coordinator splits the question into distinct slices, calls only the spokes it needs, checks the draft for gaps and re-delegates. A plan that is too narrow gives a report that covers a third of the question.
- Step 3: Passing Context to Subagents: Nothing Is Inherited, So Put Findings, Goal and Criteria in the Prompt
A synthesis subagent asked to write the report from the research has nothing to work from: it never saw the coordinator's chat. handoff.py builds the prompt it needs from findings.json: the goal, three quality criteria and three findings, each with its document and page.
- Step 4: Parallel Subagents: Several Task Calls in One Response, Every Result Back in One User Turn
A coordinator asked to compare solar, wind and hydro power emits three Task calls in one response. parallel_plan.py reads all three, answers them in one user turn matched by id, and gets one comparison back. Then the two ways to get it wrong.
- Step 5: Task Decomposition: a Fixed Prompt Chain With an Integration Pass, or a Dynamic Plan That Adapts
A three-file pull request is reviewed in four passes: one per file, then one integration pass over the notes. Each file looks fine alone; only pass 4 finds that cart.py sends one argument where price needs two. Then the dynamic plan for a legacy codebase, and how to choose.
- Step 6: Prompt Guidance vs Programmatic Gates: Block the Refund Until the Customer Is Verified, Then Hand Off a Card That Stands Alone
A prompt that says "always verify first" works most of the time. gate.py blocks process_refund until get_customer has returned a verified id, across three call sequences. Then a request with two concerns is split, and "please help" is replaced by a four-field handoff card.
- Step 7: Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
A refund of $640 must wait for a human, and three tools return dates in different formats. A PreToolUse hook denies the call, a PostToolUse hook cleans the result, and four hook configs that fail silently are fixed one line each.
- Step 8: Claude Code Sessions: Resume by Name, Fork From a Baseline, or Start Fresh With a Summary Card
You investigate a refund bug on Monday and come back on Tuesday after a teammate edited the code. Resume the named session and say which files changed, fork it to compare two fixes, or start fresh from a summary card when the old tool results are stale.
- Step 9: Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
Claude picks a tool by reading its name, description and input schema. Two support tools, written once vaguely and once properly, show how a purpose, an input format, an example and a 'Not for' boundary fix the wrong pick.
- Step 10: Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
One refund tool, three checkpoints: the description gets it picked, the input schema shapes the call, and a structured error with is_error, a category and a retryable flag tells the agent whether to fix, retry, explain or escalate.
- Step 11: Scoped Tools per Agent and tool_choice: Three to Five Tools per Role, a Shared One, and auto, any or a Forced Tool
A synthesis agent holding all fifteen tools reaches for web_search instead of writing the summary. Give each role three to five tools plus one shared check_fact, restrict them in the AgentDefinition, and set tool_choice to auto, any or a forced tool to match the job.
- Step 12: Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
Every MCP server is one of two shapes: a program on your machine, which you add with the command that starts it, or a URL on the internet, which you add and then sign in to. Add a filesystem server and Jira to Claude Code, prove where each one was saved with .mcp.json and a second repo, then break one on purpose and fix it in three moves.
- Step 13: Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
Build one small SupportDesk MCP server that offers a tool, a resource and a prompt, written in Python and in TypeScript, and check both with the same real MCP client.
- Step 14: Claude Code's Built-in Tools: Read, Write, Edit, Bash, Grep and Glob, and When Each One Is the Right Pick
A small shop codebase you have never seen, and one question: where do refunds happen? Search first with Grep and Glob, read only what matches, fall back to Read plus Write when Edit finds two matches, and follow renamed imports through a wrapper module.
- Step 15: The CLAUDE.md Hierarchy: User, Project and Directory Files, How They Stack, and the Team Rule Stuck on One Laptop
Ben clones the shop app and Claude doesn't know how to run the tests, though it does on Asha's laptop. The rule is in her user file, which git never sees. Learn the three CLAUDE.md levels, how they stack, and how to check what is loaded with /memory.
- Step 16: Split a 600-Line CLAUDE.md: @import Lines, .claude/rules Files and Which One to Pick
A CLAUDE.md that grew to 600 lines loads all five topics for a one-test fix. Split it with @import lines so each package pulls in only its own standards, and move topics into .claude/rules/ files that load when the work needs them.
- Step 17: Path-Specific Rules in Claude Code: paths Globs, When a Rule Loads and the Glob That Matches Nothing
A rule file with a paths glob joins Claude's context only when Claude reads, writes or edits a matching file. We read four globs against five files, run a stand-in matcher on four file paths, and fix a glob that matched nothing.
- Step 18: Claude Code Slash Commands and Skills: Project vs User Scope, $ARGUMENTS, context: fork and allowed-tools
Ben and Asha type the same branch review in different words and get different reviews. Save it once as a team command with $ARGUMENTS, then build a codebase-map skill that runs with context: fork and a release-notes skill limited to Read and Write.
- Step 19: Iterative Refinement with Claude Code: Input/Output Examples, Tests First and the Interview Pattern
"Format the phone numbers nicely" gives a different format each run. Three input/output examples fix the target, five tests written first catch two edge cases in the first draft, and the failing pytest output is what you hand back.
- Step 20: A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
Design a pull-request review bot with Claude Code: run it headless with -p, ask for JSON findings with a schema, keep review rules in a committed CLAUDE.md, leave the merge to a person and batch the nightly job.
- Step 21: CI Reviews That Don't Repeat Themselves: Prior Findings, Existing Tests and Test Standards in CLAUDE.md
A review bot that starts fresh on every push posts the same comment again next to the one new issue. Three runs on one pull request show how prior findings in the prompt, existing tests and CLAUDE.md standards cut the noise.
- Step 22: Explicit Criteria vs Vague Prompts: Turn Every Adjective Into a Check a Script Can Run
Swap words like "better" and "professional" for criteria a script can mark pass or fail: 120 words, every number kept, no hedge words, three bullets. Then rewrite a vague meeting-notes prompt until all five rubric checks pass.
- Step 23: Few-Shot Prompting Done Right: How Many Examples, How Different, What Order, and the Leak That Lies
Sort support tickets into billing, bug, feature or other by showing the model four worked examples: an easy case, a hard case, an edge case and a near miss. Then pick the count, the order and the shape, and keep the examples out of your test set.
- Step 24: Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
Seven support tickets, seven endings: a clean tool_use block, JSON in a code fence, a cut-off reply, a refusal, a casing slip, an out-of-range priority and an unreadable reply. Three gates handle all of them.
- Step 25: Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
One supplier invoice, two boundaries: the invoice text goes inside an escaped invoice tag so its 'ignore your rules' line stays data, and a schema with null, other and unclear stops Claude from inventing a due date, a category and payment terms.
- Step 26: Validation-Retry Loops for Claude Extraction: Send Back the Exact Errors, and Stop When a Retry Cannot Help
Three supplier invoices, three endings: a dropped line item fixed on the second try, a format slip fixed while a missing PO number stops the loop, and a typo in the document itself that goes to a person. Plain Python checks decide which errors are worth a retry.
- Step 27: Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
Ten thousand invoices a night and a live chat reply use the same model and the same kind of prompt, but they belong on different APIs. Build a Claude message batch with a custom_id per request, read results in any order, resend only the failures and check the deadline sum.
- Step 28: Multi-Pass and Multi-Instance Code Review with Claude: A Fresh Reviewer, Per-File Passes and an Integration Pass
The same session reviews its own refund code and finds nothing. A fresh instance per file finds three local notes, an integration pass finds the real bug (cents sent to a function that wants dollars), and each finding's confidence decides whether it is posted or queued for a person.
- Step 29: Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It
A support agent forgets the customer's name, order and contact choice after twenty turns and fails 0 of 4 checks. Measure the window, clear old tool output, compact old turns and keep a notes file, and the same chat passes 4 of 4 with 470 tokens instead of 2,945.
- Step 30: When a Claude Support Agent Should Escalate: Three Clear Triggers, Not Mood or a Confidence Score
A support agent hands off when the customer asks for a human, when the policy is silent, or when it is stuck. An angry customer with a simple question gets a sorry and a fix, and two customers called Maya Khan mean one more question, never a guess.
- Step 31: Error Propagation Across Subagents: Retry Locally, Then Report the Failure, the Attempts and What You Found
A research system asks whether customers prefer chat or email support, and the email search times out on page 3. The subagent retries once, then sends the coordinator the failure type, four logged attempts and two kept results, and the final report marks email as THIN instead of going quiet.
- Step 32: Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
Three log files hold the cause of a failed checkout. Read inline, the main context holds 6,828 characters; delegated to subagents with a one-line brief, it holds 283, with the same answer.
- Step 33: Human Review and Confidence Calibration: Check Accuracy by Type and Field Before You Stop Looking
An invoice extractor is 93% accurate, so the team wants to stop human review. Split by type and field, handwritten invoices are at 70% and handwritten due dates at 1 of 4. Two small Python files find the weak spot, pick a confidence cut-off from labelled data and keep a stratified sample under review.
- Step 34: Provenance in Multi-Source Research: Keep Every Claim With Its Source and Date, and Show Conflicts Instead of Settling Them
Survey A says 58% chose chat in March, Survey B says 41% in October, and two sources give 6 and 9 hours for email replies in the same month. A small synthesis step keeps every value with its source and month, sorts established from contested, and leaves the conflict for the coordinator.
- Step 35: Lab: A Research Pipeline With Parallel Subagents, a Timeout That Keeps Its Partial Results, and a Report With Its Trail
One coordinator turn, three Task calls, one round. The trips and shops subagents bring back sourced findings, the safety subagent times out on crash reports and keeps one partial finding, and the report shows 18% and 11% side by side instead of an average of 14.5%.
- Step 36: Lab: An Extraction Pipeline With a Nullable Schema, Validation-Retry, a 100-Request Batch and Human Review
A hands-on lab that joins four stations into one pipeline for supplier documents: a record_document tool schema, a validate-and-retry loop, a 100-request batch matched by custom_id, and confidence routing with accuracy by type and field. Every output comes from running the project with a stand-in model.
- Step 37: Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
Part 2 of the refund app build-along: four files, each from a requirement. An MCP server keeps the orders, two tools refund or hand off, a hook holds the $500 limit, and one loop routes every tool_use.
