Questions? Call 1.800.716.8955

Chapter 11

Design drills

The exam draws on six fixed scenarios, but the judgment it tests transfers to any Claude system. These twenty drills put the same principles into new settings, so you practise recognising the pattern rather than memorising the six stories. For each, decide your answer before reading the discussion. The domain tags show which chapter to revisit if you get it wrong.

Drill 1: HR policy assistant (Domains 2, 5)

An internal assistant answers employee questions from a 900-page HR handbook exposed through an MCP server with one tool, search_handbook. Employees complain that answers about parental leave cite the wrong country's policy.

Your call: What do you change first?

Discussion. The tool has no way to scope by country, and its description says nothing about jurisdiction. Add a required country parameter with an enum, describe it in the tool description ("policies differ by country; always pass the employee's country from their profile"), and expose the handbook's table of contents as an MCP resource so the agent can see that country sections exist. A bigger model or longer system prompt does not fix a tool that cannot express the distinction.

Drill 2: Insurance claims triage (Domains 1, 5)

A claims agent may approve claims under US2,

000automatically.AuditsshowitapprovedtwoclaimsofUS2,400 after customers argued the excess should be deducted first.

Your call: Prompt fix or code fix?

Discussion. Code. The limit is a hard business rule, and the customer's argument showed the prompt-level rule can be talked around. Put a pre-tool hook on approve_claim that checks the gross amount and redirects to human review above the limit. Add the definition of "amount" (gross, before excess) to the prompt as well, so the hook fires less often.

Drill 3: Sales-operations CRM agent (Domain 2)

A sales-ops agent has 22 tools across CRM, email, calendar, quoting and contract systems. It often drafts emails when asked to log a call, and occasionally creates duplicate opportunities. Your call: What is the structural fix?

Discussion. Too many tools on one agent. Split into a coordinator and role agents (CRM updates, communications, quoting), each with 3 to 6 tools. Replace the generic create_record with create_opportunity that checks for an existing open opportunity for the same account and returns a structured duplicate_found result. Give the coordinator one cheap cross-role read tool (get_account_summary) because nearly every request needs it.

Drill 4: Legal contract review (Domains 4, 5)

A contract-review pipeline flags risky clauses. Lawyers say the summaries are good but they cannot tell which clause each risk came from, and two flagged "conflicts" were actually an old and a new version of the same template.

Your call: What do you require in the output?

Discussion. Claim-source mapping and dates. Each finding should carry clause number, quoted text, document name and version date. Version dates turn the false conflicts into a clear "superseded" relationship. Render the result as a table of clause, risk, severity and quote rather than prose.

Drill 5: IT helpdesk agent (Domain 5)

An IT helpdesk agent escalates 60% of tickets. Most are password resets and VPN set-up that it is fully able to handle. Escalations correlate strongly with users writing in capital letters. Your call: Why is it over-escalating, and what fixes it?

Discussion. It is reacting to tone, a sentiment proxy, not to case complexity. Add explicit escalation criteria (explicit human request, policy gap, no progress after defined steps, actions requiring admin rights) with few-shot examples, including one where an angry user has a simple VPN problem and the agent resolves it.

Drill 6: Data migration with Claude Code (Domain 3)

A team must migrate 140 SQL queries from an old ORM to a new one across 60 files. Two developers start in direct execution and produce inconsistent patterns. Your call: How should this be run?

Design drills

Discussion. Plan mode first: explore the query patterns, define the target pattern for each kind, and agree an order. Capture the mapping as examples in a .claude/rules/orm-migration.md file scoped to the affected paths. Then execute the plan file by file, with tests run after each batch.

Drill 7: Documentation bot in CI (Domains 3, 4)

A CI job asks Claude to update docs when code changes. It rewrites whole pages, posts 40-line diffs, and sometimes edits unrelated docs.

Your call: What constraints help most?

Discussion. Explicit criteria ("update only sections that describe changed functions; do not rephrase unchanged text"), the list of changed symbols as input, a JSON output schema of {file, section, old, new, reason} via --output-format json --json-schema, and restricted tools so the job can only write under docs/. A few-shot example of a minimal good edit sets the expected size.

Drill 8: Security alert triage (Domains 1, 5)

A triage agent reads security alerts, gathers context from three tools and decides: close, investigate or page on-call. A post-incident review finds it closed a real intrusion because one tool timed out and returned no data.

Your call: What was the design flaw?

Discussion. An access failure was treated as an empty result. The context tools must return structured errors that distinguish "no matching events" from "query failed", and the agent's rules must forbid closing an alert when required context could not be retrieved. That case should be routed to investigation with the failure noted.

Drill 9: Product catalogue enrichment (Domain 4)

An overnight job enriches 200,000 product listings with attributes. 3% fail because descriptions exceed limits; the team reruns the entire job each time.

Your call: What changes?

Discussion. Use the Message Batches API (latency tolerant, 50% cheaper), resubmit only failed custom_ids, and chunk or truncate long descriptions in the resubmission. Run the prompt on a 200-item sample first to catch systematic problems before spending on the full batch.

Drill 10: Analytics question answering (Domains 2, 5)

An agent answers business questions by writing SQL against a warehouse with 400 tables. It spends many turns listing tables and describing schemas before every query.

Your call: What reduces the exploration?

Discussion. Expose a curated schema catalogue (key tables, columns, join keys, metric definitions) as an MCP resource. Replace the generic run_sql with a tool whose description names the approved views and whose errors are structured (syntax, permission, timeout). The agent then starts each question already knowing where to look.

Drill 11: Onboarding codebase guide (Domains 3, 5)

A new engineer uses Claude Code for a week-long codebase tour. By day three, answers contradict day one. Your call: What practice keeps the tour coherent?

Discussion. A persistent findings file (notes/architecture.md) written at the end of each session and read at the start of the next, fresh sessions seeded from it rather than one ever-growing session, and the Explore subagent for each deep dive. /compact helps within a session; the findings file helps across them.

Drill 12: Medical-device complaint intake (Domains 4, 5)

A manufacturer extracts complaint details from emails into a regulated system. Some emails mention several devices; some lack a lot number.

Your call: What schema features matter most?

Discussion. An array of devices (one entry per device), a nullable lot_number with no guessing, an unclear enum value for complaint category, a conflict_detected flag for contradictory statements, and field-level confidence. Route anything with nulls in regulated fields, low confidence or conflicts to human review; never automate on aggregate accuracy alone.

Drill 13: Multilingual support (Domain 1)

A support agent hands off to human teams by language. Humans complain they must re-read whole transcripts translated from other languages.

Your call: What does the hand-off need?

Discussion. A structured, English (or team-language) hand-off summary: customer ID, issues, root cause, actions taken, amounts, recommended action and the customer's language. The human should be able to act without the transcript.

Drill 14: Code review false negatives (Domain 4)

After tuning a review bot for precision, it now misses real bugs in large PRs, especially in files reviewed late.

Design drills

Your call: Is this a criteria problem or a structure problem?

Discussion. Structure: position-dependent misses in large inputs are attention dilution. Split into per-file passes plus an integration pass. Keep the precision criteria; they were not the cause.

Drill 15: Personal versus team MCP (Domain 2)

A developer added a Postgres MCP server to .mcp.json with a connection string containing a production password. CI now fails because the server cannot start on build agents. Your call: What is wrong, twice over?

Discussion. A secret was committed, and a personal or environment-specific server was put in shared project config. Move the server to the developer's ~/.claude.json (or keep it in .mcp.json only if the whole team needs it), use ${DATABASE_URL} expansion, and rotate the password.

Drill 16: Research report scope (Domain 1)

A market-research system asked about "electric vehicle adoption barriers" covers price and range in depth but ignores charging infrastructure, grid capacity and used-car markets. Your call: Where do you look first?

Discussion. The coordinator's decomposition in the logs. If the subtasks list only price and range, the cause is upstream. Add a dimension-listing step and a coverage check after synthesis that re-delegates for missing dimensions.

Drill 17: Repeated questions in a long chat (Domain 5)

A travel-booking agent asks customers for their booking reference again after 25 turns, annoying them. Your call: What prevents this?

Discussion. A case facts block containing the booking reference, dates and passenger names, included in every request outside the summarised history. Trim the verbose itinerary results that were pushing early turns into the middle of the context.

Drill 18: Test generation that adds nothing (Domain 3)

Nightly test generation adds 300 tests a week; coverage rises 0.4%. Most new tests assert that getters return what setters set.

Your call: What improves value?

Discussion. Document in CLAUDE.md what valuable tests are (business-rule branches, error paths, boundaries) and what to avoid, list fixtures, and give the job the existing tests and a coverage report so it targets gaps. Run it through the Batches API if results are only needed the next morning.

Drill 19: Choosing tool_choice (Domain 2)

A document router receives PDFs that may be invoices, bank statements or tax forms. Sometimes it replies "This appears to be an invoice" in text instead of calling extract_invoice. Your call: Which setting fixes it?

Discussion. tool_choice: {"type": "any"} with one extraction tool per document type. Claude must call a tool but can choose which. Forcing one specific tool would be wrong because the type is unknown.

Drill 20: Should this be an agent at all? (Domain 1)

A team wants an "agent" that, for every new support ticket, classifies it into one of 12 categories, extracts the order number, and writes a one-line summary.

Your call: Agentic loop or something simpler?

Discussion. Simpler. The steps never change, so use a single structured call (or a short fixed chain) with a forced extraction tool whose schema has the category enum, a nullable order number and the summary. Agents earn their cost when the next step depends on what was found.

Design drills

Use ← → to move between sections