Questions? Call 1.800.716.8955

Chapter 9

Hands-on labs

The exam rewards people who have built these systems, and the guide's own preparation advice is to build four of them. These labs follow the guide's four exercises; budget about 3 to 5 hours each. Tick each step off as you go.

Lab 1: Support agent with escalation logic (Domains 1, 2, 5)

Define 3 or 4 MCP tools, including two deliberately similar ones, and write descriptions that separate them.

Write an agentic loop that continues on tool_use and stops on end_turn.

Return structured errors with errorCategory, isRetryable and a message; check the agent retries transient errors and explains business errors.

Add a pre-tool hook that blocks refunds above a threshold and redirects to escalation. Send a three-issue message and check the agent splits, investigates and answers once.

Lab 2: Claude Code for a team (Domains 3, 2)

Write a project CLAUDE.md with coding and testing standards; confirm a second user gets them.

Add .claude/rules/ files scoped with paths (for example src/api/**/* and **/*.test.*) and confirm they load only for matching files.

Create a project skill with context: fork and allowed-tools; confirm the main conversation stays clean. Add a shared MCP server in .mcp.json using ${ENV_VAR} for its token, plus a personal one in ~/.claude.json; confirm both are available.

Try a one-file bug fix, a multi-file library migration and a feature with competing designs in both plan mode and direct execution, and note where planning paid off.

Lab 3: Extraction pipeline (Domains 4, 5)

Define an extraction tool whose schema has required, optional and nullable fields and an enum with other plus detail.

Feed documents that lack some fields and confirm you get nulls, not inventions. Build a validation-retry loop and log which failures retries fix and which they cannot. Add few-shot examples for varied layouts and measure the change.

Submit 100 documents through the Message Batches API, resubmit failures by custom_id with chunking, and compute the end-to-end time against an SLA.

Output field-level confidence, route low-confidence fields to review, and report accuracy by document type and field.

Lab 4: Multi-agent research pipeline (Domains 1, 2, 5)

Build a coordinator with "Task" in allowedTools and at least two subagents, each briefed explicitly.

Spawn subagents in parallel from one response and time it against sequential calls. Make subagents return claim, excerpt, source and date; confirm synthesis keeps attribution. Simulate a timeout; confirm the coordinator gets structured context, carries on with partial results and annotates gaps.

Feed two credible sources with conflicting figures; confirm the report keeps both and marks them contested.

Lab solution notes

Compare your builds against these notes. They list what a good solution contains and the mistakes people commonly make, not full code. Lab 1: what good looks like.

Two similar tools that Claude can tell apart from descriptions alone. Test with ten ambiguous requests; aim for nine or more routed correctly before you add few-shot examples. A loop whose only exit is end_turn (plus a logged safety cap).

Errors in four categories. Test each: the agent should retry a transient error once, ask for corrected input on a validation error, explain a business error, and escalate a permission error. A pre-tool hook that denies over-limit refunds with a reason that tells Claude to escalate; confirm the escalation then happens.

A multi-issue test message with three issues, each resolved or escalated, and one final reply. Common mistakes: returning tool errors as Python exceptions that end the loop; a hook that silently drops the call without telling Claude why; tool descriptions that describe the backend system rather than when to use the tool.

Lab 2: what good looks like.

/memory in a second user's session shows the project CLAUDE.md and no reliance on anyone's user file. Rules that demonstrably load only for matching paths. Test by editing a matching and a nonmatching file and asking Claude which conventions apply. A forked skill whose verbose output does not appear in the main conversation, and whose allowed-tools blocks an attempted write.

Shared and personal MCP servers both visible in your session; only the shared one in a teammate's.

Short notes on when plan mode paid off. Most people find it valuable for the migration and the multi-approach feature, and unnecessary for the one-file fix.

Common mistakes: globs that match only one directory level (dir/* instead of dir/**/*); committing a token in .mcp.json; editing a team command for personal use. Lab 3: what good looks like.

Nulls, not inventions, for absent fields. Test with at least ten documents missing different fields.

A retry log that separates recoverable failures (formats, misplaced values) from unrecoverable ones (data not in the document). Measurable improvement from few-shot examples on the layouts that failed before. A batch run where only failed custom_ids were resubmitted, and a written SLA calculation. An accuracy table by document type and field, with confidence thresholds set from labelled data.

Common mistakes: making every field required; retrying indefinitely; reporting one aggregate accuracy figure.

Lab 4: what good looks like.

Subagent prompts that contain everything the subagent needs; read them back and ask whether a stranger could do the task from that text alone.

Measurably lower wall-clock time with parallel Task calls.

A final report in which every claim traces to a source and a date.

A simulated timeout that produces a coverage note in the report, not a crash and not silence. A conflicting statistic shown with both values and both sources.

Common mistakes: passing a summary of findings instead of the findings; letting synthesis call web search directly; dropping sources when compressing.

Hands-on labs

Use ← → to move between sections