Training

172 questions · 8 domains
ChronoChrono
Play

The Stolen Cards

A turn-based RPG to practise agentic engineering, built on Anthropic’s courses: agents, tools, prompts, context. Every right answer takes a card back from the Clawds.

0 / 172 cards freed

  • Production Integration, Reliability, and Knowledge Grounding 0 / 20 freed
  • Advanced Agent Architecture and Orchestration 0 / 32 freed
  • Observability and Production Monitoring 0 / 16 freed
  • Evaluation Engineering and Quality Assurance 0 / 16 freed
  • Runtime Guardrails and Production Security 0 / 20 freed
  • Advanced Debugging and Incident Response 0 / 16 freed
  • Agent Fleet Operations for Software Delivery 0 / 24 freed
  • Cost and Latency Optimization at Scale 0 / 28 freed

Agentic engineering practice, played as a game, built on Anthropic’s courses.

Claude Certified Developer - Professional

172 questions in this bank · 8 domains. No exam guide is published: the questions are written from the course outline.

Domain Questions in the game
Production Integration, Reliability, and Knowledge Grounding 20
Advanced Agent Architecture and Orchestration 32
Observability and Production Monitoring 16
Evaluation Engineering and Quality Assurance 16
Runtime Guardrails and Production Security 20
Advanced Debugging and Incident Response 16
Agent Fleet Operations for Software Delivery 24
Cost and Latency Optimization at Scale 28
Total 172

The cards

172 cards, 0 freed so far.

Production Integration, Reliability, and Knowledge Grounding 0 / 20 freed

IR-001 At 9 a.m., an analyst starts an interactive review in which an agent works through 4,000 contracts with tool calls, showing each result as it lands, on a model the organization had not used for weeks. Each request carries a different contract and a short shared instruction. Within seconds come 429s with error_code ramp_limit_exceeded, while usage sits well under ITPM and OTPM. What should change first?
  1. Start the review at a low request rate and raise it by one step every minute Right answer
  2. Request a higher usage tier to lift the organization's ITPM and OTPM
  3. Cache the shared instructions so fewer input tokens count toward the limits
  4. Raise the SDK's max_retries so exponential backoff absorbs the 429s

Why A ramp limit caps how fast usage on a model can grow after a quiet period, even under the rate limits; rising one step a minute stays inside it. A higher tier does not lift it, little is cacheable, and retries repeat the burst.

IR-002 On the 27th of the month, every request from an organization on the Build tier returns a 429 rate_limit_error with no retry-after header. Traffic is steady and far below RPM. The SDK's automatic retries fail one after another. The error body carries enforced_spend_limit_reached. What is the right response?
  1. Lengthen the client's exponential backoff until requests succeed again
  2. Stop the retries and request a higher tier to restore access Right answer
  3. Smooth traffic across each minute to stay under the model's ramp limit
  4. Cache the shared prefix to cut the tokens counted toward ITPM

Why That code marks the tier's monthly spend cap: usage stays paused until next month and every retry fails. Moving to a higher tier restores access. Smoothing and caching address rate limits that are not the cause here.

IR-003 An internal tool allowed 60 RPM sends about 40 requests a minute, but one button fires 12 calls within the same second. Those bursts get 429s with retry-after and no ramp or spend error_code, although the per-minute total stays under the limit and traffic has been steady for weeks. Which fix targets the cause?
  1. Request a higher RPM limit that is large enough to cover the 12-call peak
  2. Move these calls to the Message Batches API, which has separate limits
  3. Pace the button's calls client side through a queue at a steady rate Right answer
  4. Cache the system prompt so these calls count fewer input tokens

Why Limits can be enforced over short intervals (60 RPM as one request per second) with a token bucket, so a burst exceeds them. Batches do not suit an interactive button, and caching does not reduce a request count.

IR-004 A support agent sends the same system prompt and tool definitions, 30,000 tokens, on every turn, followed by a short user message. Traffic has grown steadily for months and the team now hits ITPM 429s, with no prompt caching in place. Which lever raises useful throughput the most?
  1. Lower max_tokens so each request reserves less of the output quota
  2. Request a higher usage tier and keep sending the requests unchanged meanwhile
  3. Spread requests more evenly across each minute to avoid any spikes
  4. Cache the repeated prefix so that its reads stop counting against ITPM Right answer

Why Tokens read from cache do not count toward ITPM, so with a shared prefix this heavy, effective throughput rises without a new limit. max_tokens does not factor into OTPM, and smoothing does not reduce the counted volume.

IR-005 An application streams audit reports several thousand words long, each from a single request. A network drop sometimes cuts the stream two thirds of the way through, inside a text block. Regenerating from scratch doubles the cost and makes the reader wait again, and the prompt and single-request design must stay as they are. Which recovery strategy should the team implement?
  1. Save the text received and send a new request that has the model continue from it Right answer
  2. Resend the original request unchanged with the SDK's exponential backoff
  3. Switch this call to non-streaming mode with a much longer client timeout
  4. Ask for the report section by section so a drop loses one section at most

Why The streaming docs recover an interrupted stream by capturing the partial response and building a continuation request from it, so only the missing part is generated. Resending or going non-streaming regenerates everything, and splitting the report changes a design that must stay.

IR-006 An agent streams a response holding one complete explanatory paragraph, then a tool_use block whose JSON input had only half arrived when the connection drops. The recovery code already saves everything received. What should it do with the partial content before resuming?
  1. Complete the partial JSON with a lenient parser, then execute the tool call as is
  2. Keep the paragraph, drop the partial tool_use block, resume after the text Right answer
  3. Send back the paragraph and the partial JSON so the model finishes the tool input
  4. Discard everything and resend the original request for a consistent response

Why Tool use and thinking blocks cannot be partially recovered; resumption starts from the most recent text block. Executing a guessed input is risky, and resending everything throws away text that was already valid.

IR-007 During a load spike, some streamed responses stop abruptly and are logged as successful. The in-house wrapper decides retries from the HTTP status code, which is 200 in these cases. The raw logs show an overloaded_error event in the middle of the stream. What should be fixed?
  1. Add HTTP status 529 to the list of status codes the wrapper retries on
  2. Enable TCP keep-alive so idle connections are not dropped midway
  3. Treat error events inside the stream as failures and trigger recovery Right answer
  4. Lengthen the client timeout to give the server more time to answer

Why When streaming, an error can arrive after a 200 response as an event in the stream, outside the HTTP mechanism. Retrying on 529 never sees that case, and keep-alive or timeouts do not address overload.

IR-008 A direct SSE integration, built without an SDK, has worked for a year. One morning every stream fails at the same point: the parser throws on an event type it does not know, and the recovery code keeps resending requests that fail the same way. Which fix is right?
  1. Pin an older API version so this new event type stops being delivered
  2. Cap the number of recovery attempts so the loop of calls comes to an end
  3. Switch this call to non-streaming so it no longer depends on SSE events
  4. Make the parser skip unknown event types and keep handling known ones Right answer

Why The versioning policy allows new event types to be added, and code should handle unknown ones gracefully. Capping attempts treats the symptom, and dropping streaming exposes long responses to timeouts.

IR-009 A scheduling assistant shows "Thinking..." for six seconds while Claude picks a tool, writes its input and then answers. The team switches the request to streaming and wants to show "Finding a slot..." as early as possible, once the chosen tool is known. Which event should drive that status?
  1. The content_block_start of the tool_use block, which already carries the name Right answer
  2. The first input_json_delta, once its partial JSON has been parsed cleanly
  3. The content_block_stop of the tool_use block, once the full input is parsed
  4. The final message_delta, once its stop_reason reports a tool call

Why The tool's name arrives in the event that opens the block, before any input. Waiting for deltas, the block's close or the stop_reason delays the status for information already available.

IR-010 A streaming integration wants to validate a payment tool's input as it arrives. The code calls json.loads on every input_json_delta and crashes on fragments such as {"amount. The tool must only run with a complete, checked input. Which approach should it take?
  1. Ask in the prompt for compact JSON so each delta stays valid on its own
  2. Accumulate partial_json and parse the input at content_block_stop Right answer
  3. Turn streaming off for this tool call and keep it on for plain text
  4. Wrap json.loads in a try block and skip fragments that fail to parse

Why Tool use deltas are partial JSON strings; the input is a complete object only once the block closes. Skipping fragments loses data, and no prompt makes each fragment valid on its own.

IR-011 A stable, tested Python agent loop expects the Message object returned by client.messages.create to run tools and append their results. The team moves to client.messages.stream to show a status while waiting, without wanting to touch the rest of the loop. How should it get the final response?
  1. Rebuild a Message by hand from the text and tool_use deltas received
  2. Make a non-streaming create call after the stream ends to feed the loop
  3. Call stream.get_final_message() when the stream ends and keep the loop Right answer
  4. Rewrite the loop so it consumes the SSE stream events directly

Why The SDK helper accumulates the events and returns the same kind of object as create, so the loop stays intact. Rebuilding by hand duplicates that helper, and a second call pays for generation twice.

IR-012 A UI streams a tool whose input contains a long description field. Monitoring shows silences of several seconds between two input_json_delta events, then several deltas at once. A developer proposes treating any silence over two seconds as a dropped connection. Which diagnosis holds?
  1. Network packet loss, to be handled with more frequent TCP keep-alive probes
  2. API overload, to be handled with a retry as soon as the silence drags on
  3. Client parser latency, to be fixed by parsing every delta as it arrives
  4. Normal buffering of each key and value, so the shown status should stay Right answer

Why By default the API buffers each input key and value until it is complete, then emits it as several deltas, so pauses are expected. Treating them as drops would restart healthy generations.

IR-013 An insurer's RAG splits 3,000 policies of 40 pages each into chunks. A chunk such as "the deductible doubles on a repeat claim" names neither the product nor the coverage it belongs to, and search returns the one from another contract. Chunk size is reasonable. Which improvement targets the cause?
  1. Prepend to each chunk its own context, generated by Claude from the full document Right answer
  2. Prepend to each chunk a general summary of the document generated just once
  3. Enlarge the chunks so that each one carries more of the surrounding text
  4. Replace the embedding model with one that ranks higher for this domain

Why Contextual retrieval prepends to each chunk, before embedding and indexing, a short context situating it in its document. Anthropic reports limited gains from generic summaries, and a new embedding model cannot restore information missing from the chunk.

IR-014 A hardware support RAG answers everyday-language questions well. It fails when a technician pastes an exact error code like E-4471 or a part number: embedding search returns pages that are semantically close but about another code. Which change fixes this case?
  1. Pass the top 150 results through a reranker before keeping the best
  2. Add a BM25 index and merge its hits with the embedding results Right answer
  3. Shrink the chunks so that each error code gets a vector of its own
  4. Raise the number of chunks passed to the model to cover more codes

Why BM25 ranks on exact lexical matches, catching identifiers that embeddings miss. A reranker cannot surface a chunk the first search never returned, and passing more chunks mostly adds noise.

IR-015 A team wants an assistant that answers questions on the internal quality handbook: about 120 pages, close to 60,000 tokens, updated twice a year. It plans a pipeline of chunking, embeddings and reranking. Which architecture choice should be recommended first?
  1. Build the planned pipeline and add generated context to every chunk
  2. Index the handbook in hybrid mode, embeddings plus BM25, with no reranking
  3. Put the whole handbook in the prompt and pair it with prompt caching Right answer
  4. Index section summaries and then fetch the matching full sections

Why Anthropic advises that under about 200,000 tokens the whole knowledge base can go in the prompt instead of a RAG pipeline, with prompt caching cutting cost and latency. The other options add a pipeline this size does not need.

IR-016 A documentation RAG gives a wrong answer roughly one time in three. The team is torn between reworking the generation prompt and overhauling retrieval, and today measures only an LLM judge's overall answer score. It has a question set labelled with the expected chunks. What should it do before choosing?
  1. A/B test both options in production and keep the one the judge scores higher
  2. Add reranking with Claude, which improves both stages at the same time
  3. Replace the LLM judge with human review to make the overall score reliable
  4. Measure retrieval precision, recall and MRR apart from end-to-end accuracy Right answer

Why The RAG cookbook evaluates retrieval against expected chunks separately from end-to-end accuracy, which shows which stage fails. An overall score, whether human or from an A/B test, does not locate the fault.

IR-017 An agent queries a company knowledge base through a custom tool that returns the passages found as plain text. The legal team wants each claim in the answer to point to the source page's internal URL and title, without custom parsing of responses. What should change?
  1. Have the tool return search_result blocks carrying source, title and citations Right answer
  2. Ask in the system prompt for the URL in brackets after every sentence
  3. Pass the pages as plain text documents and enable citations on each one
  4. Enforce through structured outputs a JSON schema with a source per sentence

Why search_result blocks returned by a tool produce citations that already carry the source and title the tool set. With plain documents the URL would have to be smuggled into a title and mapped back by hand, bracketed URLs are unverifiable, and structured outputs exclude citations.

IR-018 A service extracts rent, term and notice period from a lease supplied as a document with citations enabled. Its prompt ends with "Reply only with a JSON object". Answers are correct but carry almost no citations, although each value must be sourced. Which fix should be applied?
  1. Move to structured outputs with a strict schema to make the format reliable
  2. Ask for one line per field and parse the lines and citations in code Right answer
  3. Run a second extraction call that asks for the citations on their own
  4. Split the lease into separate documents, one per clause, keeping the prompt

Why A prompt demanding only JSON succeeds but yields few or no citations; the docs recommend one line per field, parsed afterwards. Structured outputs are incompatible with citations, and splitting the lease leaves the cause in place.

IR-019 A compliance tool returns search_result blocks whose content is a single text block several pages long. Every citation therefore returns the whole text. Auditors want each citation to point to exactly one regulatory clause, and a clause often runs several sentences. What should change?
  1. Pass the text as a plain text document so it is split into sentences
  2. Ask in the prompt to cite only the most relevant sentence of each clause
  3. Split each search_result's content into one text block for every clause Right answer
  4. Return fewer results per search to limit the size of each citation

Why The text block is the minimal citable unit: Claude cites whole blocks. One block per clause aligns citations with the wanted unit. Plain text splits into sentences, too fine here, and a prompt does not change the unit.

IR-020 A pipeline summarizes 60,000-token contracts and must produce JSON validated by structured outputs, which rules out the citations API. Reviewers find commitments that are not in the contract. The team wants summaries grounded in the text and auditable, without changing format. Which technique should it adopt?
  1. Compare several generations of the same prompt and reject the differences
  2. Instruct the model to use only the contract and none of its general knowledge
  3. Drop the schema and enable citations on the contract to trace each sentence
  4. Have verbatim quotes extracted first, then retract each claim that lacks one Right answer

Why Extracting exact quotes first and retracting any claim without one grounds the summary and leaves a per-claim trace in the required format. Comparing generations flags inconsistency but leaves no trace, a restriction instruction neither, and dropping the schema breaks the constraint.

Advanced Agent Architecture and Orchestration 0 / 32 freed

AG-001 A market research agent has a lead that splits each question across parallel subagents, giving each a one-line task such as "research the EV battery supply". Reviews show two subagents often cover the same ground while a key period goes unexamined, and their reports come back in shapes the lead struggles to merge. What should the team change first?
  1. Give each task an objective, an output format, source guidance and clear boundaries Right answer
  2. Reduce the number of parallel subagents so that fewer of them can overlap on one topic
  3. Add a deduplication pass in the lead that merges overlapping findings once they return
  4. Move the subagents to a stronger model so they can infer the intended scope by themselves

Why Overlap, gaps and unmergeable reports all trace back to vague delegation. Each subagent needs an objective, an output format, tool and source guidance and task boundaries. Deduplication or fewer subagents treat the symptom and leave the gaps.

AG-002 A research assistant's lead agent spawns eight subagents even for a question like the founding year of a company, and the token bill has become hard to justify. The team wants the lead to keep deciding how to split each question itself, without adding another service in front of it. Which change fits?
  1. Cap the session with a hard token budget that stops the lead in the middle of research
  2. Put scaling rules in the lead prompt that tie the subagent count to query complexity Right answer
  3. Route each query through a classifier service that sends simple ones to a single agent
  4. Make subagents run their searches one after another so each query spends fewer tokens

Why Anthropic's research system fixed over-spawning by embedding effort scaling rules in the lead's prompt: one agent for simple fact-finding, more for comparisons and complex research. A classifier adds the extra service the team ruled out; a hard cap cuts research off.

AG-003 In a multi-agent reporting system, subagents each produce a long chart-heavy report section that they pass back as text through the lead, which assembles the final document. Sections arrive truncated or paraphrased, and the lead's token usage climbs with each delegation round. What change addresses the cause?
  1. Ask each subagent to summarise its section more tightly in the text it reports back
  2. Raise the lead's output limit so the full sections fit into its assembly turn
  3. Have subagents store their sections externally and return lightweight references Right answer
  4. Compact the lead's context more often so returned sections fit in its window

Why Routing structured outputs through the coordinator loses information and costs tokens. Letting subagents write to external storage and pass back references avoids both. Tighter summaries or compaction lose even more of the content the final document needs.

AG-004 On Managed Agents, an incident coordinator delegates to a database specialist and a network specialist, each with its own system prompt and MCP servers. After a specialist reports, the coordinator often needs to ask it a follow-up about something it found, and the specialist should still remember its earlier investigation. Which setup fits?
  1. A dynamic workflow that runs the specialists in phases and merges their results
  2. An advisor model that the coordinator consults mid-turn for each specialist question
  3. Separate sessions per specialist, with the back end relaying questions between them
  4. Predefined subagents in their own threads, reached again through a follow-up message Right answer

Why A subagent's thread persists, so the coordinator can send a follow-up and the subagent keeps its earlier turns, with its own prompt and tools. A workflow run's threads cannot receive follow-ups, and separate sessions lose the shared sandbox and filesystem.

AG-005 An agent builds a web app over many sessions, each starting with a fresh context window. Several sessions in, a new session sees a working login page and a dashboard, concludes the app is complete and stops, although most of the requested features were never built. What harness change prevents this?
  1. Have a first session write a full feature list, each entry marked failing until tested Right answer
  2. Enable server-side compaction so later sessions keep a summary of earlier conversations
  3. Give the coding sessions a larger context window so the build can fit in a single run
  4. Add a final reviewer session that reads the code and decides whether the build is done

Why An initializer that expands the request into a feature list, every entry failing at first, gives each later session an explicit record of what remains. A reviewer reading the code faces the same missing reference, and compaction does not cross session boundaries.

AG-006 A log triage agent reads large log files and API responses, most of which it could fetch again cheaply. Its dialogue with the user is short, yet the context fills within a few dozen turns and recall of early instructions degrades. The team wants to keep the conversation text intact. Which context technique fits best?
  1. Turn on server-side compaction so the transcript is summarised near the limit
  2. Clear old tool results past a threshold, keeping the latest few calls intact Right answer
  3. Give the agent a memory directory where it saves notes about each file read
  4. Mark the system prompt and tool definitions for prompt caching across turns

Why Tool-result clearing targets context dominated by large, re-fetchable tool output and leaves the call records and dialogue in place. Compaction would summarise the conversation the team wants intact, and caching lowers cost without freeing any window space.

AG-007 A support agent built on the Messages API starts each customer conversation fresh. Returning customers complain they must restate their preferences and past issues. Compaction is already on and long conversations run fine. The team wants the agent itself to decide what is worth keeping between sessions. What should they add?
  1. Lower the compaction trigger so each summary keeps more of the customer details
  2. Load a CRM profile of the customer into the cached system prompt of each session
  3. Use the memory tool, with storage the team hosts, keyed to each customer Right answer
  4. Clear old tool results so more of each customer conversation fits in the window

Why Compaction and clearing act on the current window only. The memory tool lets Claude write what it judges worth keeping and read it in a fresh session, on storage the team implements. A CRM profile carries only fields someone chose in advance.

AG-008 A long-running coding agent marks each feature as passing in its feature list once unit tests and a few curl calls succeed. Later sessions keep finding that those features break in the browser, and time goes into rework instead of new features. Which harness change best addresses this?
  1. Add more unit tests for each feature so the coding agent catches regressions sooner
  2. Have a separate agent re-run the unit suite to confirm each feature it is told passed
  3. Ask the coding agent to record each test command it ran in the shared progress file
  4. Require browser automation that exercises the feature as a user to mark it passing Right answer

Why The harness article reports that unit tests and curl checks let broken features pass, and that prompting the agent to test end to end with browser automation, as a user would, substantially improved results. More or re-run unit tests check the same layer.

AG-009 A team's back end creates a Managed Agents session, sends the kickoff user message, and then opens the event stream to feed a live activity panel. The agent runs fine, but the panel sometimes lacks the first tool calls and messages of a run. No errors are logged. What should they change?
  1. Open the session's event stream first, then send the kickoff user message into it Right answer
  2. Poll the session status every few seconds instead of reading the live event stream
  3. Retry the kickoff message whenever the first events fail to appear in good time
  4. Create a fresh session for each attempt so the stream starts from a clean state

Why The stream delivers only events that occur after it opens, so opening it after the kickoff drops whatever the agent did in between. Retrying the kickoff would start duplicate work, and polling status does not return the missed messages.

AG-010 A file-cleanup feature runs as a Managed Agents session that takes twenty minutes. A load balancer occasionally drops the client's connection to the event stream mid-run, and the dashboard then shows gaps or the same event twice after reconnecting. How should the client recover?
  1. Restart the session with the same kickoff so the agent repeats its earlier work
  2. Open a new stream, list past events, and skip live events the list already gave Right answer
  3. Keep the socket alive with heartbeats so the stream never has to be reopened
  4. Store each event client-side and replay the log into a new session afterwards

Why The session's event history lives on the server, so the client can open a new stream, list what it missed and drop duplicates. Heartbeats reduce drops but cannot prevent every one, and restarting the session throws away twenty minutes of work.

AG-011 A ticketing integration on Managed Agents marks a ticket as done at the first session.status_idle event. The agent also has a custom tool that the team's back end runs to query the billing system. Some tickets are closed with no answer, right where the agent had just requested that billing lookup. What is the fix?
  1. Wait for a second idle event in a row before marking the ticket as done
  2. Treat an agent message that no tool call follows as the completion signal
  3. Read the idle event's stop reason and answer the tool call it reports pending Right answer
  4. Raise the session timeout so the agent has time to finish the lookup itself

Why Idle means the agent stopped and waits for input; its stop reason says why. A requires_action reason means a custom tool call needs an answer from the back end, while end_turn means the turn finished. The agent cannot run the back end's tool itself.

AG-012 A Managed Agents agent with the bundled toolset updates a pricing sheet from a single vendor's API and that vendor's documentation site. Security review requires that the sandbox and the web tools can reach those two hosts and nothing else, and the team wants to keep running on Anthropic's cloud. How should the environment be set up?
  1. Use unrestricted networking and name the two hosts to use in the agent's system prompt
  2. Run the agent in a self-hosted environment behind the company's general egress proxy
  3. Remove the web tools from the toolset and paste the vendor pages into the kickoff
  4. Use limited networking in a cloud environment and list both hosts as allowed hosts Right answer

Why With limited networking, the sandbox and web tools reach only the hosts listed as allowed, which enforces the rule while staying on Anthropic's cloud. A system prompt is advisory, self-hosting leaves the cloud the team wants, and pasted pages lose the live API.

AG-013 A bank's security team wrote a skill that applies its mandatory secrets-handling standard in Claude Code. Compliance requires that it apply on every engineer's machine across all repositories, and that no personal or project skill with the same name can replace it. How should it be distributed?
  1. Deploy it through managed settings so it outranks personal and project versions Right answer
  2. Commit it to each repository's .claude/skills folder and announce it to the team
  3. Publish it in a plugin on the company marketplace and ask engineers to install it
  4. Paste the standard into each project's CLAUDE.md so it loads in every session

Why Enterprise managed settings deploy skills organisation-wide with the highest priority, overriding personal and project skills of the same name: the fit for standards that must hold. Repository commits and plugins depend on each repo or engineer and can be shadowed.

AG-014 A payments team wrote a skill that explains how their monorepo's services, migrations and fixtures are laid out, so Claude Code follows their conventions. The skill makes no sense outside that repository. They want every teammate who works there to get it, and updates to arrive with normal pulls. Which distribution fits?
  1. Publish it as a plugin on a public marketplace so that others can discover it
  2. Commit it under the repository's .claude/skills folder so clones pick it up Right answer
  3. Deploy it through enterprise managed settings onto each engineer's machine
  4. Ask each engineer to copy the folder into their personal skills directory

Why Project skills in .claude/skills travel with the repository through Git: whoever clones gets them, and pushes reach teammates on their next pull. Plugins suit skills useful beyond one repo, and managed settings target mandatory organisation-wide rules.

AG-015 A team invokes its accessibility-audit skill in the main Claude Code conversation, then delegates reviews to a custom reviewer subagent whose tools list is Read, Grep and Bash. The reviews ignore the audit rules. The team wants the rules applied in every delegated review without relying on how the delegation prompt is worded. What should they do?
  1. Invoke the skill again in the main thread right before delegating each review
  2. Switch reviews to the built-in Explore agent, which reads the project skills
  3. List the skill in the subagent's skills field and add Skill to its tools list Right answer
  4. Copy the skill's instructions into the delegation prompt the main thread writes

Why Subagents do not see skills the main conversation invoked. A custom subagent preloads the skills named in its skills field, and keeping Skill in its tools lets it invoke others. Built-in agents preload none, and pasting into prompts is what the team wants to avoid.

AG-016 A platform lead found a community plugin whose skills would save the team hours, and plans to add it to the team's private marketplace so everyone can install it. The plugin also bundles hooks, an agent definition and an MCP server config. What should the lead check first?
  1. Install it in a test session and confirm its skills trigger as documented
  2. Check that its skill names cannot clash with the team's own existing skills
  3. Pin its version in the marketplace so later releases do not surprise people
  4. Review its hooks, agent and MCP servers, since they run with user privileges Right answer

Why A plugin runs code with the user's privileges: its hooks fire on matching tool calls alongside yours, and its agent setting can change default behaviour. Name clashes are not the risk, since plugin skills are namespaced; pinning a version keeps whatever the plugin does.

AG-017 An engineer spent a long Claude Code session building a payment retry feature with the main thread. Asked to review its own changes, the same thread returns mostly praise and misses an obvious race condition a colleague later spots. The team wants consistent reviews against its own standards. What should they do?
  1. Hand the review to a reviewer subagent working from the diff alone Right answer
  2. Have the main thread review its own diff against the team's written checklist
  3. Run a test-runner subagent and treat a green suite as the review's outcome
  4. Ask the main thread to adopt a senior security expert persona for the review

Why Claude reviews better when the code reads as someone else's; the thread that wrote it struggles to see it fresh. A reviewer subagent works from the diff without that history, and its system prompt can carry the team's standards. Expert personas add no capability.

AG-018 To fix production bugs, a team chains three subagents: one reproduces the bug, one diagnoses it, one writes the fix. The fixer often patches the wrong code path, because details the diagnoser noticed along the way never reach it. Which change best addresses this?
  1. Add an obstacles section to each agent's output so findings carry across
  2. Keep reproducing, diagnosing and fixing together in the main conversation Right answer
  3. Run the three agents in parallel so that none of them waits on the others
  4. Give the fixing agent the full transcripts of the two agents before it

Why Sequential pipelines fail when each step depends on what the previous one discovered, which bug fixing nearly always does: information is lost at each handoff. A richer summary still compresses, full transcripts defeat the point of isolation, and parallel runs break the dependency.

AG-019 A team delegates test runs to a subagent that returns a short verdict such as "4 tests failed in the orders module". Engineers keep writing throwaway debug scripts to find out which assertions failed and with which values before they can fix anything. What should they change?
  1. Ask the test subagent to return a longer summary of each failing test
  2. Give the test subagent edit access so it can fix the failures it finds
  3. Run the suite in the main thread so the full failure output is visible Right answer
  4. Split the suite across several test subagents that run side by side

Why The intermediate output matters here: diagnosing failures needs the full output, which a test-runner subagent hides by design. A longer summary is still a summary, and parallel test subagents multiply the same loss. The test runner pattern performed worst in testing.

AG-020 A product team uses Claude Code for both their app and its marketing site. They want landing page copy with a warm, persuasive voice aimed at small shop owners, but drafts come out terse and technical. They do not want to change how Claude writes code in the same sessions. What fits?
  1. Add tone guidance to the project CLAUDE.md that the main thread already reads
  2. Hand the copy to the built-in general purpose subagent for a first draft
  3. Draft the copy in the main thread and rewrite it after a separate review
  4. Add a copywriting subagent whose system prompt sets voice and audience Right answer

Why Claude Code's default prompt favours concise technical writing. A subagent with its own system prompt can set a different voice and audience without touching the main thread. Tone rules in CLAUDE.md would reach every coding session the team wants left alone.

AG-021 An operations agent uses hand-written custom tools that wrap a third-party project tracker's REST API. The vendor changes its API every few months, and each change breaks the agent until someone updates the wrappers. The vendor now publishes an MCP server for the same features. What should the team do?
  1. Connect to the vendor's MCP server so the vendor maintains the integration Right answer
  2. Write a skill that documents the vendor's endpoints for Claude to follow
  3. Keep the custom tools and pin the vendor's client library to a known version
  4. Add contract tests that alert the team as soon as the vendor's API changes

Why MCP moves maintenance to the service provider: the vendor updates its server when its API changes, and Claude discovers the tools and schemas itself. Contract tests only detect the breakage sooner, and a skill teaches a procedure rather than providing an integration.

AG-022 A team gives Claude access to a vendor's ticketing system through the MCP connector. The vendor's server exposes dozens of tools, including ones that create, edit and close tickets. Claude should only read tickets and list queues, and the team wants the unused tool definitions kept out of the context. How should they configure it?
  1. Tell Claude in the system prompt to read tickets but leave their state unchanged
  2. Disable the toolset by default and enable the read and listing tools by name Right answer
  3. Give the server a token from a service account that lacks write permissions
  4. Add a check in the loop that rejects tool calls whose names suggest a write

Why In the mcp_toolset entry, a disabled default with named tools enabled blocks writes and keeps the other definitions out of context. A read-only token blocks writes too, but every definition still loads, and a prompt rule is only advisory.

AG-023 An engineering firm uses Claude with the web search tool to check standards references in client proposals. The firm carries liability for wrong references and can stand behind answers drawn from the standards bodies' and regulators' own sites, but recent answers cited forum posts and reseller pages. What should they change?
  1. Ask Claude in the prompt to prefer official sites when it picks among results
  2. Post-filter the cited URLs in code and discard answers that cite other sites
  3. Set allowed domains on the web search tool to the official bodies' sites Right answer
  4. Build a custom search tool over a crawled copy of the official websites

Why The allowed_domains field limits search results to the named sites, subdomains included, so other sources never reach Claude. A prompt preference is advisory, post-filtering throws away answers after paying for them, and a crawled copy adds maintenance and goes stale.

AG-024 A research feature sends one Messages API request with the web search tool and displays the text it gets back. For broad questions, the response sometimes ends with stop_reason pause_turn, and users see half an answer. The team's loop treats any stop reason other than tool_use as final. How should they handle it?
  1. Raise max_tokens so the turn can finish before the API needs to pause it
  2. Write a handler that returns a tool result for each search the turn made
  3. Resend the original user message in a new request with the same tools
  4. Return the paused response as the assistant turn and resend, tools unchanged Right answer

Why The API can pause a long-running turn; returning that partial response as the assistant turn, with the tool list unchanged, lets Claude resume. Web search is a server tool, so there is no handler or tool_result to write, and resending the question restarts the work.

AG-025 An order support assistant exposes five tools, each returning one fact about an order: status, carrier, delivery estimate, address and total, each with a one-line description. For a question like "where is my order and when will it arrive", Claude often calls three or four of them or picks the wrong one. What should the team change first?
  1. Merge the overlapping tools into one tool with a parameter naming the fields Right answer
  2. Lengthen each tool's description with examples of questions that it answers
  3. Add a routing step in code that picks the tool before Claude sees the request
  4. Expose fewer tools per request, chosen by keywords found in the user query

Why When several tools return almost identical facts, no description makes the choice reliable. Combining them into one tool with a fields parameter removes the guess. Longer descriptions help distinct tools, and keyword routing moves the choice into brittle code.

AG-026 An invoicing assistant picks the right lookup tool, but often passes "4471" where the tool needs a full identifier such as INV-2025-4471. The handler cannot fill in the year itself, because the same four digits exist in several years. Users usually mention the year elsewhere in their question. What should the team change?
  1. Rewrite the tool's main description to say when to call it and when to avoid it
  2. Give the format in the parameter's description and add matching input examples Right answer
  3. Normalise partial identifiers in the tool handler before it queries the database
  4. Return an error from the tool so Claude retries with a corrected identifier

Why A wrong value format is fixed in the schema and examples: state the format in the parameter's own description and add input_examples. The tool choice already works, so the main description is not at fault, and the handler cannot normalise ambiguous digits.

AG-027 A facilities assistant has a site lookup tool described as "Gets site information" and a separate room booking tool. Asked whether a meeting room at a site is free tomorrow, Claude calls the site tool, gets no booking data and answers vaguely. Parameters are passed correctly. What should the team change?
  1. Rename the site tool so that its name no longer hints at room bookings
  2. Add an enum to the site tool's schema listing the fields it returns
  3. Say in the site tool's description what it omits and which tool to use Right answer
  4. Drop the booking tool from requests that do not mention a room

Why Claude decides from the descriptions, so calling the wrong tool is fixed there: say what the tool returns, when not to use it, and which tool to call instead. Renaming barely helps a one-line description, and an enum shapes parameters rather than the choice.

AG-028 A team rewrote all the tool descriptions of its HR assistant and merged two tools. To judge the change, the engineer tried a handful of questions in a chat window, and they looked better. Before shipping, the lead wants evidence that tool selection actually improved, on the same model. What should they do?
  1. Ship the rewrite and watch production logs for wrong tool calls next week
  2. Ask Claude to rate each new description for clarity before it ships out
  3. Retry the questions that failed before and confirm they now pick correctly
  4. Run a fixed set of questions labelled with expected calls, before and after Right answer

Why An eval of fixed questions labelled with the right tool calls, run on both tool sets with the same model, measures the change. Replaying past failures shows fixes but hides regressions on questions that used to pass, and production logs come after users are affected.

AG-029 A consultant built a skill that drafts client status reports and is about to bundle it into the team's plugin. Running it on three realistic requests gave tidy, well-structured reports. A colleague asks whether the skill is earning its place in everyone's setup. What check answers that question?
  1. Compare each output with a no-skill run of the same prompt Right answer
  2. Ask a teammate to read the outputs and score each one against a checklist
  3. Run the same prompts several times and check the outputs stay consistent
  4. Add more example reports to the skill so its outputs look more uniform

Why A good output alone does not show the skill adds anything. Pairing each with-skill output with a no-skill baseline on the same prompt shows the difference the skill makes. A checklist score or consistency test still judges the output in isolation.

AG-030 An engineer's release-notes skill works every time for him. After he shares it, teammates report that Claude often writes release notes without loading it. His own tests always used the exact phrasing found in the skill's description. What should he do before sharing a new version?
  1. Move more of the skill's guidance into the SKILL.md body to make it clearer
  2. Phrase the task several ways and refine the description until it loads each time Right answer
  3. Ask teammates to call the skill by name at the start of each related request
  4. Copy the skill's instructions into CLAUDE.md so they load in each session

Why Only the name and description sit in context up front, and Claude uses them to decide whether to load the skill. Testing varied phrasings and refining the description fixes triggering. The body is read only after the skill loads, so editing it changes nothing here.

AG-031 A first eval round on a meeting-summary skill shows the outputs run too long and skip the action items section. The author plans to rewrite the tone, cut the length, add the missing section and swap the examples in one revision, then rerun. What is the better next step?
  1. Apply the planned changes together, then rerun the prompts to compare
  2. Write fresh eval prompts for the next round so the skill is not overfitted
  3. Fix the missing section first, rerun the same prompts, then review again Right answer
  4. Drop the baseline outputs from the next round to halve the review time

Why Changing one thing at a time, starting with the issue that matters most, and rerunning the same prompts shows which change moved the result. Bundling four edits hides the cause, and new prompts break the comparison with the first round.

AG-032 After two eval rounds, a contract-review skill clearly beats the no-skill baseline on the two request types it was designed for. A third prompt, a request type just outside its intended scope, still looks no better than baseline. The author wants to keep iterating until that one passes too. What is the sounder call?
  1. Keep iterating on the skill until the third case also beats the baseline
  2. Widen the skill's description so it also claims the third request type
  3. Ask a second reviewer to grade the outputs before deciding to share it
  4. Share it now and document the third case as one it does not yet handle Right answer

Why The shipping bar is not perfect evals: the cases you care about should pass meaningfully better than baseline, and the cases not yet handled should be named. Widening the description would trigger the skill on requests it handles no better.

Observability and Production Monitoring 0 / 16 freed

OB-001 A team runs a Managed Agents session from its backend with the Anthropic SDK. Some tools are custom and executed by the SDK's session tool runner, others are server tools the API runs inside each turn. Incident reviews need one trace that shows the turns, the model requests and both kinds of tool. What tracing setup gives them that?
  1. Enable SDK tracing in the backend and add an API destination in the Console as well Right answer
  2. Enable SDK tracing in the backend with Full content so each request carries its prompts
  3. Add an API tracing destination in the Console and keep the backend free of instrumentation
  4. Wrap each SDK call in an application span and record the usage block of each response

Why SDK spans cover client tools run by the tool runner, while turns, each model run and server tools come only from API spans. Either source alone leaves one kind of tool out; both together form one trace.

OB-002 A FinOps engineer builds a token dashboard from exported spans. The service has both SDK and API tracing on, and the dashboard sums gen_ai.usage.input_tokens over every span named anthropic.messages.create. The totals come out roughly double the invoice, and a few days spike further after destination outages. What should the query change?
  1. Add the cache read and cache write attributes so cached input is no longer missing
  2. Keep the SERVER spans of each request and count each span once by trace and span ID Right answer
  3. Switch the destination to Metadata only so content no longer inflates the usage attributes
  4. Sample one request in two at the SDK and multiply the summed usage by two

Why The CLIENT and SERVER spans share a name, so summing both counts each request twice, and retried deliveries repeat spans. Input tokens already include cache reads and writes, so adding them inflates the total further.

OB-003 A job runner starts an Agent SDK task per queue message and the container is killed a moment after the task returns. Long tasks show complete traces in the collector, but short ones often arrive with spans missing. Other services reach the same collector without trouble. What change addresses the missing spans?
  1. Set the CLI's OpenTelemetry diagnostics to stderr to surface the exporter's connection errors
  2. Add the console exporter beside otlp so that each span is also written to the job log
  3. Shorten the trace, log and metric export intervals so batches leave while the task runs Right answer
  4. Raise the content length limit so that long tool outputs stop truncating their spans

Why The CLI batches telemetry and exports on an interval; a process killed before it flushes loses the buffer. The collector is reachable, so diagnostics would show nothing, and the console exporter would corrupt the SDK's stdout message channel.

OB-004 A Go service uses its own HTTP client, not the Anthropic SDK, to send user messages to Managed Agents sessions. API tracing is on and its spans arrive, but each session shows up as a trace separate from the service's request span, so on-call cannot see which inbound call caused a slow turn. What fixes the link?
  1. Group the session's spans by anthropic.session.id in the backend to rebuild the timeline
  2. Switch the destination to Full content so each turn span carries the inbound message
  3. Store the session ID as an attribute on the service span and join the two in queries
  4. Copy the active span's context into a W3C traceparent header on each session request Right answer

Why The API reads trace context from the traceparent header; without the SDK, the client must set it so API spans nest under the service span. Grouping by session ID collects a session's spans but never ties them to the caller.

OB-005 A platform team rolls out Claude Code to 400 developers and must guarantee that its telemetry reaches the company collector with the company's credentials. A pilot showed two developers had pointed the logs signal at a personal collector through their shell. Where should the endpoint, protocol and headers be set?
  1. In the managed settings env block, which removes conflicting developer-set OTLP endpoints Right answer
  2. In each repository's .claude/settings.json, so the values travel with the code under review
  3. In a SessionStart hook that checks the OTLP variables and stops the session on a mismatch
  4. In a shell profile script pushed by device management to every developer laptop

Why A managed OTLP endpoint makes Claude Code drop developer-set per-signal endpoints at startup. Repository settings files are ignored for exporter variables, and a shell profile is exactly what the developers already overrode.

OB-006 A bank runs Claude Code against Amazon Bedrock with OpenTelemetry metrics flowing to its backend. Leadership asks for token usage per developer and per department, but the dashboard can only split by session and by an opaque installation identifier. What should the platform team do?
  1. Turn on tool detail logging so the metrics carry the real agent and skill names per request
  2. Attach user and department as resource attributes per user through managed settings Right answer
  3. Turn on host attributes so each metric names the machine and map machines to owners
  4. Export the raw API bodies and parse the requester from each logged request payload

Why With Bedrock there is no Claude account, so only the installation ID and session ID are populated; the docs say to add identity through OTEL_RESOURCE_ATTRIBUTES. Host attributes name machines, which breaks on shared or container hosts.

OB-007 An SRE pages on every claude_code.api_error event from headless Claude Code jobs, assuming each one is a single failed attempt among many retries. Pages are rare but each wakes someone, and most turn out to be jobs that finished fine. What alert logic matches how the event is emitted?
  1. Count api_error events per job and page once their number passes the configured retry ceiling
  2. Page when api_error events from many sessions cluster inside the same five-minute window
  3. Page when no api_request event follows the api_error inside the same session.id Right answer
  4. Raise the retry ceiling so that fewer requests ever reach a terminal api_error event

Why Claude Code emits api_error once, after it gives up retrying, so counting events per retry is wrong. A later api_request in the same session shows the job recovered, which separates stalled sessions from ones that moved on.

OB-008 Security enabled OTEL_LOG_USER_PROMPTS for Claude Code so a SIEM can correlate prompts with tool decisions, with a collector rule that deletes the prompt attribute before storage for one regulated team. An audit finds that team's prompt text in the SIEM anyway. What should change in the collector?
  1. Drop the user_prompt events of that team entirely and keep their tool decision events
  2. Hash user.email on that team's events so prompts can no longer be tied to a person
  3. Route that team's logs signal to a separate collector with shorter storage retention
  4. Name both the prompt and the prompt_text attributes in the processor that deletes them Right answer

Why The user_prompt event carries the text in two attributes, so a rule naming one leaves the other. Dropping the whole event loses the correlation security wanted, and hashing identity or shortening retention still stores the text.

OB-009 Counsel at a Claude Enterprise customer must show exactly what Claude wrote in a chat where a client contract was discussed last quarter. The admin opens the audit logs and finds the member, the time and the conversation identifier. Which record answers counsel's question?
  1. The Compliance API record of that chat, which holds the messages themselves Right answer
  2. The audit log events for that conversation, read together with its file share events
  3. The OpenTelemetry export from that period, filtered on the member's email attribute
  4. A full data export of the organization, searched afterwards for the contract's name

Why Audit logs hold who did what and when, without prompts or completions. The Compliance API is the content record for a case-by-case question; a full export pulls everything wholesale, and telemetry describes how surfaces run.

OB-010 A company will give Claude chat, Cowork and Claude Code to 2,000 people next Monday. Its SIEM already has an owner who reviews security logs weekly. The project lead suggests waiting a month after launch to enable the Compliance API, once usage settles. What should the admin team do?
  1. Keep the plan and pull audit logs for the first month, then switch the API on
  2. Have the Primary Owner enable it before launch and route it into the existing SIEM review Right answer
  3. Enable it at launch and give a new dedicated Claude reviewer sole access to its content
  4. Leave it off and write down the condition under which the team will switch it on

Why Activity events and local session transcripts are captured only while the API is on, so a late start leaves a gap nothing fills. A review process already exists, so routing there beats creating a new reviewer; leaving it off suits companies without one.

OB-011 In a Claude Enterprise organization, the lending unit's regulator caps how long chat content may be kept, well below what research teams want. Research also has a few long-running studies whose chats must survive past that cap for audit. How should the admin handle retention?
  1. Keep indefinite retention and have lending staff delete chats once the cap is reached
  2. Set the research window org-wide and have DLP flag lending chats nearing the cap
  3. Set the regulator's window org-wide and archive the studies' chats before deletion Right answer
  4. Set the regulator's window org-wide and pull the studies' chats from the API later

Why Retention is organization-wide, so the regulated unit's shorter window applies to everyone. Once retention deletes chats the Compliance API cannot return them, so the studies must be archived first. Manual deletion or DLP alerts do not enforce the cap.

OB-012 A payments company on Claude Enterprise must ensure that full card numbers pasted by staff into Claude chat, Cowork or Claude Code never reach the model at all. The risk lead proposes several controls. Which one meets that requirement?
  1. Set the shortest custom retention window so pasted card numbers are purged within weeks
  2. Route the Compliance API into the DLP tool so pasted card numbers raise an alert
  3. Turn off content capture in the OpenTelemetry export so card numbers stay out of telemetry
  4. Propose inference hooks that send each prompt to a security server for an allow or deny Right answer

Why Inference hooks decide before Claude answers, blocking content at the door. Retention, DLP alerts on the Compliance API and telemetry settings all act after the prompt has already reached Claude, and retention has no zero option.

OB-013 A team wants Claude to pick up production regressions without someone starting the work. One proposal has a scheduled Claude run read the latency and error dashboards every hour and judge whether anything looks abnormal. The team lead wants the detection step to be auditable and testable. What design fits?
  1. A versioned, unit-tested script computes rolling bands and invokes Claude on a breach Right answer
  2. Claude reads the dashboards hourly and a second agent reviews each anomaly it reports
  3. Claude reads the dashboards hourly with a fixed rubric and logs its verdict on each run
  4. The existing alerting tool pages on-call, who then starts Claude to investigate the alert

Why Detection stays deterministic, with no model involved, so it can be version controlled and unit tested; Claude enters only once a band is breached. Paging on-call keeps a person in the path, which is what the team wants to remove.

OB-014 A checkout service has hourly error-rate readings and a 30-day rolling baseline. The team is deciding what Claude may do at each band. Their history shows noise alone crosses the one-sigma line most days, and even the three-sigma line now and then with nothing wrong. Which response policy fits?
  1. 1σ starts a read-only diagnosis, 2σ opens a PR, 3σ deploys the fix itself
  2. 1σ logs, 2σ starts a read-only diagnosis, 3σ acts through pre-approved routes Right answer
  3. 1σ logs, 2σ opens a PR, 3σ rolls back and pages the on-call engineer
  4. 1σ and 2σ log, 3σ grants Claude write access to diagnose and fix

Why Noise trips 1σ most days, so it only logs; 2σ warrants a read-only look. Even 3σ fires by chance at times, so action stays on gated routes such as a PR into review or an approved runbook, never broad write access.

OB-015 A team's band script on PR review time has never fired, yet over six weeks median review time crept from four hours to seven. Each hourly reading stayed under two sigma of a rolling 30-day baseline, which itself kept rising. What change lets the loop catch this kind of regression?
  1. Lower the action threshold to one sigma so smaller deviations reach Claude's diagnosis
  2. Shorten the baseline window to seven days so it reacts faster to recent readings
  3. Add run rules such as eight readings in a row above the mean, treated as a 2σ tier Right answer
  4. Have Claude review the weekly trend chart and flag any curve that looks like drift

Why Western Electric style run rules catch slow drift that never crosses a sigma line, and the lesson counts a drift rule as 2σ. Acting at one sigma floods the queue with noise, and a shorter window follows the drift even faster.

OB-016 A monitoring agent has run for a quarter. Breach-to-finding time fell sharply, but the same class of incident, a feature flag default flipped in a refactor, has now come back three times, each time fixed and merged after triage. What should the team add when such a fix ships?
  1. A tighter band on the affected metric so the next occurrence is detected an hour sooner
  2. A post-mortem entry in the incident channel so responders recognise the pattern next time
  3. A runbook the agent may trigger to flip the flag back when the band is next breached
  4. An eval that replays the incident's request and fails if the default flips Right answer

Why Each shipped fix should leave an eval for its incident so the change is caught before release; repeat incidents of the class are the lagging indicator it should push down. The other options speed up detection or recovery, not prevention.

Evaluation Engineering and Quality Assurance 0 / 16 freed

EV-001 A team extracts fields from supplier contracts with Claude. Its eval suite, built at launch, passes on every merge. Three months later, support reports wrong extractions on contracts from a new partner with an unfamiliar layout. The suite holds no case in that layout. Which setup would have caught this decline as it happened?
  1. Sample a slice of live traffic each night and grade it with an LLM judge following a rubric Right answer
  2. Rerun the full suite as a nightly batch across candidate models and track their scores over time
  3. Make the smoke eval a required branch protection check so a lower score blocks the merge
  4. Add few-shot examples to the prompt covering the contract layouts of current partners

Why The suite only covers inputs known at build time, so it stays green while traffic shifts. Grading a live sample with a rubric judge, which needs no expected answers, exposes drift. A nightly batch only replays the same old cases.

EV-002 A nightly LLM-judge score on a traffic sample naturally moves a few points from one night to the next. On-call gets an alert for every night that scores below the previous one and has started ignoring them, including the week accuracy truly fell. How should the alert rule change?
  1. Double the nightly sample size to smooth the score and keep comparing against the previous night
  2. Alert on a score more than two standard deviations under the trailing average of recent nights Right answer
  3. Replace the LLM judge with deterministic checks whose score does not move from night to night
  4. Set a fixed threshold from the first week's score and alert on the first night falling under it

Why Comparing against a trailing baseline with a two standard deviation margin separates a real drop from normal noise. A larger sample reduces noise but keeps a rule that still fires on about half the nights.

EV-003 For six months, an LLM judge has graded a nightly traffic sample from a billing assistant, and its score stays flat. Yet a customer review turns up several wrong answers the judge had marked correct. Before touching the alert threshold, what should the team put in place?
  1. Raise the share of sampled traffic so that rare errors show up more often in the score
  2. Tighten the alert threshold so the team reacts to smaller score drops than it does today
  3. Have a person regularly regrade a sample of answers and compare with the judge Right answer
  4. Run the full suite as a batch on a newer model to confirm the assistant's accuracy

Why The judge can be wrong: it passes wrong answers, so its flat score proves nothing. Human review of a sample calibrates it. More traffic or a tighter threshold only measure a signal that is itself wrong more precisely.

EV-004 The nightly judge of a ticket summarization service marks about ten live answers incorrect each week. The team patches the prompt case by case, but the offline eval suite, frozen since launch, still does not reflect these ticket shapes. What should happen to these flagged answers?
  1. Group them into a weekly report sent to the product team so it can rank the fixes
  2. Inject them as few-shot examples in the production prompt so the model corrects itself
  3. Use them to recalibrate the judge's rubric so it grades these tickets more strictly
  4. Write the expected answer for each one and add it as a new case in the full suite Right answer

Why Each failure caught on live traffic, once given its expected answer, joins the full suite, which then tracks real inputs and guards against regressions. Few-shot examples patch the symptom without measuring anything.

EV-005 A team runs a Claude Code eval suite in CI, triggered by changes to application code. A developer merges a rewrite of a database migration skill; the next day the agent forgets the rollback script. The suite never ran on that change. Which CI fix is called for?
  1. Run the suite whenever CLAUDE.md, a skill or a hook changes, plus once every night Right answer
  2. Require review by a second engineer on every pull request that edits a skill file
  3. Add a verification step to the skill that checks the rollback script is present
  4. Cut the suite down to the migration cases so it runs faster on each pull request

Why The configuration that steers the agent deserves the same regression testing as code, so the suite runs on its changes and on a schedule. Human review helps but does not measure how the agent behaves.

EV-006 The CI job that replays agent evals headless takes twenty minutes. An engineer proposes adding the --bare flag to every claude -p call, which speeds startup by skipping CLAUDE.md, skills and hooks. The suite exists to validate changes to those files. What verdict should the review give on the flag?
  1. Accept it and paste the CLAUDE.md content into each eval prompt to compensate
  2. Reject it, since it strips the very configuration the suite exists to evaluate Right answer
  3. Accept it on pull requests and keep a full run without it on the nightly schedule
  4. Accept it on the nightly runs only, where no configuration change is under test

Why The flag skips CLAUDE.md, skills and hooks, exactly what the suite tests. The merge gate needs that configuration loaded, and so does the nightly run, which checks the configured agent as models and inputs change.

EV-007 In a CI eval suite, a run marked as passed gets read by chance: to make the tests pass, the agent edited the Makefile's test target and a check script in the repository. The checker noticed nothing. Which safeguard belongs in the eval harness?
  1. Deny the agent Bash during evals so that it can no longer run shell commands at all
  2. Add a CLAUDE.md rule asking the agent never to modify the Makefile or check scripts
  3. Fail any run that changes files outside its allowed paths and run checks from a copy Right answer
  4. Hand grading to an LLM judge that reads the diff and spots suspicious modifications

Why The harness must mechanically reject changes outside the allowed paths and grade with checks copied before the run, which the agent cannot rewrite. A CLAUDE.md rule is only an instruction the agent may ignore.

EV-008 A CI eval checks that an agent does not write API response bodies to the logs. Its check greps the diff for a variable named response_body. After a model change, the eval fails although the logs are clean, because the agent named its variable payload. How should the check be rewritten?
  1. Broaden the grep to a list of common variable names used for a response body
  2. State in the eval prompt the variable name expected for the response body
  3. Replace the grep with an LLM judge that reads the diff and decides if sensitive data leaks
  4. Call the endpoint with made-up data, capture the logs and look for the whole body Right answer

Why The check should test what the code does, not how it is written: exercising the endpoint and reading the logs ignores naming. A judge reading the diff still grades form, and does so non-deterministically.

EV-009 A customer-facing refund agent must handle each request correctly every single time. The team runs five trials per task. A colleague reports pass@5 near 98 percent and proposes shipping. Which measure should drive this decision?
  1. pass^5, the probability that five trials of the same task all succeed Right answer
  2. pass@1, the success rate of a single trial, averaged over the suite's tasks
  3. pass@5 recomputed on a harder task set so that the score avoids saturation
  4. The mean LLM-judge score on transcripts, weighted by the severity of the errors

Why pass@k measures the chance of at least one success and rises with k; pass^k requires every trial to succeed and fits an agent that must be reliable every time. pass@1 overstates the consistency needed.

EV-010 An eval for a coding agent chains its trials in the same container. Results vary widely with execution order, and transcripts show the agent reading git history left by an earlier trial or caches already filled. What should be fixed first?
  1. Raise the number of trials per task so the average absorbs the ordering effect
  2. Start each trial in a clean environment with no inherited files or history Right answer
  3. Shuffle the task order on each run so that the ordering effect is spread out
  4. Grade the agent's path so that reads of the git history get penalized

Why Shared state causes correlated failures and can inflate scores; isolating each trial removes the cause. More trials or a shuffled order dilute the bias without eliminating it.

EV-011 On an eval cluster for coding agents, each task gets a single memory limit that acts as both guarantee and ceiling. Several percent of tasks fail on containers killed during brief spikes, unrelated to the model. The team wants reliability without making the eval easier. What should change?
  1. Remove every resource limit so that no container gets killed in the middle of a task
  2. Automatically retry killed tasks until a run completes with no infrastructure error
  3. Split a guaranteed allocation from a higher kill threshold, calibrated to keep scores stable Right answer
  4. Drop killed tasks from the score and report the success rate on the remaining tasks

Why A guarantee plus a separate ceiling avoids spurious kills, and calibrating the band keeps scores within noise. With no limit, resources change what the eval measures and favour resource-hungry strategies.

EV-012 A support agent fails a third of the trials of an eval whose grader checks the exact sequence of tool calls. Reading the transcripts, the team sees that many failures resolve the ticket through a different, valid order of calls. How should grading change?
  1. Add the expected call order to the prompt so the agent follows the graded sequence
  2. Run more trials per task and report pass@k to smooth over unusual call orders
  3. Hand every failed trial to a human grader so each case is settled individually
  4. Grade the end state the agent leaves, with partial credit for steps reached Right answer

Why Checking step order is brittle and penalizes valid approaches nobody anticipated; grade what the agent produced. Constraining the prompt bends the agent to fit a faulty grader.

EV-013 A team compares two versions of its document tools on the same forty eval tasks. Both versions reach the same accuracy, and the eval records nothing else. Reviewers suspect one version makes the agent work much harder to get there. What should the eval collect to settle which version ships?
  1. Tool calls, tokens, runtime and tool errors per task, beside accuracy Right answer
  2. A second accuracy score from an LLM judge grading each final answer
  3. Accuracy on a larger task set so the small gap between versions shows
  4. The agent's own rating of each tool, written in a feedback section

Why Accuracy alone hides cost. Tool calls, token consumption, runtime and tool errors show which version reaches the answer efficiently, and many calls can point to tools worth consolidating. Another accuracy score still measures correctness only.

EV-014 To evaluate a scheduling agent's tools, a team wrote thirty tasks such as "fetch event 4512". The agent passes nearly all of them, yet in production it fails on requests like setting up a meeting with prior notes and a room. How should the task set be rebuilt?
  1. Keep these tasks and check answers by exact match to get a stricter score
  2. Write realistic multi-step tasks, each with a verifiable outcome Right answer
  3. Attach the exact list of expected calls to each task and grade their order
  4. Generate hundreds of variants of the current tasks to gain statistical power

Why Simple single-step tasks do not stress the tools; tasks drawn from real use that need many calls and have a verifiable outcome expose weaknesses. Imposing a call sequence overfits to one path.

EV-015 Eval transcripts for a support agent show it calling list_tickets page after page, often ten times or more, before it finds the one ticket a task names. Accuracy is fine, but each task burns many tokens. Which tool change should the team test in the next eval round?
  1. Raise the page size of list_tickets so each call returns many more tickets
  2. Add a system prompt rule telling the agent to stop paging through sooner
  3. Add a search tool that filters tickets on the server and returns matches Right answer
  4. Cache the list_tickets responses so repeated pages cost fewer tokens

Why Listing every record spends context on irrelevant data; a targeted search tool returns only what the task needs, so calls and tokens fall. A bigger page pulls more irrelevant tickets into context, and a prompt rule leaves the tool's shape unchanged.

EV-016 A team improves its tool descriptions over ten iterations, each time reading the transcripts of the same forty eval tasks. The score climbs from 60 to 95 percent. Before shipping, a reviewer worries the descriptions are tailored to those exact tasks. How should this be checked?
  1. Rerun the forty tasks several times to confirm the score stays stable
  2. Ask Claude to critique the descriptions in a feedback section of each run
  3. Compare the average number of tool calls per task before and after the iterations
  4. Measure the score on a held-out task set that was never seen during iterations Right answer

Why A held-out test set exposes overfitting to the iteration tasks. Rerunning the same tasks measures variance, not generalization, and agent feedback guides fixes without proving they generalize.

Runtime Guardrails and Production Security 0 / 20 freed

GS-001 An Agent SDK agent analyses public repositories submitted by customers, then opens GitHub issues through the GitHub API. The GitHub token is currently passed to the container as an environment variable. The security review requires that a prompt injection hidden in a repository cannot lead to that token leaking. Which change meets the requirement?
  1. Route GitHub calls through an outside proxy that injects the token Right answer
  2. Load the token from a secrets manager at startup and give it a short lifetime
  3. Mount the token file read-only into the container instead of using a variable
  4. State in the system prompt that the token must never appear in any response

Why With the proxy, the agent makes calls without ever seeing the secret, so there is nothing to exfiltrate from its environment. A short-lived or mounted token stays readable by injected code, and a prompt instruction is not a boundary.

GS-002 To cut costs, a team runs Agent SDK sessions for several customers inside one long-running container. A customer reports that the agent quoted an internal convention belonging to another customer. The investigation shows CLAUDE.md files and auto memory are read from the shared filesystem. What should the team configure first?
  1. Run the container under gVisor so that each session's system calls are isolated from the host
  2. Empty the setting sources, disable auto memory, give each tenant its own cwd and config Right answer
  3. Apply distinct egress rules and credentials per customer at the outbound proxy
  4. Attach a separate SessionStore per customer to partition the sessions' transcripts

Why The leak comes from settings and memory loaded off the shared disk, so those sources must be cut and cwd and config directory separated. gVisor protects the kernel, egress rules protect outbound traffic, and SessionStore only covers transcripts.

GS-003 An agent runs code against files uploaded by strangers, for several customers. Its Docker containers already run as non-root, with all capabilities dropped, a strict seccomp profile and no network. The audit now asks that an exploit targeting a kernel flaw cannot reach the host kernel directly. Which measure answers that request?
  1. Enable userns-remap so container root maps to an unprivileged host user
  2. Make the root filesystem read-only and confine writes to a tmpfs mount
  3. Run the containers under gVisor to handle system calls in user space Right answer
  4. Lower the memory and process caps to block resource exhaustion attempts

Why A container shares the host kernel. gVisor handles system calls in user space, so an exploit must break gVisor first. userns-remap limits damage after an escape without preventing it; the other two target persistence and resources.

GS-004 A team isolates its CI agent with sandbox-runtime and a three-domain allowlist. A pentest shows code launched in the sandbox reaching an off-list host by playing with the hostname announced during the encrypted connection. The agent needs all three domains. Which measure closes that path?
  1. Shrink the allowlist to the bare minimum by removing the least used domain
  2. Forbid WebFetch with a deny permission rule in the managed settings
  3. Remove credentials tied to the allowed domains from the sandbox environment
  4. Place a proxy that terminates TLS and inspects traffic outside the sandbox Right answer

Why By default the proxy filters on the client-supplied hostname without inspecting encrypted traffic, which lets domain fronting through. Only a TLS-terminating proxy sees the real destination; a WebFetch deny rule does not stop the shell.

GS-005 An email triage assistant receives, for each inbound message, the email body pasted after the user's request in a text block of the user turn. Emails from unknown senders contain instructions addressed to the assistant. The internal users are trusted. Which change to the application should come first?
  1. Deliver the email body in a JSON-encoded tool_result that states its source Right answer
  2. Screen user requests with a small classification model before the main call
  3. Throttle and then ban accounts that trigger refusals again and again
  4. Add company values and a refusal phrase to the system prompt

Why This is indirect injection: the adversary writes the content, not the user. Claude treats instructions inside a tool_result with skepticism, and JSON delimits the data. Screening users or banning accounts targets direct jailbreaks.

GS-006 A team correctly delivers fetched web pages in tool_result blocks. To steer the next step, its code appends the sentence "summarise in three points for the user" to the end of each result. Logs show Claude often ignores that sentence and sometimes flags it as a possible injection. What should the team change?
  1. Wrap the instruction in a dedicated XML tag inside the tool result
  2. Move the instruction into a user turn that follows the result block Right answer
  3. State in the tool description that its results contain instructions
  4. Remove the injection screen that analyses the tools' outputs before Claude

Why Claude treats tool_result content as untrusted data, your own instructions included. They belong in a user turn after the result. Announcing that the tool carries instructions would weaken the defence rather than work with it.

GS-007 A monitoring agent reads the open web and can send external emails on behalf of the sales team. A classifier already screens tool outputs before Claude reads them. The CISO notes injection success rates are falling but not zero, and wants to bound what a missed injection can do. Which measure answers that?
  1. Add a second classifier, from another family, that reviews the tool outputs
  2. Extend the system prompt with a policy declaring all retrieved content untrusted
  3. Replace sending with drafts that a person reviews before anything goes out Right answer
  4. Analyse responses every week to spot injections that have succeeded

Why The ask is to limit damage from an injection that gets through: removing the send verb and keeping a person before the consequential action does that. Another filter or policy lowers the odds without bounding impact; weekly review comes too late.

GS-008 A public advice chatbot already screens each user message with a small model before the main call, and its system prompt sets a refusal phrase. Logs show a handful of accounts sending hundreds of bypass variants a day until one gets through. What should be added?
  1. JSON-encode user messages before passing them on to Claude
  2. Pass user messages in tool_result blocks rather than as plain text
  3. Screen tool outputs as well with the same small classification model
  4. Count refusals per account, warn the user, then throttle or ban Right answer

Why Here the user is the adversary and iterates: acting on repeat offenders breaks the trial loop. JSON encoding, tool_result delivery and tool-output screening target indirect injection, where third-party content is hostile and the user is trusted.

GS-009 Developers ship to production from Claude Code through an MCP release tool. The change process requires that the release manager, not the person driving the session, approve each version through a ticket in the change system. How should this rule be enforced?
  1. A PreToolUse hook that denies the release until an approved ticket exists for that version Right answer
  2. A PreToolUse hook that returns ask so each release gets confirmed inside the running session
  3. A deny rule in managed settings that blocks the production release tool entirely
  4. A CLAUDE.md instruction requiring a ticket check before the release is called

Why The approver is not in the session, so the hook must read their recorded approval and block otherwise. ask only gets the session driver's confirmation, a blanket deny removes the legitimate path, and CLAUDE.md is a request Claude can skip.

GS-010 A PreToolUse hook must stop Bash commands that write to the production config directory. It detects those commands correctly, writes an error message to stderr and exits with code 1. Yet the commands still run. What needs fixing?
  1. Move the check to a PostToolUse hook that inspects the executed command
  2. Make the script exit 2, which blocks the call and returns stderr to Claude Right answer
  3. Tighten the hook's matcher so it targets only the commands concerned
  4. Declare the hook in managed settings so no local setting overrides it

Why Exit code 1 is a non-blocking error: stderr is logged and the tool runs. Code 2 blocks and feeds the message back to Claude. PostToolUse fires after execution, and neither the matcher nor managed settings change the exit code's meaning.

GS-011 A deploy hook returns ask for the integration environment so a person confirms each deployment. A nightly job now runs Claude Code with -p on the release branch, which only receives commits through approved PRs, and every integration deployment it attempts is refused. The team wants the job to deploy while engineers keep confirming their own. What should change?
  1. Run the nightly job in bypass permissions mode so that no permission prompt can stop it
  2. Run the nightly job in dontAsk mode with the deploy tool added to its allowlist
  3. Make the hook return allow when the call comes from the nightly job on the release branch Right answer
  4. Move the confirmation to a PostToolUse hook that notifies the team after each deploy

Why With nobody to answer, an ask ends in a denial, and an allowlist entry leaves the hook's ask in place. Approved PRs on the release branch are the approval, so the hook can allow that case alone; bypass drops every check.

GS-012 A bank versioned a hook in the repository's .claude/settings.json that blocks any migration edit without a ticket. Compliance finds that some engineers neutralised it in their local settings and requires that no individual be able to switch this control off. Which setup meets the requirement?
  1. Protect .claude/settings.json with CODEOWNERS and a mandatory review
  2. Turn on auto mode so its classifier blocks risky migration changes
  3. Add a firm rule about migrations and tickets to the CLAUDE.md file
  4. Define the hook in managed settings with allowManagedHooksOnly Right answer

Why Managed settings, deployed by the platform team, cannot be edited by engineers, and allowManagedHooksOnly drops local hooks. CODEOWNERS protects the repository file, not local settings; the classifier judges intent, not the ticket rule.

GS-013 A company rolls out its ticket tracker connector. Only the support team spends its days creating and updating tickets; the other teams mostly want to search and read. The data-risk owner has approved write access for support only. Which configuration should be chosen?
  1. Read-only for the relevant groups, write tools allowed in the support team's role Right answer
  2. Read-write for everyone, with the write tools set to Needs approval
  3. Activation through enterprise-managed authorization for every team's IdP group
  4. Read-write for everyone, with an organization instruction about writing

Why Access depth is set per group in the role: broad read, write where the workflow needs it and the risk is accepted. Needs approval leaves write open to all, EMA handles activation, and an instruction is not a control.

GS-014 The finance team received its document store connector in its role. A month later, half the members have never connected it to their account, and the monthly close workflow fails for them. The connector's provider supports delegation through the identity provider. What should be done?
  1. Set the connector's tools to Always allow in the finance group's role
  2. Provision access through enterprise-managed authorization backed by IdP groups Right answer
  3. Announce the connector to the group with a walkthrough for connecting accounts
  4. Distribute a close skill that the Owner pushes into every member's list

Why The block is the member gate: each person must connect an account. EMA provisions it through the IdP for everyone in scope at login. Always allow governs call confirmations, an announcement guarantees nothing, and a skill grants no access.

GS-015 In a scale-up, dozens of near-duplicate skills circulate and some teams use untested workflows believing they were reviewed. Leadership wants everyone to keep experimenting and sharing with colleagues, and has a group of champions ready to review. Which posture should be adopted?
  1. Turn skill sharing off, set Publishing to Off, and use Owner provisioning
  2. Keep skill sharing and set Publishing to Open, relying on peer review
  3. Keep skill sharing on and set Publishing to Requires review Right answer
  4. Turn off cloud code execution until the skills have been sorted out

Why Open build, reviewed spread: sharing stays on, but nothing reaches the organization library without a reviewer's approval. Centralizing stifles experimentation, Open leaves the problem as is, and turning off code execution disables every skill.

GS-016 A platform team manages Claude Code through managed settings at a regulated company. An audit finds MCP servers and plugins on laptops, installed from home directories or passed as command-line flags for a single session. The team wants everything to come from its approved marketplace. Which settings should it add?
  1. allowManagedHooksOnly with deny rules on WebFetch, plus Bash(curl *) in the file
  2. sandbox.enabled with failIfUnavailable, plus a network allowedDomains list in the file
  3. disableBypassPermissionsMode with allowManagedPermissionRulesOnly, plus a Bash deny list
  4. strictKnownMarketplaces with disableSideloadFlags, plus allowManagedMcpServersOnly in the file Right answer

Why The marketplace allowlist limits what can be installed, disableSideloadFlags rejects one-run loading flags, and the managed MCP list fixes the tool surface. The other settings lock hooks, network or permissions, not where extensions come from.

GS-017 A team moves from an agent that opened pull requests under the requester's account to a shared agent that opens them under its own GitHub App. The branch requires one approving review. A tech lead notices the requester can now approve the PR they asked for. What should be configured?
  1. Require two approving reviews and dismiss stale approvals Right answer
  2. Go back to opening pull requests under the requesting person's account
  3. Remove the agent's GitHub App permission to open any pull requests
  4. Ask in the channel instructions to name the requester in every PR

Why GitHub only stops the author from approving; with the agent as author, the requester can approve. Two reviews guarantee a second person. Reverting to the requester's identity loses clean attribution, and removing the permission kills the workflow.

GS-018 A team agent acts under its own service accounts in Slack channels. The finance team wants to give it a write credential on the billing tool, attached to the public #finance-ops channel. In this workspace, any employee can join a public channel. What decision should be made?
  1. Keep the public channel and add an instruction reserving writes for finance staff
  2. Bind that credential to a private channel whose membership someone reviews Right answer
  3. Attach the credential at workspace level to keep a single point of control
  4. Use each finance member's personal connector instead of an agent account

Why The agent's connections give the same capability to everyone in the channel, so on a public channel the join policy becomes the access control. Elevated credentials belong on private channels. Workspace level widens access further.

GS-019 During an incident, the SOC sees CRM log entries under three employees' names, but cannot tell which came from them and which from the agent reusing their delegated credentials. The SOC investigates in the CRM's own audit log and wants agent actions to be separable there. Which change should be made?
  1. Have the agent add a fixed prefix in the comment field of every change
  2. Export the agent's OpenTelemetry traces to the SIEM with every tool call
  3. Give the agent a dedicated CRM service account with rights fitted to its task Right answer
  4. Require the employee whose credential is used to confirm every CRM write

Why With its own account, every agent action shows in the CRM's audit log under a distinct name, and least privilege is decided at connection. A prefix depends on the model, and SIEM traces sit outside the log the SOC investigates.

GS-020 A team agent's service accounts were created by hand by one engineer, with tokens kept in a script. He has left the company; during an incident, nobody knows which access to revoke or where. The CISO wants this never to happen again. Which measure addresses the cause?
  1. Move the tokens from the script to a secrets vault with quarterly rotation
  2. Document the agent's accounts and their owner in a wiki page
  3. Tie the agent's access to a manager's account so it follows their departure
  4. Issue and revoke the agent's identity in the IdP, like every other identity Right answer

Why An agent identity should be issued and revoked where the company already manages every other one, which makes revocation known and fast. A vault protects storage, a wiki goes stale, and tying it to a human blurs attribution.

Advanced Debugging and Incident Response 0 / 16 freed

DI-001 For three weeks, feedback on your coding agent has reported a quality drop, yet some users notice nothing and your evals stayed green. During that period the team edited the system prompt, changed a default setting and moved part of the traffic to a new server pool. Where do you start the investigation?
  1. Map each report against the timeline of the three changes and the traffic segment it hit Right answer
  2. Revert the system prompt change, the most recent one, and watch whether complaints stop
  3. Run the full eval suite on the current build and compare it with last month's baseline
  4. Raise the alert threshold on negative feedback rate to separate signal from usual noise

Why Overlapping changes hit different traffic at different times and look like random degradation, so separate them by segment and date. Reverting one blindly, or trusting evals that already missed it, does not locate the cause.

DI-002 After a rewrite of your assistant's system prompt, users find the generated code worse. Your usual eval suite, run before release, still shows no regression. About forty instructions changed at once. How do you identify the one that hurts quality?
  1. Compare about a hundred responses by hand from before and after the prompt rewrite
  2. Ablate the instructions one by one and score each variant on broader evals Right answer
  3. Roll the new prompt out gradually by traffic slice and track the user feedback
  4. Ask the model to review the prompt and flag instructions that contradict each other

Why Line-by-line ablation, scored on an eval set broader than the one that saw nothing, isolates the faulty instruction. A gradual rollout limits exposure but does not attribute the regression to a line.

DI-003 Users report that your agent forgets recent decisions and repeats itself, but the team cannot reproduce it in testing. Tickets often mention a session resumed the next day. A recent optimization clears old reasoning from idle sessions, and it passed review, tests and dogfooding. What is the next step?
  1. Show a warning that suggests users open a fresh session after a long pause
  2. Keep a longer context for every session so that no history can be dropped
  3. Replay a session left unused overnight, then inspect what each turn sends Right answer
  4. Add unit tests on the clearing function to confirm its nominal behaviour

Why The defect only shows in a corner case, resuming an idle session, which nominal tests do not exercise. Reproduce that case and look at what actually reaches the model on every turn.

DI-004 An inference configuration bug corrupted a small share of responses for days. Benchmarks, spot checks and the canary deployment were green, partly because the model often recovers from an isolated mistake. The postmortem must propose a measure that would have caught it sooner. Which one do you keep?
  1. Extend the canary deployment period before each move to the full traffic
  2. Require a second code review for every inference configuration change
  3. Double the sample of spot checks performed before each production release
  4. Run quality evaluations continuously on the live production systems too Right answer

Why Every pre-release control missed an intermittent defect. Continuous evaluations on the live system see it when it happens. A longer canary or more spot checks strengthens a net that already failed.

DI-005 Your on-call team added Claude Tag to the alert channel, with proactive replies and a rollback runbook. Security requires that no production rollback runs without a human decision, while diagnosis stays automatic. How do you set up the channel?
  1. Tell Claude a person on call must say yes in the alert thread before any rollback runs Right answer
  2. Turn off proactive replies so Claude steps in only when mentioned in a thread
  3. Remove the deploy connection and let Claude propose the fix as a pull request instead
  4. Limit Claude to low-severity alerts and keep the serious incidents for the humans

Why The standing instruction can require the on-call approval in the thread, so diagnosis stays automatic and the rollback waits for a human. Turning off proactive replies or the deploy connection gives up the automation that was asked for.

DI-006 Your on-call channel receives real pages, a steady stream of warnings and deploy notices. With proactive replies on, Claude Tag opens an investigation on nearly every post and the channel becomes unreadable. You want to keep automatic investigation of pages. What do you do?
  1. Turn off automatic replies and ask engineers to mention Claude when they need it
  2. Message Claude with the post types it should handle and those to skip Right answer
  3. Create a routine that summarizes the channel hourly instead of reacting to posts
  4. Raise the monitoring thresholds so fewer alerts reach the channel at all

Why In a noisy channel you tell Claude which posts to handle and which to ignore, so pages are still investigated. Turning off automatic replies loses the automation, and raising thresholds changes detection, not triage.

DI-007 Claude Tag investigates every page in your on-call channel well. But the last incident came from latency that crept up for two days without crossing any alert threshold, so nobody was paged. How do you get this kind of drift investigated?
  1. Lower the latency alert threshold so this drift triggers a page sooner
  2. Add a manual dashboard check to the runbook at the start of each on-call shift
  3. Schedule a routine that diffs the dashboard against the previous check Right answer
  4. Ask Claude to post a daily summary of every metric on the dashboard

Why A scheduled routine comparing the dashboard with the previous check investigates what changed and posts only then. A lower threshold multiplies pages, and a daily summary buries the drift.

DI-008 Claude Tag triages escalations in your support channel and pages the on-call lead only for a P1. It just rated P3 an escalation the team considers P2, because the customer's exports have been failing since morning for its whole finance team. Such cases will come back. What is the right response?
  1. Rewrite the channel's standing instruction with a more detailed severity grid
  2. Fix the ticket directly in the support tool, outside the channel
  3. Mention the on-call lead on every escalation so each severity gets validated
  4. Correct the severity in a thread reply and have Claude remember the rule Right answer

Why A thread reply fixes this case and channel memory carries the rule to the next ones. Rewriting the whole instruction for one case is too broad, a fix outside the channel teaches Claude nothing, and mentioning the lead everywhere defeats the P1 filter.

DI-009 You ask Claude for a first postmortem draft for a payment outage. The previous draft, produced from a plain "summarize the incident", had a loose timeline that participants disputed in review. Which instruction changes the timeline's reliability the most?
  1. Rebuild the timestamped sequence of events from the incident channel and the logs Right answer
  2. Provide the team's postmortem template so the draft follows its sections
  3. Add a past postmortem the team liked as an example of structure and tone
  4. Ask for a blameless tone describing system behaviour rather than people

Why A timestamped reconstruction ties each step to a message or log line reviewers can check, which a plain summary does not. Template, example and tone shape how the document reads, not whether its sequence of events is right.

DI-010 The postmortem draft blames the outage on one line: "an engineer pushed a bad config". In review, the team notes that missing validation and a silent alert also mattered, and the document puts the author of the change on the defensive. How do you fix the instruction given to Claude?
  1. Ask for a corrective action section that names an owner for each action item
  2. Ask for the trigger and, apart from it, each condition that let it spread Right answer
  3. Ask Claude to flag each passage of the draft it is not fully confident about
  4. Strip the names from the incident channel export before handing it to Claude

Why Asking for the trigger and, separately, the conditions that let it cause harm brings the missing validation and the silent alert into the causal chain, framed as system behaviour. Removing names hides who acted but still leaves a one-line cause.

DI-011 After a six-hour outage, customer success managers want a document they can forward to affected customers. The engineering team wants the list of suspect deploys kept for its own follow-up, out of customer view. Both should come from one request to Claude. How do you write the instruction?
  1. Produce the full engineering retro and let CSMs extract the customer part
  2. Share the war room channel read-only with the customers hit by the outage
  3. Ask for the customer version plus an internal appendix listing those deploys Right answer
  4. Write the customer document from tickets alone, leaving out technical causes

Why One request can serve both readers: the forwarded document covers what customers saw and what is being done, while an internal appendix holds the suspect deploys. Letting CSMs trim the retro moves the work to them, and dropping causes loses the list engineering wants.

DI-012 For an incident review, Claude pulls tickets and deploys from the whole month. The draft lists some thirty "possibly related" deploys and the team spends the meeting ruling them out one by one. What do you add to the instruction?
  1. Ask Claude to rank the deploys by how likely each one is to be the cause
  2. Provide a past review as an example so Claude reuses its structure
  3. Keep only the deploys that a second human reviewer has approved
  4. Restrict the sources to the period around the outage's timestamps Right answer

Why Bounding sources to the period around the incident keeps the suspect list short enough to review. A likelihood ranking still puts thirty candidates in front of the team, and an example only shapes the layout.

DI-013 Your agent exposes two tools, search_orders and search_invoices, whose descriptions both say "searches customer documents". Claude calls search_orders when the user asks for an invoice. Schemas are valid and names are unique. Which fix do you aim at first?
  1. Rewrite each description to state which user situations should trigger that tool Right answer
  2. Enable strict: true on both tools to constrain the generated parameters
  3. Merge the two tools into a single tool that takes a document type parameter
  4. Force tool_choice to search_invoices whenever the message mentions invoices

Why Picking the wrong tool comes from ambiguous descriptions, so differentiate tools by when to use them. strict: true constrains parameters, not tool choice, and forcing tool_choice works around the symptom.

DI-014 Your service logs show Claude sometimes calls create_ticket with a priority_level field that does not exist in the schema, which fails validation. The schema stays within the subset supported by strict mode. Which fix do you choose?
  1. Drop unknown fields on the server side and process the rest of the call
  2. Add strict: true to the create_ticket tool definition in requests Right answer
  3. Add priority_level to the schema so whatever the model sends passes
  4. List the allowed fields for this tool explicitly in the system prompt

Why An invented parameter comes from over-generation without strict mode, and strict: true fixes the cause when the schema is supported. Dropping fields server-side hides the symptom and loses the model's intent.

DI-015 After moving your agent to a newer model, a guardrail starts blocking legitimate calls to a file tool. It compares the raw serialized tool input against an allowlist of exact strings, and the logs show paths whose slashes are now escaped differently. The decoded values are unchanged. What do you change?
  1. Pin the previous model version until the allowlist strings are regenerated
  2. Tell the model in the system prompt to leave slashes unescaped in tool inputs
  3. Parse the JSON and compare the resulting values with the permitted entries Right answer
  4. Normalize the escaped sequences with a regex before the string comparison

Why Escaping of unicode and forward slashes in serialized tool inputs differs between model versions, so comparing parsed values is the durable fix. Pinning only delays it, a prompt does not control serialization, and a regex patch breaks on the next escaping difference.

DI-016 Your fetch_report tool returns the report data followed by the instruction "Summarize this report in three points for the manager". Claude hesitates, sometimes asks the user to confirm those instructions, or declines to follow them. The report content is trusted. How do you fix it?
  1. Mark the tool as a trusted source in its description to remove the doubt
  2. Reword the instruction in the tool_result in a more explicit, directive tone
  3. State in the system prompt that fetch_report results may be followed
  4. Keep the report data there and move the summary request to a user turn Right answer

Why Claude is trained to treat instructions inside a tool_result as potentially untrusted third-party content. Move the instruction out of the result into a user turn. Declaring the tool trusted would weaken the injection defence.

Agent Fleet Operations for Software Delivery 0 / 24 freed

FO-001 An engineer plans three tasks for the afternoon: a billing fix and a pricing refactor that both rewrite the same tariff module, plus an unrelated CLI flag. The plan shows the first two cannot be separated cleanly. She wants to finish everything with the least merge pain. How should she organize the sessions?
  1. Chain the two tariff tasks in one session; give the CLI flag its own worktree Right answer
  2. Start three sessions, each in its own worktree, and resolve the tariff conflicts at merge time
  3. Run the three tasks as subagents of one session so they share a single context window
  4. Enable an agent team so a lead assigns the three tasks and keeps the workers in sync

Why Worktrees isolate files, so they only help for independent work; tasks that touch the same files belong in one session, one after another. Separate worktrees just postpone the collision to the merge, and agent teams do not isolate files at all.

FO-002 A platform team must check 600 service files for a deprecated logging call, and leadership wants each reported hit confirmed by a second, independent pass before anyone files tickets. A first attempt with a lead agent delegating a few subagents per turn ran out of context halfway and skipped the confirmation step on some files. What should they use?
  1. A larger context budget for the lead agent so it can hold every subagent result
  2. A dynamic workflow script that fans out the checks and routes each hit to a verifier Right answer
  3. A CLAUDE.md rule telling the lead agent to confirm each hit before reporting it
  4. Several parallel sessions in separate worktrees, each assigned one slice of the service files

Why A workflow moves the plan into code: results stay in script variables instead of the lead's context, and the verification pass is enforced by structure. A CLAUDE.md rule is an instruction that can still be skipped, which is exactly what failed.

FO-003 A senior engineer went from two to six concurrent Claude Code sessions, each in its own worktree. Merged changes per week rose, but the PR history shows the rework rate climbing and her reviews getting shallower. Sessions rarely wait on permission prompts. What is the right adjustment?
  1. Add a verifier subagent to each session so it checks the app before reporting done
  2. Pre-approve more commands in permission settings so the sessions finish their work faster
  3. Cut back to as many sessions as she can review well, then grow with review Right answer
  4. Move the six sessions into an agent team so a lead consolidates their output for her

Why Parallel sessions top out at the number one person can review properly; rising rework with shallower reviews says she passed it. A verifier helps each session, but it does not restore the human review that has slipped.

FO-004 During a long feature session, Claude keeps grepping across a large monorepo to locate call sites. Each search dumps hundreds of lines of matches into the conversation, which the engineer will never look at again, and the session starts losing track of earlier decisions. The exploration itself is needed. What change fits best?
  1. Open a second session in another worktree that does the searching in parallel with this one
  2. Run /compact after each search so the matches are folded into a summary
  3. Write a dynamic workflow that scans the monorepo and returns the call sites
  4. Delegate the searches to a researcher subagent that reports back a short summary Right answer

Why A subagent works in its own context and returns only a summary, which is the case for side tasks that would flood the main conversation. A second session cannot feed results back into this one, and a workflow is built for far larger fan-out.

FO-005 A team exposes deployment to Claude through one MCP server whose release tool takes an environment argument. Their CI job should let Claude release freely to staging but never to production, using the tool allowlist. In testing, they cannot write a rule that permits staging releases while refusing production ones. What should they change?
  1. Split deployment into one MCP server per environment and give the job one environment's token Right answer
  2. Add a system prompt instruction telling Claude to pass the staging value to the release tool
  3. Run the CI job in bypass permissions mode and review the release log after each run
  4. Keep the single server and ask Claude for a staging confirmation in the pipeline output

Why An MCP allow rule matches a server and a tool but never their arguments, so one server cannot be split by environment. Separate servers make the allowlist meaningful, and holding a single token means the other servers refuse the job anyway.

FO-006 An organization turned on the managed Code Review service and likes its ranked findings. Reviewers now want to tag Claude on a review comment and have it apply the requested change and push the fix to the branch, with the thread recording both. Some reviewers say Code Review should simply be configured to do it. What is the right setup?
  1. Set Code Review to run on every push so new findings appear after each manual fix
  2. Keep Code Review for findings and add claude-code-action for comment-driven fixes Right answer
  3. Replace Code Review with a REVIEW.md policy so Claude learns which comments it should fix
  4. Ask authors to run /code-review with its fix flag locally before they push changes

Why The managed service posts findings and never pushes fixes; mentioning it requests a fresh review. The fix loop on review comments runs through the GitHub Action. A local /code-review fix helps authors, but it is not driven from the PR thread.

FO-007 A nightly job runs Claude with -p in dontAsk mode against a database MCP server exposing read_schema, plan_migration and apply_migration. A production migration needs a DBA sign-off recorded in the change system, which a PreToolUse hook checks. If that hook crashes or times out, nothing may be applied. How should the tools be configured?
  1. Allowlist all three tools and have the hook deny apply_migration without a sign-off
  2. Allowlist read_schema and plan_migration, and send the plan to the DBA from a Stop hook
  3. Allowlist read_schema and plan_migration, so the hook's allow is the sole path to apply Right answer
  4. Allowlist all three tools and pass the DBA's sign-off ticket number in the prompt

Why In dontAsk, a tool off the allowlist is refused unless a PreToolUse hook allows it, so a crashed hook means no migration: it fails closed. Allowlisting apply_migration and counting on the hook to deny fails open whenever the hook does not run.

FO-008 A repository's automated review keeps flagging the same mistake in agent-written PRs: date handling that ignores the team's UTC convention. It has now come up a second time, from two different engineers' sessions. The tech lead wants the next PRs to avoid it without adding a reviewer. Where should the correction go?
  1. Into REVIEW.md, raising the date finding from a nit to an important severity
  2. Into a branch protection rule that blocks merges when the review reports findings
  3. Into the system prompt of each engineer's local Claude Code configuration
  4. Into CLAUDE.md, committed as part of this review so sessions and review read it Right answer

Why A mistake flagged twice goes into CLAUDE.md during the review; sessions write with it and review reads it, so it is caught from the next PR. Raising its severity in REVIEW.md still catches it late, after the code is written.

FO-009 An engineer left Claude refactoring a payment adapter overnight with nobody watching. In the morning the session's closing summary is precise, lists the planned files, and reports green tests. He has an hour before standup and wants to know whether the work can ship. Where should his verification start?
  1. Run /code-review and read git diff for files changed outside the plan Right answer
  2. Compare the summary against plan.md to confirm each planned step was reported
  3. Rerun the full test suite and ship the change if every test is still green
  4. Ask the same session to explain its riskiest changes and justify each of them

Why A tidy summary can hide a change to a file nobody expected; only the diff shows it. Rerunning tests matters, but it does not reveal out-of-plan edits, and the same session tends to defend the path it already took.

FO-010 A team's CLAUDE.md tells Claude to run the test suite before it calls a task done. Reviewing a month of unattended sessions, they find several that reported success without a test run in the transcript, and two of those broke the build. They want the test gate to hold on each run, without a human watching. What should they add?
  1. A stronger CLAUDE.md wording that puts the test instruction first and in capitals
  2. A Stop hook that runs the tests and exits with code 2 on failure, blocking the turn Right answer
  3. A verifier subagent definition that the main session can call before it finishes
  4. A nightly CI job that reruns the tests on each branch and opens issues for failures

Why An instruction or an optional subagent can be skipped, which is what happened. A Stop hook fires on each run, and exit code 2 sends the failure back to Claude, which then fixes it. A nightly job only finds the breakage later.

FO-011 A team lets Claude fix reported bugs unattended. A postmortem shows one fix passed CI because the agent had loosened an assertion in the existing test, and the bug reappeared in production. The team wants proof, from the toolchain, that each future fix really removes the reported defect. What process should they adopt?
  1. Require a cold second review of each fix by a fresh subagent with no build context
  2. Raise the required coverage threshold so that a weakened assertion would fail the CI coverage gate
  3. Commit a reproducing test that fails first, then fix with a hook blocking test-file edits Right answer
  4. Add a PostToolUse hook running the linter and type checker on every file the agent changes

Why A test seen failing for the expected reason, committed before the fix and protected from edits, proves the bug is gone. A cold review might notice the loosened assertion, but it is judgment, not evidence from the toolchain.

FO-012 An unattended run in auto mode reworked a caching layer. Tests pass under the hooks and the engineer has read the diff, which stays inside the plan. Because the change touches cache invalidation for customer balances, he wants one more check aimed at a flawed premise the original session may have accepted without noticing. What should he do?
  1. Resume the original session and ask it to list the assumptions it relied on
  2. Rely on the auto mode classifier, which reviewed the run's actions for danger
  3. Ask the original session to write additional tests for the invalidation paths
  4. Have a fresh subagent with no build history review the changed code Right answer

Why A reviewer that never saw how the change was built judges only the code, so it can catch a premise the author accepted. The original session reuses its own assumptions, and the classifier screens actions for danger, not correctness.

FO-013 An engineer is two hours into a terminal session migrating data scripts. The task calls a user-scope MCP server for an internal catalog and needs his AWS SSO sign-in. He has to leave for the afternoon but will keep his workstation on and wants to keep steering from his phone. What should he do?
  1. Run /remote-control in the current session and keep steering it from the mobile app Right answer
  2. Push the branch and restart the work with claude --cloud from the same directory
  3. Turn the remaining steps into a cloud scheduled task that runs on the repository
  4. Restart the job with claude -p in a CI runner that holds the AWS credentials

Why Remote Control keeps the session on his machine, with its MCP servers and sign-ins, and lets him steer from a phone. A cloud session starts from a fresh clone and carries neither user-scope MCP servers nor interactive sign-ins such as AWS SSO.

FO-014 A developer wants Claude to spend several hours upgrading a test framework across a repository hosted on GitHub. Everything the task needs is in the repo, with no local services or sign-ins involved. She is about to board a flight and her laptop will be closed. She has local commits not yet pushed. What should she do?
  1. Start the work locally and run /remote-control so she can follow it from her phone
  2. Push her local commits, then start a cloud session with claude --cloud for the task Right answer
  3. Start a cloud session right away, since it uploads her working tree and local commits
  4. Create a cloud scheduled task with an hourly trigger that resumes the upgrade each time

Why With the laptop closed, a Remote Control session goes offline, while a cloud session keeps running. The cloud VM clones the GitHub remote, so unpushed commits do not carry over: push first, then launch.

FO-015 An SRE team wants Claude to check a queue's backlog every hour and write a structured JSON verdict that their alerting script ingests. The queue's broker is reachable only from their private network, where they already run cron jobs on their own runners. A colleague proposes a cloud scheduled task so nothing has to be hosted. Which approach fits?
  1. A cloud scheduled task on a cron trigger that writes its verdict to the repository
  2. A Slack routine in the on-call channel that posts the verdict on each check
  3. Headless claude -p from their cron, with a JSON schema and the JSON output format Right answer
  4. A loop in an interactive session that polls the queue on a fixed hourly interval

Why A cloud scheduled task runs on Anthropic's infrastructure from a fresh clone, so it cannot reach a broker exposed only on their network. Headless -p runs from their own cron, and --json-schema puts the verdict in structured_output. A loop needs a session left open.

FO-016 A CI job runs claude -p to draft changelogs on a pool of shared runners. Output varies from runner to runner, and the team traces it to hooks, plugins and MCP servers that differ in each runner's local configuration. They want every machine to start Claude from the same setup. What should they change?
  1. Move the changelog job to a cloud scheduled task triggered by each new release tag
  2. Rewrite the job with the Agent SDK so the pipeline controls the session from code
  3. Pin the runners' Claude Code version and clean their user configuration each night
  4. Add --bare and pass the required settings and MCP config explicitly with flags Right answer

Why By default -p loads the same hooks, plugins, MCP servers and CLAUDE.md as an interactive session. --bare skips that discovery, so each runner starts identical with only what the flags pass. Nightly cleanup leaves drift possible between cleanups.

FO-017 Five teams copy a mobile squad's .claude directory, with its skills, review subagent and formatting hooks, between laptops. Copies have drifted: some engineers run last quarter's hooks and nobody knows which version anyone has. The platform lead wants one install, version tracking and central updates. What should she set up?
  1. Package the directory as a versioned plugin and publish it through a private marketplace Right answer
  2. Move the directory into a shared repository that each engineer clones and pulls weekly
  3. Paste the skills' content into each project's CLAUDE.md so they ship with the code
  4. Convert the hooks into managed settings and send the skills to engineers by email

Why A plugin bundles skills, subagents and hooks into one versioned install, and a private marketplace lets teams find it, see which version they run and receive updates centrally. A shared repository still relies on each person pulling, which is how drift began.

FO-018 An engineer finds a community plugin on a listed marketplace whose Terraform skills would save her team hours. The team already runs its own PreToolUse hook that blocks writes to production state files. She wants to adopt the skills without surprises in how Claude Code behaves. What should she do first?
  1. Install it, since a listed marketplace plugin has been submitted to Anthropic
  2. Read its details: hooks, agents, MCP servers and settings, which run with her privileges Right answer
  3. Install it and trust her PreToolUse hook to override the plugin's own hooks
  4. Install it in one repository and watch the session logs for a week before rolling it out wider

Why A plugin brings all its components: its hooks stack with hers rather than being replaced, and its agent setting can change the main thread's behaviour. Being listed is not being trusted, so read what it installs before turning it on.

FO-019 A bank's security office has written a rule that customer account numbers never appear in log statements. The platform team shipped it as a skill that loads whenever endpoint code is edited, and violations dropped sharply. Compliance now asks for the rule to hold without exception, including for files rewritten by shell commands. What should the team add?
  1. A stricter skill description so it loads on a wider range of editing tasks
  2. An organization instruction restating the rule so each conversation carries it
  3. An edit hook that runs the policy check, plus the same script as a required PR check Right answer
  4. A REVIEW.md pass that asks the code reviewer to flag account numbers in logs

Why A skill is advisory; a policy that must hold needs a deterministic check behind it. An Edit or Write hook misses shell rewrites, so the script also gates every PR. A review pass reports findings but does not block.

FO-020 Three months after a team shipped a skill encoding its API pagination convention, PR review findings citing that convention have barely moved. The skill sits in .claude/skills/ in the repo, and engineers confirm they are on the latest version. What should the skill owner investigate?
  1. Whether engineers should receive the skill through a plugin in place of the repository folder
  2. Whether the review pass should drop the convention, now that the skill applies it
  3. Whether a hook should block edits to API files until a reviewer approves each one
  4. Whether the skill triggers on varied phrasings of the task, and its text matches policy Right answer

Why When findings citing a policy do not fall, either the skill never fires or its wording no longer matches the policy. Changing the distribution channel fixes neither, and an approval hook in the build blocks parallel sessions on a person.

FO-021 Four hours into a session, Claude spent the first half comparing three CSV parsing libraries before settling on one, and is now midway through an import pipeline built on it. The context window is nearly full, and the engineer fears an automatic summary will keep the library comparison and lose the pipeline's design decisions. What should he do?
  1. Run /compact, asking it to keep the pipeline design and the chosen library Right answer
  2. Rewind to the checkpoint after the library choice and restore code and conversation
  3. Start a fresh session and paste the pipeline's current diff as its opening prompt
  4. Open the rewind menu at the latest prompt and summarize from that point onward

Why Text after /compact steers what the summary keeps, so the pipeline decisions survive and the comparison can go. Restoring the checkpoint would undo the pipeline code, a fresh session loses the reasoning, and summarizing after the latest prompt frees almost nothing.

FO-022 Over the last two prompts Claude rewrote the retry logic of a webhook client in a direction the engineer rejects. The discussion in those turns was useful, though: it surfaced why the vendor's rate limit headers cannot be trusted, which the next attempt must account for. What should he do?
  1. Rewind two prompts back and restore both the code and the conversation together
  2. Rewind two prompts back and restore code, keeping the conversation as it stands Right answer
  3. Prompt Claude to revert its retry changes by hand and then try a new approach
  4. Run /compact with instructions to keep the header finding and drop the retry code

Why Restoring code alone rolls the files back to the checkpoint while the conversation keeps the header finding. Restoring both would lose that finding, and asking Claude to undo by hand is prompting your way out where a checkpoint already exists.

FO-023 An engineer wants Claude to keep porting a module's functions to a new SDK across many turns without her prompting each step. She can describe done better than the steps: the module's test suite passes and no import of the old SDK remains. She sets a goal. How should she phrase its condition?
  1. The CI dashboard shows the module's pipeline green on the main branch after merge
  2. Claude states that the port is complete and lists the functions it has migrated
  3. Claude shows the test run passing and a grep finding no old SDK import, in its output Right answer
  4. The reviewer confirms in the PR that the old SDK no longer appears in the module

Why The goal's evaluator reads only the transcript, so the condition must be provable from output Claude produces, such as a test run and a grep. A dashboard or a reviewer is outside the transcript, and a bare claim of completion proves nothing.

FO-024 A team is about to have Claude replace a homegrown feature flag library across about forty files. Last time a similar change ran for hours, and the engineer spent most of it correcting course after Claude missed two call patterns. This time she wants fewer mid-run corrections. What should she do before any file is edited?
  1. Start a loop that polls the build and asks Claude to repair each new failure
  2. Set a goal that the build passes so Claude keeps fixing until it reaches green
  3. Split the forty files across parallel sessions so each one stays short and easy to review
  4. Use plan mode, read the plan closely, and have Claude add the call patterns it missed Right answer

Why Plan mode researches without editing, and a carefully read plan catches missing cases before execution, where iterating is cheapest. A goal or a loop drives the run but still discovers the gaps midway, and splitting files does not find them.

Cost and Latency Optimization at Scale 0 / 28 freed

CL-001 An audit agent queries an inventory tool for 60 warehouses, one call per warehouse, and each result weighs several thousand tokens. The calls are independent and Claude only needs the list of sites that are out of stock. Logs show input tokens growing with every request. Which change cuts the bill the most?
  1. Turn on programmatic tool calling so a script runs the 60 lookups and prints the shortages Right answer
  2. Put cache_control on the last tool so the definitions are billed at the cache read rate
  3. Move the agent to a smaller model while keeping the same loop and the same inventory tools
  4. Send the 60 inventory requests through the Message Batches API to get the batch discount

Why The cost comes from tool results resent on every turn. With programmatic tool calling they stay in the container and Claude reads only the script's printout. Caching only trims the definitions, a small share here.

CL-002 A team adds cache_control on the last of its three tools, whose definitions total about 400 tokens, with no system prompt. No error comes back, yet the bill does not move and usage shows zero for both cache_creation_input_tokens and cache_read_input_tokens. What is the most likely explanation?
  1. The five-minute cache expires because the requests arrive too far apart
  2. The marked prefix is below the model's minimum cacheable length Right answer
  3. cache_control is ignored on tool definitions and must sit on the system prompt
  4. Cache writes cost more than normal input and cancel out the read savings

Why Below the model's minimum length the request runs uncached with no error, so both counters stay at zero. An expired cache would still show writes in cache_creation_input_tokens.

CL-003 After prompt caching is turned on, an internal dashboard that sums usage.input_tokens reports an 85% drop in input volume. The monthly bill falls much less. The FinOps lead wants a reliable figure before presenting the savings. What should be fixed in the measurement?
  1. Compare cost per completed task across the two periods instead of cost per token
  2. Measure time to first token, which better reflects the real effect of the cache
  3. Add the cache read and write counters to the input count, each at its rate Right answer
  4. Replay one traffic sample with and without caching and compare the two

Why Once caching is on, input_tokens no longer counts the prefix read from or written to the cache. True volume adds cache_read_input_tokens and cache_creation_input_tokens, each at its own rate. A replay read through the same counter would repeat the error.

CL-004 A network diagnosis agent sends 25 tool definitions, about 5,000 tokens, on every request, and a typical diagnosis ends up calling nearly all of them. Each call depends on reasoning over the previous result, and turns follow a few seconds apart while an engineer waits for the answer. Which lever should come first to cut the cost?
  1. Switch to programmatic tool calling so results stay inside the execution container
  2. Run the diagnosis sessions through the Message Batches API for the batch discount
  3. Mark the tools defer_loading and add tool search so fewer definitions are sent
  4. Put cache_control on the last tool so the whole list is reread at the cache rate Right answer

Why The same definitions are resent seconds apart, so caching bills them at the read rate for one line of code. Tool search saves little when nearly every tool gets loaded, chained calls blunt programmatic tool calling, and batch cannot serve a waiting engineer.

CL-005 A team notices that a booking assistant fails whenever Claude asks for the weather, the price and a hotel's availability at once: the API rejects the next request. The loop reads resp.content[0], runs that tool and returns its result. Which fix should be applied?
  1. Collect each tool_use block in the response and return a tool_result for each one of them Right answer
  2. Set disable_parallel_tool_use in tool_choice to limit Claude to one call per response
  3. Merge the three tools into one booking tool that returns the whole set of information
  4. Add a system prompt rule asking for a single tool call per turn of the conversation

Why Claude asks for parallel calls by default and each tool_use expects its own tool_result. Disabling parallelism hides the loop bug and lengthens the wait, since three independent lookups would then run one after another.

CL-006 A support agent correctly runs multiple tool_use blocks in threads, yet Claude almost never asks for more than one per response, even for independent lookups. The loop appends each tool_result in its own user message, one after another. What should change first?
  1. Add a system prompt rule encouraging Claude to parallelize independent lookups
  2. Send the tool_result blocks of one response back in a single user message Right answer
  3. Enlarge the thread pool so the concurrent calls finish faster on the client
  4. Move to a more capable model, more inclined to plan several lookups at once

Why Results sent in separate messages make the history read as if Claude called one tool at a time, and it follows that pattern. A prompt rule treats the symptom while the history keeps teaching the opposite.

CL-007 An agent runs four lookups against internal services in parallel. When one of them answers with a 503, the exception propagates, the loop stops and the three valid results are lost. The team wants the agent to carry on with what it has. Which approach fits?
  1. Retry the failing service with exponential backoff until it answers correctly
  2. Run the lookups one after another so a service failure stays confined to its call
  3. Return the failure as a tool_result with is_error true and a hint for Claude Right answer
  4. Drop the failed result and send Claude the three results that came back

Why An error tool_result keeps the three valid answers and lets Claude choose the next step. Dropping the result leaves a tool_use unanswered, which the API rejects; retrying until success blocks the user on a service that is down.

CL-008 In one response, Claude asks for three tools: read a customer's balance, read their order history, then create a credit note whose amount depends on the balance. The team wants to cut perceived latency without risking an inconsistent write. How should the loop run these calls?
  1. Run the three calls at once in a thread pool to add up the time savings
  2. Run the three calls one after another, in response order, to stay consistent
  3. Run the two reads, then reject the write and ask Claude to request it again alone
  4. Run the two reads concurrently, then the write once the balance is checked Right answer

Why Independent reads can overlap safely; the write changes data and depends on a result, so it goes after them. Serializing everything stays consistent but gives up the overlap on the two reads.

CL-009 A legal assistant puts the exact date and time of the request at the top of its system prompt, followed by 12,000 tokens of stable instructions and a cache breakpoint. The cache read rate stays near zero despite steady traffic. Which fix should be applied?
  1. Move the timestamp to the end of the latest user message, after the cached content Right answer
  2. Switch to the one-hour cache lifetime so entries survive between requests
  3. Add a second breakpoint right after the timestamp to cache that segment apart
  4. Turn on automatic caching so the API places the breakpoint for the team

Why Caching is a prefix match: a timestamp at the top changes the first segment on every request and invalidates everything after it. A longer TTL or another breakpoint placement cannot make that prefix identical.

CL-010 A coding agent has a read-only review mode. To enter it, the harness removes the write tools from the request, then adds them back when returning to normal mode. Each switch drops the cache rate on long conversations. How can the restriction stay without breaking the cache?
  1. Cache two variants of the prefix, one per mode, each with its own breakpoints
  2. Keep one tool list and signal the mode with a dedicated tool and a message Right answer
  3. Move review mode into a subagent that starts with its own reduced tool list
  4. Turn on the one-hour TTL so the first prefix survives the repeated mode switches

Why Tools open the prefix, so adding or removing one invalidates the cache for the whole conversation. A fixed list with the mode carried by a tool and a message keeps the prefix intact. A subagent starts cold and loses the history.

CL-011 An in-house harness summarizes a 150,000-token conversation by calling Claude with a short summary-only system prompt and no tools, passing the history as a message. Each summary is billed almost entirely at the uncached rate. How can this step be made cache-friendly?
  1. Summarize with a smaller model, since a summary step needs little deep reasoning
  2. Put a cache breakpoint on the history passed to the dedicated summary request
  3. Send the parent's exact prefix and append the summary instruction as a user turn Right answer
  4. Summarize more often in small slices so each summary call stays small

Why A different system prompt and no tools make the prefix diverge at the first token. Reusing the parent's exact prefix and appending the instruction as a new user message bills only that instruction. A smaller model has its own, empty cache.

CL-012 To save money, a team routes easy questions to a cheaper model in the middle of analysis sessions that are already 100,000 tokens long. Cost per session goes up instead of down. The team wants to keep using a cheaper model for some tasks. What should it do?
  1. Start the cheaper model at the beginning of the session so it builds its own cache
  2. Add another breakpoint so both models read the same cached prefix entry
  3. Turn on server-side compaction to shrink the history the cheaper model reads
  4. Keep the session's model and give those tasks to a subagent with a handoff Right answer

Why Caches are specific to each model, so switching mid-session rereads the whole history uncached. A subagent gets a short handoff while the main model's cache stays warm. Sharing a prefix across models is not possible.

CL-013 Every night, a platform classifies about 200,000 customer reviews with one independent request per review; results feed a report read the next morning. The current synchronous job hits rate limits and costs a lot. No step needs a tool loop. Which approach fits?
  1. Submit the requests to the Message Batches API and collect the results in the morning Right answer
  2. Parallelize the synchronous job further with retries and backoff on the errors
  3. Cache the shared classification instructions to lower the cost of each request
  4. Group several reviews per synchronous request to cut the total number of calls sent

Why A large volume of independent requests with no need for an immediate answer is the textbook batch case: half price and higher throughput, most batches finishing within an hour. Caching alone leaves the synchronous job facing rate limits.

CL-014 A team sends a batch of 5,000 contract reviews that share a 20,000-token guide marked with cache_control. Results come back, but cache_read_input_tokens stays low on most requests, and the batch takes over half an hour to process. Which setting improves the cache rate?
  1. Pre-warm the cache with a max_tokens zero request placed at the head of the batch
  2. Switch the cached guide to a one-hour TTL instead of five minutes Right answer
  3. Warm the cache with one synchronous request on the guide before submitting
  4. Turn on automatic caching at the top level of every request in the batch

Why A batch runs past five minutes and processes requests in any order, so a five-minute entry expires between them, even one warmed beforehand, and automatic caching keeps that default. The batch docs advise the one-hour TTL; max_tokens zero is rejected inside a batch.

CL-015 A batch of 40,000 requests ends with 39,200 successes, 500 errored requests caused by invalid inputs and 300 expired. The current script resubmits the whole batch whenever a result is missing, then maps answers to documents by their position in the results file. What should be fixed?
  1. Lengthen the script's wait so the batch has time to finish its remaining requests
  2. Cancel the batch at the first error to avoid paying for failing requests
  3. Match results by custom_id and resubmit only the expired or fixed requests Right answer
  4. Send the failed documents through the synchronous API with the same position logic

Why Results can come back in any order, so custom_id, not position, ties each one to its request. Resubmitting the whole batch pays again for 39,200 successes, while errored and expired requests are not billed and can be retried on their own.

CL-016 An investigation agent chains about ten calls per case to the team's own internal services, each run by the client, and an analyst often waits for the result within the hour. To cut the bill, a colleague proposes running the whole loop through the Message Batches API. Which position should be defended in the design review?
  1. Accept batch for the whole loop and warn analysts of a delay of a few hours
  2. Accept batch for the whole loop with a one-hour cache TTL on the stable prefix
  3. Reject batch and cut cost by moving the agent to a cheaper model at equal effort
  4. Reject batch for the loop, keep it synchronous with caching, batch one-shot jobs Right answer

Why Each batched request returns one response, and these client-run tools need a round trip per call, so the loop would need ten successive batches, each able to take up to 24 hours. Work an analyst waits on stays synchronous with caching.

CL-017 On a Claude Enterprise rollout, the support team hits its cap and asks for an increase. The review shows a steady workload, but members drafting routine replies at the highest effort level, which is their role's default. Which decision should be made?
  1. Set a moderate default effort for that role and an effort ceiling for simple work Right answer
  2. Raise the support team's cap to cover the steady workload shown in the review
  3. Add an organization instruction asking members to keep their exchanges short
  4. Move the support group's spend review to a weekly cadence to follow the trend

Why The requested increase is a symptom: the default runs simple work at the most expensive level. Changing the default and capping effort acts at the source; an organization instruction is only soft steering.

CL-018 The finance department of a company on Claude Enterprise wants to charge consumption back to each department every month, straight into its accounting tool and with no manual handling. An engineer has to wire the integration. Which data source should be used?
  1. The Spend Limits API, which exposes the spend caps defined for each member
  2. The Analytics API, which serves usage and cost by group to finance tools Right answer
  3. The analytics dashboard, whose Groups view shows each team's spend trends
  4. Analytics chat, which answers plain-language questions on the largest spenders

Why A monthly chargeback fed straight into accounting needs the usage and cost figures through an API, which the Analytics API serves by group. The Spend Limits API sets caps rather than reading consumption, and the dashboard and chat are for people.

CL-019 For the third month in a row, the data team asks to raise its cap. The review shows a model and effort already suited to the work, real and useful tasks, and members blocked mid-month. The rest of the organization is far below its caps. What should be done?
  1. Lower the data role's default model so usage fits under the current cap
  2. Refuse the increase and remind members to limit long-running agentic tasks
  3. Re-base that cap upward to the need observed across the last three months Right answer
  4. Add an organization instruction reserving the highest effort for complex work

Why A repeated request can mean usage to fix or a cap set wrong. Here the settings already fit and the cap blocks real work, so the cap is what gets re-based, without downgrading the model.

CL-020 On the dashboard, a marketing group's consumption climbs every night, at hours when nobody works. Members created scheduled tasks in Cowork during a campaign that ended weeks ago. The default model is already mid-range. Which action targets the cause?
  1. Lower the marketing group's cap so the overnight consumption stops earlier
  2. Add an organization instruction asking members for short answers by default
  3. Cap the marketing role's effort to cut the cost of each scheduled execution
  4. Have members audit their scheduled Cowork jobs and remove the campaign ones Right answer

Why Jobs on a schedule run whether or not anyone looks at them, so the campaign ones are pure waste. Removing them stops the spend at its origin; a lower cap or effort only makes work that should not exist cheaper.

CL-021 A team is launching a high-volume field extraction feature for delivery notes. It is torn between three model tiers and has no quality measurement yet on its own documents. Cost per document matters a lot. How should the model be chosen?
  1. Build an eval on a few dozen of the team's real documents and climb from the smallest tier Right answer
  2. Start from the most capable model to set a quality baseline, then step down
  3. Pick the cheapest model per token and turn on extended thinking for reliability
  4. Compare models on a public extraction benchmark and keep the best value one

Why Only an eval on the team's own documents shows which tier is good enough, and climbing from the smallest stops at the cheapest one that passes. A public benchmark measures other documents; extended thinking adds cost without helping simple extraction.

CL-022 In Claude Code, a developer gives a schema migration across several services to a mid-range model at the default effort. The model knows the codebase well, but it stops halfway and hands back unfinished work on every attempt. Which setting should change first?
  1. Switch to the most capable model and keep the default effort for the session
  2. Raise effort one level, rerun, and check whether the work now gets finished Right answer
  3. Set effort to max for the session so no more attempts are wasted on retries
  4. Split the migration into smaller prompts sent one at a time at the same effort

Why Stopping early while the model knows the work signals effort set too low, not missing capability. Go up one level and rerun; jumping to max risks overspending and overthinking.

CL-023 A team pushed a small model all the way to max effort on a security review without reaching the expected quality. It moves up to the next model tier and has to pick the starting effort for its first runs. Which setting should it pick?
  1. Keep max effort, since the task proved hard on the previous model
  2. Start from the lowest effort and move up one level per run until it works
  3. Restart at the new model's default effort, then adjust one level per run Right answer
  4. Pick an effort halfway between default and max to limit the number of runs

Why Effort levels share names across models but not the work behind them, and each model's default is calibrated for it. A stronger model may reach the bar below max, so starting there again would overspend.

CL-024 A platform fixes bug tickets automatically, and each fix is validated by a reliable test suite. Today everything runs at high effort. Most tickets are simple, a minority are hard, and they cannot be told apart in advance. Which effort policy should be adopted?
  1. Keep high effort for every ticket, since a failed fix costs a retry plus its tokens
  2. Add a more capable advisor model that the agent consults on hard decisions
  3. Classify tickets with a small model and set effort by estimated difficulty
  4. Run tickets at low effort, then rerun those whose tests fail at a higher effort Right answer

Why The test suite already says which fixes failed, so running low and rerunning only failures higher kept the all-high pass rate at clearly lower cost in Anthropic's measurements. An advisor helps a weaker model stuck on decisions; classification guesses what tests measure.

CL-025 A field maintenance agent loads a full 2,000-page equipment manual into its system prompt, while each job only needs a few procedures from it. Jobs arrive hours apart, and long sessions approach the context window limit. Which change addresses both the cost and the window problem?
  1. Remove the manual from the prompt and expose a tool that returns the procedure needed Right answer
  2. Cache the manual with a breakpoint placed right after the system prompt block
  3. Turn on server-side compaction to summarize the older turns of each session
  4. Store the manual in the memory tool so it is read back at each session start

Why Loading procedures on demand puts only what each job needs in context, which helps both cost and the window. The cache would expire between jobs hours apart and frees no room; compaction summarizes turns while the manual stays.

CL-026 A scheduling assistant must remember each user's preferences and past decisions from one week to the next, while each conversation starts fresh. The team wants to keep control of storage, encrypted in its own database. Which mechanism should it choose?
  1. Server-side compaction, which summarizes the conversation as it nears the window limit
  2. The memory tool, with storage the team implements in its encrypted database Right answer
  3. Prompt caching of a prefix that holds the full history of earlier conversations
  4. Past conversation transcripts injected in full into the system prompt of each new one

Why The memory tool has Claude read and write a memory directory on storage the team provides, so it persists across sessions. Compaction only extends one conversation, caching holds no durable state, and reinjected transcripts grow every request.

CL-027 A refactoring agent works for hours on a single task and its requests end up failing once the context window is full. The task must continue in the same conversation, and the team does not want to track the history length itself. Which approach fits?
  1. Wire the memory tool so the agent writes its progress into a dedicated directory
  2. Cache the conversation prefix to reduce the size that is reread on each turn
  3. Turn on server-side compaction, which summarizes older turns past a threshold Right answer
  4. Open a new conversation at each refactoring step with a short manual summary

Why Server-side compaction summarizes older turns once input crosses the threshold, with no tracking by the team, and keeps the conversation going. Caching cuts cost, not window size; memory serves across sessions.

CL-028 An engineer has kept a very long debugging conversation with Claude open since the morning, then asks it an unrelated question about a command's syntax. The answer is slow and the consumption for that simple question surprises him. What should he be advised?
  1. Lower the conversation's effort so Claude answers this kind of question faster
  2. Ask Claude to compact the conversation before asking the syntax question
  3. Turn on memory so Claude finds the command without rereading the history
  4. Open a fresh, empty conversation and ask the command syntax question there Right answer

Why Every turn resends the full thread, hidden context included, so even a tiny question at the end of a long debugging session pays for all of it. A new conversation answers faster and cheaper; compacting first still summarizes context irrelevant to the question.