Repository navigation
Expand file tree
/
Copy pathExam_Moderate.html
More file actions
303 lines (303 loc) · 91.6 KB
/
Copy pathExam_Moderate.html
File metadata and controls
303 lines (303 loc) · 91.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Claude CCDV-F Practice Quiz</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f0f2f5; color: #333; padding: 20px; }
.container { max-width: 900px; margin: 0 auto; }
.header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 28px 32px; border-radius: 12px 12px 0 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.header h1 { font-size: 22px; font-weight: 700; }
.header-subtitle { font-size: 13px; opacity: .85; margin-top: 4px; }
.score-ring { background: rgba(255,255,255,.15); border: 2px solid rgba(255,255,255,.5); border-radius: 50px; padding: 12px 22px; text-align: center; min-width: 130px; }
.score-ring .val { font-size: 28px; font-weight: 800; }
.score-ring .lbl { font-size: 11px; opacity: .85; }
.stats-bar { background: #fafafa; border-left: 1px solid #e0e0e0; border-right: 1px solid #e0e0e0; padding: 14px 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: flex; align-items: center; gap: 7px; padding: 6px 14px; background: white; border-radius: 20px; border: 1px solid #ddd; font-size: 13px; font-weight: 600; }
.dot { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; }
.dot.all { background: #667eea; } .dot.correct { background: #22c55e; } .dot.wrong { background: #ef4444; } .dot.skipped { background: #94a3b8; }
.controls { background: white; border: 1px solid #e0e0e0; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 7px 14px; border: 1px solid #ddd; border-radius: 6px; background: white; cursor: pointer; font-size: 12px; font-weight: 600; color: #555; transition: all .2s; }
.filter-btn.active { background: #667eea; color: white; border-color: #667eea; }
.filter-btn:hover:not(.active) { border-color: #667eea; color: #667eea; }
.action-group { display: flex; gap: 8px; }
.action-btn { padding: 7px 14px; border-radius: 6px; border: none; cursor: pointer; font-size: 12px; font-weight: 600; transition: all .2s; }
.action-btn.expand { background: #f3f4f6; color: #555; border: 1px solid #ddd; }
.action-btn.expand:hover { background: #e5e7eb; }
.action-btn.reset { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.action-btn.reset:hover { background: #fecaca; }
.progress-wrap { background: white; border: 1px solid #e0e0e0; border-top: none; padding: 10px 24px 14px; }
.progress-label { font-size: 11px; color: #888; margin-bottom: 6px; }
.progress-track { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; display: flex; }
.progress-correct { background: #22c55e; transition: width .4s; }
.progress-wrong { background: #ef4444; transition: width .4s; }
.questions-container { padding: 20px 0; }
.q-card { background: white; border: 1.5px solid #e0e0e0; border-radius: 10px; margin-bottom: 14px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.q-card.answered-correct { border-color: #22c55e; } .q-card.answered-wrong { border-color: #ef4444; }
.q-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.q-header { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; cursor: pointer; user-select: text !important; -webkit-user-select: text !important; -moz-user-select: text !important; }
.q-num-badge { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: #e5e7eb; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #555; margin-top: 1px; }
.q-card.answered-correct .q-num-badge { background: #22c55e; color: white; }
.q-card.answered-wrong .q-num-badge { background: #ef4444; color: white; }
.q-title-wrap { flex: 1; }
.q-label { font-size: 12px; font-weight: 700; color: #667eea; margin-bottom: 5px; user-select: text !important; -webkit-user-select: text !important; }
.status-tag { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.status-tag.correct { background: #dcfce7; color: #166534; } .status-tag.wrong { background: #fee2e2; color: #991b1b; } .status-tag.unanswered { background: #f3f4f6; color: #6b7280; }
.q-text { font-size: 14px; line-height: 1.55; color: #374151; margin-bottom: 8px; user-select: text !important; -webkit-user-select: text !important; }
.q-meta { font-size: 11px; color: #9ca3af; margin-top: 5px; user-select: text !important; -webkit-user-select: text !important; }
.domain-chip { display: inline-block; background: #ede9fe; color: #6d28d9; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 10px; margin-right: 4px; }
.chevron { font-size: 11px; color: #9ca3af; transition: transform .3s; margin-top: 6px; }
.q-card.open .chevron { transform: rotate(180deg); }
.q-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; border-top: 1px solid #f0f0f0; }
.q-card.open .q-body { max-height: 3000px; }
.options-list { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.option-btn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 8px; background: white; cursor: pointer; text-align: left; transition: all .18s; width: 100%; user-select: text !important; -webkit-user-select: text !important; -moz-user-select: text !important; }
.option-btn:hover:not(:disabled) { border-color: #667eea; background: #f5f3ff; }
.option-btn:disabled { cursor: default; }
.option-btn.selected-correct { border-color: #22c55e; background: #f0fdf4; }
.option-btn.selected-wrong { border-color: #ef4444; background: #fef2f2; }
.option-btn.reveal-correct { border-color: #22c55e; background: #f0fdf4; }
.option-btn.reveal-neutral { border-color: #e5e7eb; background: #f9fafb; opacity: .7; }
.radio-circle { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d1d5db; flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: white; }
.option-btn.selected-correct .radio-circle { background: #22c55e; border-color: #22c55e; }
.option-btn.selected-wrong .radio-circle { background: #ef4444; border-color: #ef4444; }
.option-btn.reveal-correct .radio-circle { background: #22c55e; border-color: #22c55e; }
.option-text-wrap { flex: 1; user-select: text !important; -webkit-user-select: text !important; }
.option-main { font-size: 13.5px; line-height: 1.5; color: #1f2937; user-select: text !important; -webkit-user-select: text !important; }
.option-explanation { font-size: 12px; color: #6b7280; margin-top: 7px; padding-top: 7px; border-top: 1px dashed #e5e7eb; display: none; line-height: 1.5; user-select: text !important; -webkit-user-select: text !important; word-wrap: break-word; white-space: normal; }
.option-btn.selected-correct .option-explanation, .option-btn.selected-wrong .option-explanation, .option-btn.reveal-correct .option-explanation, .option-btn.reveal-neutral .option-explanation { display: block; }
.result-banner { margin: 0 16px 14px; padding: 12px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; display: none; user-select: text !important; -webkit-user-select: text !important; }
.result-banner.correct { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.result-banner.wrong { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.result-banner.visible { display: block; }
.overall-box { margin: 0 16px 14px; padding: 13px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; font-size: 12.5px; line-height: 1.6; color: #1e40af; display: none; user-select: text !important; -webkit-user-select: text !important; word-wrap: break-word; white-space: normal; }
.overall-box.visible { display: block; }
.overall-box strong { color: #1d4ed8; font-size: 11px; text-transform: uppercase; }
.footer { background: white; border: 1px solid #e0e0e0; border-radius: 0 0 12px 12px; padding: 14px 24px; text-align: center; font-size: 11px; color: #9ca3af; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 999; }
.modal-overlay.show { display: flex; }
.modal { background: white; border-radius: 12px; padding: 28px 32px; max-width: 380px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.25); text-align: center; }
.modal h3 { font-size: 18px; margin-bottom: 10px; }
.modal p { font-size: 13px; color: #666; margin-bottom: 22px; }
.modal-btns { display: flex; gap: 10px; justify-content: center; }
.modal-btns button { padding: 9px 22px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; }
.modal-cancel { background: #f3f4f6; color: #555; } .modal-cancel:hover { background: #e5e7eb; }
.modal-confirm { background: #ef4444; color: white; } .modal-confirm:hover { background: #dc2626; }
</style>
</head>
<body>
<div class="modal-overlay" id="resetModal">
<div class="modal">
<h3>🔄 Reset Quiz?</h3>
<p>All your answers will be cleared and you can start fresh.</p>
<div class="modal-btns">
<button class="modal-cancel" onclick="closeModal()">Cancel</button>
<button class="modal-confirm" onclick="confirmReset()">Yes, Reset</button>
</div>
</div>
</div>
<div class="container">
<div class="header">
<div>
<h1>Claude CCDV-F – Practice Quiz</h1>
<div class="header-subtitle">Moderate Difficulty · 53 Questions · Click an answer to reveal result</div>
</div>
<div class="score-ring">
<div class="val" id="scoreVal">–</div>
<div class="lbl" id="scoreLbl">Not started</div>
</div>
</div>
<div class="stats-bar">
<div class="pill"><div class="dot all">53</div><span>Total</span></div>
<div class="pill"><div class="dot correct" id="dotCorrect">0</div><span>Correct</span></div>
<div class="pill"><div class="dot wrong" id="dotWrong">0</div><span>Incorrect</span></div>
<div class="pill"><div class="dot skipped" id="dotSkipped">53</div><span>Remaining</span></div>
</div>
<div class="controls">
<div class="filter-group">
<button class="filter-btn active" onclick="applyFilter('all',this)">All (53)</button>
<button class="filter-btn" onclick="applyFilter('correct',this)">Correct</button>
<button class="filter-btn" onclick="applyFilter('wrong',this)">Incorrect</button>
<button class="filter-btn" onclick="applyFilter('unanswered',this)">Remaining</button>
</div>
<div class="action-group">
<button class="action-btn expand" onclick="toggleAll()">Expand All</button>
<button class="action-btn reset" onclick="openModal()">🔄 Reset Quiz</button>
</div>
</div>
<div class="progress-wrap">
<div class="progress-label" id="progressLabel">0 / 53 answered</div>
<div class="progress-track">
<div class="progress-correct" id="progCorrect" style="width:0%"></div>
<div class="progress-wrong" id="progWrong" style="width:0%"></div>
</div>
</div>
<div class="questions-container" id="questionsContainer"></div>
<div class="footer">
Claude Certified Developer-Foundations (CCDV-F) · Moderate Difficulty · 53 Questions
</div>
</div>
<script>
const questions = [
{n:1,domain:"D6",q:"Outputs are inconsistent. A developer keeps adding examples, but accuracy plateaus and the prompt grows expensive. On inspection, the instruction itself is ambiguous about one rule. What is the most effective next step?",ci:0,opts:[{t:"Clarify the ambiguous instruction first rather than stacking on more examples",e:"When an instruction is ambiguous, examples cannot compensate and only inflate cost while accuracy plateaus. Clarifying the instruction is the cheapest, highest-leverage reliability fix before adding more demonstrations."},{t:"Double the example count to try to overpower the ambiguous rule",e:"More examples cannot resolve an ambiguous rule; they raise cost while the underlying unclear instruction still misleads the model."},{t:"Move all examples into the user turn to save some tokens",e:"Relocating examples changes placement, not clarity; the ambiguous instruction remains the root cause of inconsistency."},{t:"Enable extended thinking so the model resolves the ambiguity entirely on its own",e:"Thinking cannot invent the intended rule; an ambiguous instruction must be clarified by the author, not reasoned around."}],o:"Instruction clarity first. Adding examples on top of an ambiguous instruction inflates cost while accuracy stalls, because the root cause is unclear guidance. Clarifying the instruction is the cheapest and highest-leverage fix before reaching for more demonstrations."},
{n:2,domain:"D5",q:"A migration moves a working call from Sonnet 4.5 to Sonnet 5, keeping thinking.type enabled with budget_tokens. What is the result on Sonnet 5?",ci:2,opts:[{t:"It succeeds, since budget_tokens is required on Sonnet 5 just as before",e:"budget_tokens is required on Sonnet 4.5 but not on Sonnet 5, which rejects it, so the assumption is wrong."},{t:"It succeeds but silently converts budget_tokens into an adaptive budget",e:"There is no silent conversion; the legacy thinking config is rejected with an error on Sonnet 5."},{t:"It returns a 400 error; Sonnet 5 rejects budget_tokens and needs adaptive",e:"On Sonnet 5, thinking.type enabled with budget_tokens is rejected with a 400. Current models use adaptive thinking instead, so the call must switch to thinking.type adaptive to succeed."},{t:"It succeeds, because thinking configuration never changes across model releases",e:"Thinking configuration does change across releases; budget_tokens is required on Sonnet 4.5 but rejected on Sonnet 5."}],o:"Legacy budget_tokens breaks on Sonnet 5. Thinking configuration is model-specific: budget_tokens is required on Sonnet 4.5 but returns a 400 on Sonnet 5, which supports only adaptive thinking. A migration that keeps the legacy config fails until it switches to adaptive."},
{n:3,domain:"D8",q:"An agent has two similar tools but keeps calling the wrong one. The tool names look distinct and correct, and both schemas are valid. Which of the following is the FIRST fix to try?",ci:0,opts:[{t:"Rewrite each tool's description to clarify when to use it",e:"The description is the primary signal Claude uses to route among tools. Sharpening what each tool does and when to use it is the first and highest-leverage fix for a wrong-tool problem."},{t:"Rename both tools with longer, more explicit function names",e:"The tool name is not the main routing signal, so a clearer name rarely fixes misrouting when the description is vague."},{t:"Set tool_choice to any so the model calls some tool",e:"Forcing any tool does not help the model pick the correct one; it only guarantees a call, not the right call."},{t:"Remove the input schema so the model has fewer constraints",e:"Dropping the schema degrades argument quality and does nothing to improve which tool is selected."}],o:"Descriptions drive tool routing. Claude selects among tools primarily from their natural-language descriptions, not their names, so a vague description causes misrouting even when names look obvious. Improving the descriptions to state purpose and usage is the first fix for wrong tool choices."},
{n:4,domain:"D5",q:"A developer switches from raw HTTP calls to the Anthropic SDK and asks whether streaming now uses a different network protocol. What is accurate?",ci:3,opts:[{t:"The SDK upgrades streaming to a bidirectional websocket automatically",e:"SDKs do not upgrade to websockets; they parse the same HTTP SSE stream the REST API returns."},{t:"The SDK opens a gRPC channel instead of HTTP",e:"The SDK calls the same HTTP REST endpoints, not a gRPC channel."},{t:"The SDK batches deltas and delivers them as one payload",e:"The SDK surfaces deltas as they arrive; it does not batch them into one payload, matching REST wire behavior."},{t:"The SDK parses the same SSE stream, adding no new transport",e:"SDKs are thin wrappers over the REST Messages API. Streaming still uses HTTP SSE with identical wire behavior; the SDK just parses the events and adds no new transport or protocol."}],o:"SDKs wrap REST. The Anthropic SDKs are thin wrappers over the REST Messages API, so streaming still uses HTTP SSE with identical wire behavior. The SDK parses the events and adds auth, retries, and typing, but no new transport or protocol. It cannot upgrade streaming to a websocket or gRPC."},
{n:5,domain:"D1",q:"Of the three agentic frameworks, which pairing correctly names the two that are model-driven loops rather than explicit graphs?",ci:2,opts:[{t:"LangGraph and Strands, since both drive an agent loop without graphs",e:"LangGraph is the graph-based framework, so pairing it as a model-driven loop is the cross-attribution error."},{t:"LangGraph and PydanticAI, since both compile a graph before running",e:"Only LangGraph compiles a graph; PydanticAI is a model-driven loop with no graph to compile."},{t:"Strands and PydanticAI, since neither is built on a graph",e:"Strands and PydanticAI are both model-driven loops; only LangGraph is graph-based. Strands is a plain model, tools, prompt loop and PydanticAI a validated-output loop."},{t:"Strands and LangGraph, since both center on validated typed outputs",e:"Validated typed output is PydanticAI's differentiator, not LangGraph's, and LangGraph is graph-based."}],o:"Framework cross-attribution. LangGraph is the only graph and state-machine framework of the three; Strands and PydanticAI are both model-driven loops. Strands is defined by model, tools, and prompt, while PydanticAI is defined by validated outputs, and neither uses a graph."},
{n:6,domain:"D1",q:"Which configuration value correctly identifies a self-hosted managed agent deployment, the shape where tool execution runs on the customer's own infrastructure rather than on Anthropic?",ci:3,opts:[{t:"Setting the deployment config type to the anthropic_hosted value in the request.",e:"An Anthropic-hosted value would run tools in Anthropic-managed sandboxes, not on customer infrastructure."},{t:"Setting the tool_choice request parameter to the any value for tools.",e:"tool_choice controls whether the model calls a tool; it does not select a deployment shape."},{t:"Setting the permissionMode field to a self_hosted value in the settings.",e:"permissionMode governs tool-permission behavior, not the managed deployment shape."},{t:"Setting the deployment config type field to the self_hosted value explicitly.",e:"The self-hosted managed shape is selected with the config type value self_hosted, which keeps orchestration on Anthropic and runs tool execution on customer infrastructure."}],o:"Self-hosted configuration value. The self-hosted managed deployment is declared through the config type value self_hosted, which keeps the agent loop on Anthropic while relocating tool execution to customer infrastructure. Confusing this with unrelated parameters like tool_choice or permissionMode misreads what actually selects the deployment shape."},
{n:7,domain:"D2",q:"A developer must process 40,000 document-classification prompts overnight where latency is unimportant but cost is critical. Which Claude API approach best fits this workload?",ci:0,opts:[{t:"The Message Batches API, which processes asynchronously at 50% of standard price",e:"Batches process asynchronously at half the standard price within a 24-hour window, matching a latency-tolerant, cost-sensitive overnight job."},{t:"The synchronous Messages API with fast mode enabled to lower the per-token price",e:"Fast mode targets latency, not cost, and does not halve token price the way batch processing does."},{t:"The synchronous Messages API with many concurrent async requests to halve cost",e:"Concurrency improves throughput at standard price; it does not deliver the 50% batch discount."},{t:"The Message Batches API, which guarantees results within one hour at full price",e:"Batches run at 50% price and completion is best-effort, not a one-hour guarantee at full price."}],o:"Batch cost tradeoff. The Message Batches API processes requests asynchronously at 50% of standard price within a 24-hour window, which is the right lever when latency does not matter but cost does. Concurrency and fast mode address throughput and latency, not the per-token discount, so they do not fit this workload."},
{n:8,domain:"D6",q:"A production research system must fan out to many sources, each generating large intermediate output, keep the orchestrator's context lean, ensure one source's malformed output cannot corrupt the others, and pass each worker exactly the scope it needs. The team is designing the orchestration. Which approach BEST satisfies all four requirements?",ci:1,opts:[{t:"Run all sources inline in the orchestrator, then compact the combined raw output afterward.",e:"Inlining every source fills the orchestrator with raw output and lets one malformed result sit beside the others before any compaction."},{t:"Give each source its own subagent with scoped input that returns only distilled findings.",e:"Per-source subagents isolate large intermediate output, keep the orchestrator lean, contain a malformed result to its own context, and receive only the scope each needs."},{t:"Share the orchestrator's full context with every worker to keep them consistent.",e:"Sharing full context breaks scoping and least-context handoff and enlarges each worker's window unnecessarily."},{t:"Merge each worker's complete raw transcript back into the orchestrator for full traceability.",e:"Merging raw transcripts refills the orchestrator with bloat, defeating the lean-context requirement."}],o:"Orchestrator-worker isolation satisfies all four goals. Delegating each source to its own subagent that receives only its scoped input and returns only distilled findings keeps the orchestrator lean, bounds each source's large intermediate output in a separate context, and contains a malformed result so it cannot corrupt siblings. Inlining sources, sharing full context, or merging raw transcripts each violate one or more of the stated requirements."},
{n:9,domain:"D1",q:"A developer plans to compact earlier turns of a long session into a summary. Before doing so, the limitation to weigh is:",ci:2,opts:[{t:"Compaction requires disabling all tools for the rest of the run",e:"Compaction only compresses prior history and does not require disabling tools."},{t:"Compaction doubles token cost for every turn that follows it",e:"Compaction reduces token load to continue a long session rather than doubling per-turn cost."},{t:"Compaction is lossy, so exact earlier details cannot be recovered",e:"Compaction summarizes earlier turns and drops fine detail, so exact earlier content cannot be referenced verbatim afterward."},{t:"Compaction permanently ends the session once the summary is written",e:"Compaction reclaims tokens so the session can continue; it does not end the session."}],o:"Compaction is lossy. Compacting history reclaims tokens by compressing earlier turns into a summary, but the fine-grained detail is gone. It is correct when the gist suffices and wrong when an exact earlier output must later be referenced verbatim."},
{n:10,domain:"D2",q:"A developer keeps adding lengthy content to CLAUDE.md, assuming it is free memory that does not affect the model. What is the accurate view?",ci:2,opts:[{t:"CLAUDE.md is stored externally and never enters the context window",e:"CLAUDE.md is loaded into context, not held externally. Its content occupies the same window the model reasons over."},{t:"CLAUDE.md loads only when a slash command explicitly requests it",e:"CLAUDE.md rules load automatically at session start and apply every turn; they are not gated behind a slash command."},{t:"CLAUDE.md loads into context and counts against the context window",e:"CLAUDE.md is loaded into context and its content counts against the context window, so it is not free memory. Long files consume tokens on every turn."},{t:"CLAUDE.md consumes tokens only in headless mode, not interactively",e:"Token cost is not mode-specific. CLAUDE.md consumes context whenever it is loaded, interactive or headless."}],o:"CLAUDE.md consumes context, it is not free memory. Instructions in CLAUDE.md are loaded into the context window and apply on every turn, so their length counts against the token budget. Treating the file as free memory leads to bloat; keep it concise and high-signal."},
{n:11,domain:"D5",q:"A pipeline sends the same 20,000-token instruction prefix on every call, followed by a short variable question. Traffic is steady and frequent. The team wants to cut the repeated input cost. Which approach fits best?",ci:1,opts:[{t:"Move the prefix into each user turn to avoid system-prompt charges",e:"Relocating the prefix does not reduce its token cost, and the tokens are billed wherever they sit in the request."},{t:"Cache the stable prefix so repeated reads bill at 0.1x base input",e:"A large, stable, frequently reused prefix is the ideal caching case. Marking it with a cache breakpoint means later calls read it at 0.1x base input, and steady traffic keeps the entry warm so the writes amortize."},{t:"Send the prefix once and assume the model remembers it across calls",e:"There is no cross-call memory of prompt content. Each request must carry the prefix, so this would break the calls."},{t:"Switch every call to the Batches API to halve the prefix cost",e:"Batches trade latency for cost and suit bulk jobs, not steady real-time traffic, and they do not exploit the prefix reuse that caching does."}],o:"Caching a hot stable prefix. A big instruction prefix reused on frequent calls is exactly what prompt caching targets, letting later reads bill at 0.1x base input while steady traffic keeps the entry warm. Relocating or dropping the prefix does not cut its token cost."},
{n:12,domain:"D2",q:"During onboarding, a team wants new developers to end up with the same working plugins as everyone else. What practice supports this?",ci:3,opts:[{t:"Let each developer install whichever plugin versions they personally prefer",e:"Divergent personal versions produce inconsistent behavior across the team, the opposite of the shared, reproducible setup onboarding needs."},{t:"Store all plugin logic inside each developer's settings.local.json only",e:"settings.local.json is personal and uncommitted, so putting plugin logic there hides it from teammates instead of sharing it consistently."},{t:"Rely on the model to reinstall any plugin a developer is missing",e:"The model does not manage or reinstall missing plugins. Consistency comes from tracking and sharing dependencies, not from the model."},{t:"Track and share plugin dependencies so every member resolves them",e:"Consistent onboarding depends on tracking plugin dependencies and sharing them so every developer resolves the same requirements and gets the same working setup."}],o:"Track and share plugin dependencies for team consistency. Getting every teammate to the same working state means treating plugin dependencies as shared, tracked requirements rather than personal choices. Divergent versions or personal-only config break the reproducibility that onboarding and team consistency require."},
{n:13,domain:"D2",q:"A retailer wants shoppers to receive product recommendations in the same language they wrote their question in. Which functional requirement most directly traces to this business need?",ci:2,opts:[{t:"The assistant must be deployed in the retailer's European data region",e:"Data region is an infrastructure and residency concern and has no relationship to matching the shopper's language."},{t:"The assistant must return recommendations within a two second budget",e:"A latency budget is an infrastructure constraint; it does not address responding in the user's language."},{t:"The assistant detects and replies in the user's language",e:"The business need is same-language replies, so the functional behavior is detecting the input language and responding in it. This directly traces the requirement back to the stated need."},{t:"The assistant must call the lowest cost model to reduce spend",e:"Cost optimization is unrelated to the language of the response and does not satisfy the stated need."}],o:"Tracing a functional requirement. A functional requirement must trace directly back to the business need, here detecting and matching the shopper's language. Region, latency, and cost are architecture and infrastructure choices that do not describe the requested behavior."},
{n:14,domain:"D2",q:"An end-to-end agent task produces a wrong final answer. Before changing the prompt or model, an engineer wants to localize where behavior diverged from intent. Which first step provides the evidence needed to isolate the failing layer?",ci:0,opts:[{t:"Read the trace of prompts, tool calls, results, and responses",e:"The trace is the primary evidence for origin isolation. It reveals whether a wrong tool argument, empty result, or truncated response caused the divergence and in which layer."},{t:"Immediately rewrite the system prompt and rerun the entire task once",e:"Rewriting first assumes a prompt fault without evidence. The integration layer may have mangled a correct model output, so this can target the wrong component."},{t:"Swap to a more capable model tier and compare the outputs",e:"Changing model tier before isolating the fault treats every bad result as a weak-model problem, which the trace often disproves."},{t:"Assume the integration code is correct and blame the model output",e:"Assuming a layer is correct skips isolation. The failure is frequently an integration bug, not the model, so the assumption misdirects debugging."}],o:"Isolate before fixing. Reading the ordered execution trace of prompts, tool calls, results, and responses is the primary evidence for locating where behavior diverged. The failure is usually visible mid-trace, and only the trace reveals whether the model or the integration produced the divergence, so isolation precedes any prompt or model change."},
{n:15,domain:"D2",q:"A platform team is standardizing Claude Code across engineers. They need shared hooks and permissions that everyone inherits on clone, a place for each engineer's personal permission tweaks that are never committed, and always-on coding conventions the model follows every turn. How should these be arranged across the configuration layers?",ci:0,opts:[{t:"Shared hooks and permissions in settings.json, tweaks in git-ignored settings.local.json, conventions in CLAUDE.md",e:"Committed project settings.json shares hooks and permissions, git-ignored settings.local.json holds personal overrides, and CLAUDE.md carries always-on conventions. Each need maps to its correct layer."},{t:"All three in the project CLAUDE.md so a single committed file carries hooks, tweaks, and conventions together",e:"Hooks and permissions do not belong in CLAUDE.md, which holds behavioral rules, not enforcement config."},{t:"Shared hooks in CLAUDE.md, personal tweaks in project settings.json, and conventions in per-engineer settings.local.json",e:"This misplaces every layer; hooks belong in settings.json and conventions in CLAUDE.md, not the reverse."},{t:"All three in each engineer's user-level settings.json so every repository inherits the same behavior automatically",e:"User-level settings are personal and not shared with the team on clone."}],o:"Map each need to its config layer. Committed project settings.json shares hooks and permissions, git-ignored settings.local.json holds personal uncommitted overrides, and CLAUDE.md carries always-on behavioral conventions. Mixing these layers, such as putting hooks in CLAUDE.md, breaks the intended control model."},
{n:16,domain:"D2",q:"A reviewer finds retry-with-backoff logic wrapping every Claude API call, including calls that returned a 400 invalid-request error. What should the reviewer recommend?",ci:2,opts:[{t:"Increase the backoff interval so the invalid request eventually succeeds on retry",e:"A 400 is permanent; a longer interval still replays the same invalid request and never succeeds."},{t:"Retry all errors uniformly, since backoff resolves both transient and permanent faults",e:"Backoff clears transient errors only; applying it to permanent errors just delays recognizing the defect."},{t:"Retrying a permanent 400 error reproduces the same failure, so fix the request instead",e:"A 400 invalid-request error is permanent and will not clear on retry, so backoff wastes budget. The fix is to correct the malformed request, reserving retry for transient errors like timeouts, rate limits, and 5xx."},{t:"Convert the 400 into a timeout so the existing retry path can clear it",e:"Masking a permanent error as a timeout hides the real defect and reproduces the failure."}],o:"Retry only transient errors. A 400 invalid-request error is permanent and will not clear on retry, so wrapping it in exponential backoff wastes budget and delays finding the real defect. Retry with backoff belongs to transient errors such as timeouts, rate limits, and 5xx responses."},
{n:17,domain:"D7",q:"A design review debates whether one control covers all needs. The team must uphold confidentiality, integrity, and privacy for a multi-tenant assistant handling personal data. A reviewer claims encrypting data at rest satisfies all three properties at once.",ci:1,opts:[{t:"Encryption at rest satisfies confidentiality, integrity, and privacy simultaneously.",e:"Encryption at rest mainly serves confidentiality; it does not by itself enforce integrity of actions or lawful minimal use of personal data."},{t:"The three differ: who may read, who may change, and lawful minimal use.",e:"Confidentiality governs who can read, integrity who can change, and privacy the lawful, minimal, consented use of personal data. A control protecting one does not automatically protect the others."},{t:"Integrity and privacy are the same property under different names.",e:"Integrity concerns unauthorized modification while privacy concerns proper use of personal data; they are distinct properties."},{t:"Privacy is fully covered once confidentiality controls are in place.",e:"Confidentiality restricts reading, but privacy also requires lawful, minimal, consented use, which confidentiality alone does not guarantee."}],o:"Three distinct properties need distinct controls. Confidentiality is about who can read, integrity about who can change, and privacy about lawful minimal use of personal data. Collapsing them into one idea is a common mistake, since a single control like encryption at rest protects one property without automatically covering the others."},
{n:18,domain:"D7",q:"A production agent occasionally deletes records despite a CLAUDE.md rule saying never delete customer data. The team needs the deletion to be impossible, not merely discouraged. The MOST reliable fix is to:",ci:0,opts:[{t:"add a PreToolUse hook that deterministically denies the deletion tool",e:"CLAUDE.md guidance is probabilistic and can be overridden, so it cannot make an action impossible. A PreToolUse deny hook enforces the block deterministically before the tool runs."},{t:"reword the CLAUDE.md rule more firmly and add stronger emphasis around deletions",e:"Rewording probabilistic guidance still leaves it bypassable; it cannot guarantee prevention."},{t:"add a PostToolUse hook that alerts the team after a deletion occurs",e:"A PostToolUse alert fires after the deletion already happened and cannot stop it."},{t:"instruct the model in the system prompt to always double-check deletions first",e:"A system-prompt instruction is guidance the model may not follow, not enforcement."}],o:"Replacing probabilistic guidance with deterministic hook enforcement. Natural-language rules and prompts only discourage an action and can be overridden, so they cannot make a deletion impossible. A PreToolUse deny hook enforces the block outside the model before the tool runs, which is what a hard requirement demands."},
{n:19,domain:"D5",q:"A support system must classify tens of thousands of incoming tickets per hour into fixed categories under a tight latency and cost budget. Which model tier fits best?",ci:2,opts:[{t:"Opus, because classification accuracy always improves with the most capable tier.",e:"Simple classification does not need Opus; the most capable tier over-provisions the task and inflates cost and latency."},{t:"Opus for the hardest tickets and Haiku for the rest, chosen at random.",e:"Random tier assignment ignores task difficulty and wastes Opus on easy tickets."},{t:"Haiku, the fastest, cheapest tier, fit for simple high-volume classification.",e:"Simple, high-volume categorization under tight latency and cost limits is exactly what Haiku targets. It is the fastest and cheapest tier and clears the quality bar for this well-scoped task."},{t:"Sonnet, since a balanced tier is safest when latency and cost both matter.",e:"Sonnet's added cost and latency are unjustified when a simpler tier already meets the bar."}],o:"Haiku for simple high-volume work. When a task is simple and constrained by latency and cost, the lightest tier that clears the quality bar wins. Haiku is fastest and cheapest, so it fits high-volume ticket classification, while Opus would over-provision and Sonnet would add unneeded cost."},
{n:20,domain:"D2",q:"A production service calls Claude directly over REST from several languages, some without an official SDK. The team must standardize error handling, cost tracking, streaming, and later portability to Bedrock, without assuming any capability only an SDK could add. Which architecture reflects a correct understanding of the REST surface?",ci:0,opts:[{t:"Use one thin HTTP client that speaks the JSON Messages contract, reads usage for cost, and parses SSE",e:"A thin HTTP client can implement everything the REST surface offers: the JSON Messages contract, usage-based cost tracking, and SSE parsing. Because the current Bedrock path shares the same body and events, this design ports with only endpoint and model-ID changes."},{t:"Require every language to adopt an unofficial SDK, since raw REST cannot stream or report token usage",e:"Raw REST fully supports streaming and returns usage counts on every response. An unofficial SDK adds nothing the endpoints lack."},{t:"Route all traffic through one language's official SDK as a proxy, because REST lacks tool-use support",e:"Tool use is a REST-level feature available to any HTTP caller. Proxying through one SDK is unnecessary and adds a bottleneck."},{t:"Defer Bedrock portability, assuming its request body differs enough to need a separate integration layer",e:"The current Bedrock integration uses the same Messages body and SSE format, so portability needs endpoint and ID changes, not a separate schema."}],o:"The REST surface is complete and portable. Streaming, tool use, structured outputs, and usage reporting are all REST features, so a thin multi-language HTTP client loses nothing an SDK would provide. Since the current Bedrock path shares the same JSON body and SSE events, standardizing on the REST contract makes later portability a matter of endpoint and model-ID changes."},
{n:21,domain:"D2",q:"An agent has two similarly named search tools and keeps calling the wrong one despite clear tool names. The names look obvious but the descriptions are terse and nearly identical. What is the FIRST fix?",ci:1,opts:[{t:"Rename the tools with longer, more distinctive identifiers to force correct routing",e:"The name is not the primary routing signal. Longer names will not fix near-identical descriptions."},{t:"Rewrite each tool's description to state clearly what it does and when to use it",e:"Claude uses the tool description as the primary signal for selecting among tools. Rewriting each description to state its purpose and when to use it is the first fix for misrouting."},{t:"Set tool_choice to tool and hardcode which one the model must call",e:"Hardcoding one tool removes the model's ability to choose correctly between distinct tasks."},{t:"Merge both tools into one broad tool to remove the routing decision",e:"Merging into one broad tool enlarges scope and misuse rather than fixing selection between two real tasks."}],o:"Descriptions drive tool selection. The tool description, not the name, is Claude's main signal for choosing among tools, so vague or near-identical descriptions cause misrouting. Rewriting them to clearly state purpose and when to use each tool is the first and cheapest fix."},
{n:22,domain:"D2",q:"The file that should stay out of the shared repository because it holds a developer's personal overrides is:",ci:2,opts:[{t:"The project-root settings.json holding the team's shared permissions and hooks configuration",e:"Project settings.json holds shared permissions and hooks and is meant to be committed so the whole team gets consistent configuration."},{t:"The project-root CLAUDE.md holding the shared, always-on behavioral rules",e:"The project CLAUDE.md carries shared behavioral rules and belongs in version control, not excluded from it."},{t:"The settings.local.json file, holding a developer's personal, git-ignored overrides",e:"settings.local.json holds a developer's personal, uncommitted overrides. It is git-ignored by design so private settings never propagate to the team."},{t:"The repository README that documents the project's build and setup commands",e:"A README documents the project and is committed for everyone; it is not a personal-override file."}],o:"What to commit versus keep local. Shared config, the project CLAUDE.md and settings.json, is committed for consistent team behavior, while settings.local.json holds personal overrides and stays git-ignored. Committing local settings would force one developer's private configuration onto everyone."},
{n:23,domain:"D5",q:"A pipeline asserts that identical prompts to Claude always return byte-identical responses. Why is this assumption unsafe?",ci:2,opts:[{t:"Responses are identical only when streaming is disabled on the request",e:"Streaming does not change response content; variation stems from probabilistic generation, not from streaming."},{t:"Outputs match exactly whenever temperature is left at its default value",e:"Even at default settings, output can differ run to run, so a fixed temperature does not guarantee identity."},{t:"Next-token selection is probabilistic, so outputs vary even at defaults",e:"Generation selects each token from a probability distribution and serving conditions vary, so the same prompt can yield different outputs even at default settings. Reliable pipelines validate and parse defensively rather than expecting an exact string."},{t:"Identical prompts differ only when the model version changes between calls",e:"Variation can occur without any version change, because next-token selection is inherently probabilistic."}],o:"Non-determinism. The same prompt can produce different outputs across calls because next-token selection is probabilistic and serving conditions vary. Removing randomness does not guarantee byte-identical replies, so pipelines should validate and parse defensively instead of depending on an exact expected string."},
{n:24,domain:"D6",q:"A developer wants a model response that downstream code can consume without cleanup. Which set of prompt additions BEST narrows the response toward a machine-consumable answer?",ci:1,opts:[{t:"A friendly persona description and an encouraging tone for the assistant",e:"Persona and tone shape voice, not machine-readability. They do not narrow the response toward a parseable structure."},{t:"Required format, allowed field values, and length bounds in the prompt",e:"Output constraints such as required format, allowed values, and length bounds narrow the model toward a machine-consumable answer and reduce downstream post-processing."},{t:"A request to explain the reasoning in as much detail as possible",e:"Verbose reasoning expands prose the parser must strip, moving away from a clean machine-readable output."},{t:"A higher effort level and a request for creative variety in phrasing",e:"Creative variety and higher effort increase unpredictability in phrasing, the opposite of a constrained, parseable response."}],o:"Output constraints narrow responses toward machine-consumable answers. Stating the required format, allowed field values, and length bounds constrains the shape of the output and reduces post-processing. Persona, verbose reasoning, and creative variety all widen the response rather than making it parseable."},
{n:25,domain:"D2",q:"A nightly job sends thousands of records to a model for structured extraction. A few responses return an extra unexpected field or a null where a number is expected, and the consumer crashes on them. The job must finish without manual intervention. Which approach BEST hardens it?",ci:2,opts:[{t:"Assume structured outputs are a strict contract and consume every response directly",e:"Treating the output as a guaranteed contract is what causes the crashes. Surprising fields or types slip through and break unchecked consumers."},{t:"Halt the entire job on the first malformed record so a human can inspect it",e:"Halting on the first failure defeats the unattended requirement and lets a single bad record block thousands of good ones."},{t:"Parse defensively and validate each record, re-prompting or skipping any that fail",e:"Defensive parsing plus per-record validation isolates the few bad records, letting the job re-prompt or skip them and finish unattended while good records flow through."},{t:"Wrap the consumer in a broad try-except that swallows every error silently",e:"Swallowing all errors hides real problems and can drop valid records silently, trading a crash for silent data loss."}],o:"Harden bulk pipelines with defensive parsing and validation. Even enforced output can surprise a consumer, so a large unattended job should validate each record, quarantine or re-prompt the failures, and let the rest proceed, rather than trusting a strict contract, halting on one bad record, or swallowing errors."},
{n:26,domain:"D6",q:"A model returns a long, thorough explanation supporting a compliance deadline it produced. A developer decides to trust it because the answer is so detailed. Which principle should guide the developer instead?",ci:1,opts:[{t:"A detailed answer covers more cases, so it is statistically more likely correct",e:"Detail does not correlate with correctness; a long explanation can elaborate a wrong premise just as convincingly as a right one."},{t:"Thoroughness is not correctness, so verify the deadline against a trusted source",e:"Fluency and detail are not evidence of accuracy, because models state wrong answers as thoroughly as right ones. High-stakes facts need grounding against an authoritative source regardless of how detailed the answer reads."},{t:"Ask the model to rate its own certainty and trust high ratings",e:"Self-rated certainty is not a correctness signal; a model can report high confidence on an incorrect answer, so the rating cannot gate trust."},{t:"Raise the reasoning effort level so the detailed answer becomes guaranteed accurate",e:"More effort can improve reasoning but never guarantees accuracy, and it does not replace grounding a high-stakes fact against its source."}],o:"Detail is not a correctness signal. A fluent, thorough answer is not evidence it is right, since models produce wrong answers with the same polish as correct ones. High-stakes claims must be verified by grounding against an authoritative source, not accepted for their thoroughness."},
{n:27,domain:"D8",q:"A company is designing extension mechanisms for a Claude application. It needs live web retrieval that Anthropic already offers, one narrow action against its own proprietary billing backend used by no one else, and a customer-lookup capability that three internal apps and a partner client must all share through one interface. Which assignment of mechanisms BEST fits each need?",ci:2,opts:[{t:"An MCP server for all three, so every capability is exposed through one standard interface",e:"Wrapping the already-covered built-in and the single-consumer billing action in MCP servers adds needless overhead; MCP is warranted only for the genuinely shared capability."},{t:"Custom tools for all three, reimplemented separately inside each consuming application",e:"Custom tools for all three forgo the ready-made built-in and duplicate the shared lookup across clients instead of exposing it once through MCP."},{t:"Built-in tool for web retrieval, custom tool for billing, and an MCP server for the shared lookup",e:"Each need maps to its best-fit mechanism: a built-in tool covers web retrieval already, a custom tool fits the single-app billing action, and an MCP server shares the customer lookup across many clients including a partner. Matching each concern to the right mechanism is the principle."},{t:"A built-in tool for web retrieval, and one Skill each for the billing action and the shared lookup",e:"A Skill packages instructions and cannot execute the billing action or serve the shared lookup as a callable interface across clients."}],o:"Assign each capability to the right mechanism. A covered capability uses the built-in tool, a single-app action uses a custom tool, and a capability shared across many clients uses an MCP server. Forcing one mechanism onto every need, whether MCP, custom tools, or Skills, either adds overhead or fails to execute or share correctly."},
{n:28,domain:"D7",q:"A healthcare triage assistant must never surface disallowed medical claims, must resist injected instructions from uploaded patient documents, and must block any response recommending a controlled substance. The team has one week and wants the most robust content-policy design. Which approach is BEST?",ci:3,opts:[{t:"A single detailed system prompt that lists every disallowed claim and every controlled-substance rule",e:"A prompt is probabilistic and bypassable, and injected document instructions can override it, so one prompt cannot enforce three high-stakes rules reliably."},{t:"Rely on model built-in safety alone, since it already refuses clearly harmful medical content",e:"Built-in safety handles universal harms but does not know this deployment's bespoke claim and substance rules or defend against document injection."},{t:"Post-response monitoring that flags any violation for a clinician to review the next day",e:"Monitoring detects after the fact; violations still reach users, so it cannot prevent disallowed output on its own."},{t:"Screen uploads, check output for disallowed claims, and block controlled-substance replies in code",e:"Each requirement maps to a distinct layer: input screening isolates injected instructions in untrusted documents, an output check catches disallowed claims before release, and code deterministically blocks controlled-substance recommendations. Layering covers all three failure paths."}],o:"Map each policy requirement to input, output, and code layers. High-stakes content rules and document-borne injection cannot be enforced by a single prompt or built-in safety alone. Screening untrusted input, checking output before release, and enforcing hard rules in code gives defense in depth where no one failure exposes a disallowed response."},
{n:29,domain:"D2",q:"A production agent's cost is rising because each call carries a bloated history of verbose tool output and redundant recaps. Latency is climbing too. The team wants durable relief, not a one-time trim. Which combination fits best?",ci:0,opts:[{t:"Prune tool output often and compact histories as they grow",e:"Routine pruning removes verbose tool output at the source, and ongoing compaction keeps long histories bounded, giving durable relief. Together they attack both drivers of the rising cost and latency rather than trimming once."},{t:"Raise the effort level so that responses finish in fewer calls",e:"Higher effort does not shrink the carried history; the bloated context still inflates cost and latency every call."},{t:"Disable tools entirely so no results accumulate in the context",e:"Disabling tools removes needed capability; the fix is pruning results, not eliminating the tools that produce them."},{t:"Rely on the model to simply forget the redundant recaps itself",e:"There is no automatic forgetting; redundant recaps persist until the application prunes or compacts them."}],o:"Combine routine pruning and compaction for durable hygiene. Rising cost and latency come from verbose tool output plus redundant history reprocessed every call. Routinely pruning tool results and compacting long histories addresses both drivers durably, since nothing is forgotten automatically."},
{n:30,domain:"D5",q:"A reporting job sends thousands of prompts, but each one is unique to a single customer and is never sent again. An engineer proposes marking every prompt with cache_control to save money. Why is this misguided?",ci:2,opts:[{t:"Caching is limited to prompts that stay under a fixed token count",e:"There is no size ceiling that blocks caching here; the flaw is the absence of any reuse."},{t:"Unique prompts are automatically cached, so the markers would be redundant",e:"Nothing is cached automatically, and even if marked, a never-repeated prompt is never read back."},{t:"A prefix reused zero times pays the write premium with no read discount",e:"Each unique prompt would pay the write premium and never be read again, so caching costs more than not caching at all."},{t:"Cache writes are free, but reads on unique prompts cost extra",e:"Writes are not free; they cost a premium above base, and there are no reads on prompts that never repeat."}],o:"Caching without reuse loses money. Caching saves only when discounted reads amortize the write premium. Prompts unique to a single customer and never repeated earn zero reads, so marking them just adds the write premium on top of base and raises cost."},
{n:31,domain:"D5",q:"An app runs Claude through the Bedrock SDK variant in one environment and the first-party SDK in another. A developer expects wholly different request semantics between them. What is accurate about these SDK variants?",ci:2,opts:[{t:"The Bedrock variant uses a bespoke protocol with no REST endpoint underneath",e:"The Bedrock variant still calls a REST Messages endpoint; there is no bespoke non-REST protocol."},{t:"SDK variants add capabilities that are absent from their own REST surfaces",e:"Each variant is a thin wrapper and cannot add capabilities the surface it targets does not support."},{t:"Each variant wraps its REST endpoint with the same request body shape",e:"The Bedrock and first-party SDKs are convenience clients over REST Messages endpoints that share the same body shape and SSE behavior. Auth and model-ID conventions differ, not the core request semantics."},{t:"Only the first-party SDK actually issues real HTTP requests to an endpoint",e:"The Bedrock variant also issues HTTP requests to a REST endpoint; both variants make real network calls."}],o:"SDK variants wrap REST. The Bedrock and first-party SDK variants are convenience clients over REST Messages endpoints with the same body shape and SSE behavior. Only auth and model-ID conventions differ across them."},
{n:32,domain:"D5",q:"An application generates JSON records from user narratives. Format instructions plus few-shot examples shape the output, but a downstream parser occasionally receives malformed records. The team wants both consistent formatting and guaranteed schema conformance. Which design BEST meets the goal?",ci:1,opts:[{t:"Add progressively more few-shot examples until the downstream parser stops receiving any malformed records",e:"Examples shape output but never guarantee a schema; malformed records can still slip through no matter how many you add."},{t:"Pair few-shot examples for style with structured outputs or strict tool use to ensure schema conformance",e:"Few-shot examples shape tone and style, but only structured outputs or strict tool use guarantee that fields, types, and enums hold. Combining them gives both consistent formatting and enforced schema conformance."},{t:"Rely on a prose instruction that simply tells the model to always return only valid JSON",e:"A prose instruction like return only JSON is best effort; syntactically valid JSON is not the same as schema compliance."},{t:"Raise the reasoning effort so the model formats every single record correctly on its own",e:"Higher effort does not guarantee a schema; enforcement requires structured outputs or strict tool use, not more reasoning."}],o:"Examples plus schema enforcement. Few-shot examples shape style but cannot guarantee a schema. When fields, types, and enums must hold, pair examples with structured outputs or strict tool use for enforced conformance."},
{n:33,domain:"D2",q:"A team migrating a working first-party Claude integration to the current Bedrock path worries they must rewrite request bodies and streaming parsing. Which of the following best describes what changes on bedrock-mantle?",ci:3,opts:[{t:"Request bodies use a Bedrock-specific InvokeModel schema that must be fully rewritten",e:"The mantle path shares the Messages body shape, so a full InvokeModel-schema rewrite is not required."},{t:"Streaming switches from SSE to websockets, requiring a new streaming consumer",e:"The mantle path uses the same SSE streaming as the first-party API, not websockets."},{t:"The messages array becomes a flat string, so content-block parsing must be removed",e:"The content-block structure is unchanged on mantle; messages remain a list of typed blocks."},{t:"Body and SSE match the first-party API, so endpoint, client, and model IDs change",e:"bedrock-mantle uses the same request body and SSE as the first-party Messages API, so migration mainly changes the endpoint, the client, and the model-ID prefix."}],o:"Mantle migration surface. The current bedrock-mantle endpoint carries the same Messages body shape and SSE event stream as the first-party API, so migrating mainly means changing the endpoint URL, the client class, and the model-ID prefix. Request bodies and streaming parsing do not need a rewrite."},
{n:34,domain:"D2",q:"A team runs a latency-critical classification service and also an internal experiment channel. Production must never shift behavior without review, while the experiment channel should always try the newest model. They are deciding how to reference the model in each. Which approach fits both needs?",ci:1,opts:[{t:"Use a floating alias everywhere so both stay on the newest model automatically",e:"A floating alias in production reintroduces exactly the silent behavior shifts production must avoid."},{t:"Pin an exact model ID in production and a floating alias in experiments",e:"Pinning an exact ID insulates production from silent shifts, while a floating alias in the experiment channel intentionally tracks the newest model. Each channel gets the stability or freshness its purpose requires."},{t:"Pin the same exact model ID in both so the two channels never diverge",e:"Pinning both denies the experiment channel the newest model it is meant to try."},{t:"Use a floating alias in production and pin the experiment channel to an old ID",e:"This inverts the needs, leaving production on a moving alias and the experiment stuck on an old version."}],o:"Match the reference to the channel's need. Pinning an exact model ID stabilizes production against silent release-driven shifts, while a floating alias intentionally tracks the newest model where experimentation is the goal. The best answer serves each channel's distinct requirement."},
{n:35,domain:"D7",q:"An audit log revealed that an agent performed an unauthorized fund transfer, but only after the money had already moved. Which control would have PREVENTED the action rather than merely recording it?",ci:3,opts:[{t:"More detailed access logging capturing every field of the request",e:"More logging still only records the action; it does not stop an unauthorized transfer."},{t:"A daily review of the audit trail by a compliance analyst",e:"A daily review happens after the money has already moved."},{t:"An alert that fires whenever a large transfer is logged",e:"An alert on the logged event fires after execution and does not prevent it."},{t:"An identity and authorization check enforced before the transfer",e:"Monitoring and logging detect misuse after the fact; preventing it requires validating identity and authorizing the action before it executes. Enforcement must gate the action, not just record it."}],o:"Enforcement gates the action while monitoring only detects. Logging, reviews, and alerts all fire after an action has occurred and cannot prevent it. To stop an unauthorized transfer, identity validation and authorization must gate the action before it executes, with monitoring serving as the detection layer on top."},
{n:36,domain:"D8",q:"A large library of specialized procedures would bloat the context if all were loaded at once. The team wants each procedure present only when its description matches the current task. Which of the following most directly provides this?",ci:3,opts:[{t:"Rules in the memory file, one per procedure, loaded every session",e:"Rules are always-on and load every session, so a library of them would bloat context rather than load selectively."},{t:"A custom tool per procedure so each is callable at any time",e:"Custom tools execute actions and their definitions are all present; they do not conditionally load procedural instructions by task match."},{t:"An MCP server that injects all procedures as resources each request",e:"Injecting all procedures as resources on every request loads them regardless of relevance, defeating the goal of selective loading."},{t:"Skills, each loading only when its description matches the task",e:"Skills load only when their description matches the current task, so a large library stays out of context until a specific procedure is relevant. This on-demand triggering is what keeps a big set of procedures cheap on context."}],o:"Selective context loading. Skills are model-invoked on relevance, so a large library imposes context cost only for the procedure that matches the task at hand. Rules and injected resources load unconditionally, which is why they bloat context when the set is large."},
{n:37,domain:"D2",q:"A fintech must deploy a Claude assistant entirely inside its AWS environment, cannot send an Anthropic API key off its network, needs current best-practice integration, and wants extended thinking on Opus 4.8 for hard cases. An engineer drafts the design. Which of the following correctly fits all these infrastructure constraints?",ci:3,opts:[{t:"Use legacy InvokeModel with us prefixed profiles and budget_tokens thinking on Opus 4.8",e:"InvokeModel with us prefixed profiles is the legacy path, and budget_tokens thinking is rejected with a 400 on Opus 4.8, so this design fails on two counts."},{t:"Call the first-party API with an Anthropic key and adaptive thinking on Opus 4.8",e:"Sending an Anthropic API key violates the rule that no key may leave the network, so the first-party path is disqualified."},{t:"Use Vertex AI with Google credentials and enabled thinking on Opus 4.8",e:"Vertex is the Google Cloud surface, not AWS, and thinking.type enabled returns a 400 on Opus 4.8, which requires adaptive."},{t:"Use the bedrock-mantle endpoint with mantle client and adaptive thinking on Opus 4.8",e:"The current AWS-native integration is bedrock-mantle with the mantle client, keeping traffic inside AWS with no key leaving the network. On Opus 4.8 adaptive is the only supported thinking mode, so this design satisfies every constraint."}],o:"Current Bedrock path with adaptive thinking. Staying inside AWS with no key leaving the network and current best practice means the bedrock-mantle endpoint and mantle client, and on Opus 4.8 adaptive thinking is the only supported mode. Legacy InvokeModel, the first-party key path, Vertex, and budget_tokens or enabled thinking each break a stated constraint."},
{n:38,domain:"D3",q:"A user-level CLAUDE.md and a project-level CLAUDE.md give conflicting instructions. Which one takes precedence in Claude Code?",ci:3,opts:[{t:"The user-level file at the home .claude folder, because personal settings always win",e:"This inverts the precedence; the project-level file overrides the user-level one where they conflict, not the reverse."},{t:"Neither file applies; conflicting instructions are dropped and ignored entirely",e:"Conflicts are resolved by precedence, not discarded; the project-level instruction wins rather than both being ignored."},{t:"Whichever CLAUDE.md file was loaded most recently during the session",e:"Precedence is by scope, not load order; the project-level file overrides the user-level file regardless of when each loaded."},{t:"The project-level file at the repo root, which overrides user-level rules",e:"CLAUDE.md layers by scope, and the project-level file at the repo root overrides conflicting user-level instructions, giving the whole team consistent behavior."}],o:"Project overrides user. CLAUDE.md files layer by scope: user-level in the home directory, project-level at the repo root, and subdirectory files. Where they conflict, the project-level instruction overrides the user-level one, not the reverse, so a repo can enforce consistent team behavior. CLAUDE.md content also counts against the context window."},
{n:39,domain:"D1",q:"A team is hardening a Claude Code agent used across the whole engineering org. They need destructive commands blocked before execution, sensitive actions gated for human approval, every tool result logged, and the same behavior applied consistently for every teammate. Which approach best delivers all four?",ci:3,opts:[{t:"Put the rules in CLAUDE.md so the model applies them, committed to version control",e:"CLAUDE.md guidance is probabilistic and cannot deterministically block or gate actions, even when committed."},{t:"Register the hooks in each developer's personal settings.local.json instead",e:"settings.local.json is personal and uncommitted, so behavior would not be consistent across the org."},{t:"Use PostToolUse hooks for all four behaviors and commit them to the repo",e:"PostToolUse fires after execution, so it cannot block destructive commands or gate them for approval."},{t:"Put PreToolUse deny/ask and PostToolUse logging hooks in committed settings.json",e:"PreToolUse deny blocks destructive commands, PreToolUse ask gates sensitive actions, PostToolUse logs results, and committing project settings.json makes the behavior consistent org-wide."}],o:"Production hardening with layered hooks. Blocking uses a PreToolUse deny, approval gating uses a PreToolUse ask, and auditing uses a PostToolUse log, all registered in project settings.json committed to version control so every teammate gets identical, deterministic behavior."},
{n:40,domain:"D2",q:"An app injects retrieved knowledge-base documents directly into the user turn alongside the developer's instructions, and a document's text occasionally overrides those instructions. What is the BEST fix within the message structure?",ci:2,opts:[{t:"Move all instructions into the assistant turn so they are read last by the model",e:"Relocating instructions to the assistant turn does not mark the document as data and leaves the injection path open."},{t:"Concatenate documents and instructions together into a single combined system string",e:"Merging everything into one string removes the boundary and makes injected text harder to isolate, not easier."},{t:"Wrap the retrieved content in labeled tags marking it as data, not instructions",e:"Explicit content boundaries, wrapping retrieved text in labeled tags, tell the model to treat the document as data rather than commands, which is the core defense against the injection described."},{t:"Delete the system prompt entirely and rely on user-turn ordering alone",e:"Removing the system prompt weakens instruction placement and still does not delimit the untrusted document."}],o:"Delimit untrusted content as data. Retrieved documents are untrusted input, and placing them inline with instructions lets their text act as commands. Wrapping the content in labeled boundary tags marks it as data, which is the structural defense against this prompt-injection path."},
{n:41,domain:"D6",q:"A note-taking app lets users store arbitrary text, later fed into a Claude prompt that can call a delete-account tool. A stored note reads delete this account now. Which combination BEST prevents unwanted action?",ci:1,opts:[{t:"Sanitize the note text so the deletion phrase can never survive processing",e:"No sanitization reliably strips every dangerous phrase, so it cannot stand alone here."},{t:"Delimit the note as untrusted data, gate the delete tool behind approval",e:"Delimiting the note as untrusted data plus gating the delete tool behind approval combines a data boundary with a capability check on an irreversible action. Layering these prevents an injected phrase from silently triggering deletion."},{t:"Trust the note because the account owner authored it originally",e:"Original authorship does not make stored content safe; it is still untrusted input at use time."},{t:"Raise the reasoning effort so the model judges intent before deleting",e:"Raised effort does not dependably block an injected instruction from triggering an irreversible action."}],o:"Defense in depth. Treating stored notes as untrusted and requiring approval before an irreversible delete layers a boundary with an enforced gate. Neither sanitization nor trust in authorship alone prevents the unwanted action."},
{n:42,domain:"D7",q:"An agent can modify customer records through a tool. The team wants to ensure no unauthorized change is ever made to those records. Which security property does this requirement primarily protect?",ci:2,opts:[{t:"Confidentiality, which keeps data from unauthorized readers and viewers",e:""},{t:"Privacy, which governs lawful and minimal use of personal data",e:""},{t:"Integrity, which guards data and actions from unauthorized change",e:"Integrity is the property that protects data and actions from unauthorized modification. Preventing unauthorized changes to records is exactly an integrity control, distinct from who may read the data."},{t:"Availability, which keeps the record service reachable under heavy load",e:""}],o:"Integrity protects against unauthorized modification. Confidentiality is about who can read, integrity is about who can change, and privacy is about proper use of personal data. A rule that no unauthorized change is made to records is an integrity requirement, and a control for one property does not automatically satisfy the others."},
{n:43,domain:"D5",q:"You are architecting a document-processing pipeline with three stages: high-volume category tagging that is simple, field extraction of moderate difficulty, and a final synthesis step requiring deep reasoning. The tagging and extraction stages are latency-tolerant and cost-sensitive. Which tier and processing assignment is best across the pipeline?",ci:3,opts:[{t:"Opus for all three stages to maximize quality, with every stage run in real time.",e:"Opus on simple tagging and extraction over-provisions those stages and ignores the cost-sensitive, latency-tolerant constraint."},{t:"Haiku for every stage to minimize cost, accepting weaker synthesis output at the end.",e:"Haiku on the deep-reasoning synthesis step fails the quality bar where the hardest work happens."},{t:"Sonnet for all three stages as a supposedly safe balance, with every stage processed as a real-time synchronous request rather than batched.",e:"One tier for all stages under-serves synthesis or over-serves tagging, and real-time forfeits batch savings on tolerant stages."},{t:"Haiku for tagging, Sonnet for extraction, Opus for synthesis, running the latency-tolerant stages through the Batches API.",e:"Assigning each stage its lightest sufficient tier gives Haiku for simple tagging, Sonnet for moderate extraction, and Opus for hard synthesis. Running the latency-tolerant stages through the Batches API adds cost savings where latency does not matter."}],o:"Per-stage tiering plus batch. A pipeline should assign each stage the lightest tier that meets its bar: Haiku for simple tagging, Sonnet for moderate extraction, Opus for hard synthesis. Latency-tolerant, cost-sensitive stages further benefit from the Batches API at half cost, combining tier selection with the right processing mode."},
{n:44,domain:"D1",q:"A PreToolUse hook runs but returns an empty object with no permissionDecision set. The developer expects the tool call to be blocked by default. What actually happens to the pending call?",ci:1,opts:[{t:"The call is blocked, because a missing decision quietly defaults to deny",e:"There is no implicit deny; an empty object leaves the call allowed, not blocked."},{t:"The call proceeds unchanged, since an empty object leaves it allowed",e:"With no permissionDecision set, an empty object leaves the pending call unchanged, so it proceeds as allowed."},{t:"The call pauses and asks the human user to confirm before proceeding",e:"An ask pause requires explicitly setting permissionDecision to ask; an empty object does not."},{t:"The call is deferred until a later hook makes a decision",e:"Defer requires an explicit defer decision; an empty object does not defer the call."}],o:"Default behavior of an empty decision. A PreToolUse hook that returns an empty object with no permissionDecision leaves the pending call unchanged, meaning allowed. Blocking, asking, or deferring each require explicitly setting that value."},
{n:45,domain:"D5",q:"A high-volume classification endpoint on a supported Claude model must minimize latency and cost, and the task is simple and well-defined. For the effort setting, the BEST choice is:",ci:2,opts:[{t:"max effort, to guarantee the highest possible accuracy on every single item",e:"max effort over-provisions a simple task, raising latency and cost with little accuracy benefit."},{t:"xhigh effort, because reasoning throughput generally improves as the effort level rises",e:"Higher effort adds work and latency; throughput does not improve as effort rises for a simple task."},{t:"a lower effort level, since a simple task does not justify high or max spend",e:"A simple, well-defined classification task meets the quality bar at a lower effort level, which minimizes latency and cost. Spending high or max effort here wastes budget for no meaningful gain."},{t:"the default high effort, which is strictly required for all classification tasks",e:"High is the default but is not required; a simple task can run at a lower level to save latency and cost."}],o:"Right-size effort. Effort should match task difficulty, since a simple, well-defined job does not justify high or max reasoning. For a latency- and cost-sensitive classification endpoint, a lower effort level that still meets the quality bar is the best choice."},
{n:46,domain:"D2",q:"A developer defines a custom /deploy-review command as a Markdown file and asks whether it will also work when calling the Messages API directly. What is correct?",ci:0,opts:[{t:"Slash commands, a Claude Code feature, not in raw API calls",e:"A custom command is a Markdown file in a Claude Code commands directory whose filename sets the keyword. The Messages API has no notion of slash commands, so it will not fire there."},{t:"Slash commands transfer automatically to any SDK request",e:"SDKs wrap the REST API, which has no slash-command concept. The command exists only inside the Claude Code session."},{t:"The API recognizes any command placed in a commands directory",e:"The API does not scan a commands directory. That resolution is done by the Claude Code harness, not the API."},{t:"Slash commands run on claude.ai but never in Claude Code",e:"This is backward. Custom slash commands are defined by files in Claude Code, not the web chat surface."}],o:"Slash commands do not exist at the API layer. A custom command is a Claude Code extension whose Markdown file name and location set its keyword and scope. Because the Messages API and its SDK wrappers have no command resolution step, a developer porting a workflow to the API must reimplement the command's logic as an explicit prompt rather than expecting the shortcut to carry over."},
{n:47,domain:"D2",q:"A platform team is standardizing a repository that ships a plugin adding a deploy command, a shared permission set, an approval hook for the deploy action, and natural-language coding rules. New engineers keep hitting failures because the plugin's dependencies and the shared config are set up inconsistently. The team wants a reproducible onboarding where cloning the repo yields identical behavior for everyone. Which approach best achieves this?",ci:3,opts:[{t:"Let each engineer install the plugin and its dependencies however they prefer after cloning",e:"Per-engineer installation reproduces the inconsistent setups that cause the onboarding failures."},{t:"Put the permissions, hook, and dependencies into each engineer's settings.local.json for isolation",e:"settings.local.json is personal and uncommitted, so it cannot share permissions, a hook, or dependencies across the team."},{t:"Document the setup only in a wiki page and rely on engineers to follow it manually",e:"A wiki relies on manual adherence and does not make the configuration reproducible from the repository itself."},{t:"Track plugin dependencies and commit settings.json and CLAUDE.md so a clone behaves identically",e:"Reproducibility comes from resolving and sharing plugin dependencies plus committing project settings.json and CLAUDE.md. Cloning then yields the same permissions, approval hook, dependencies, and behavioral rules for every engineer."}],o:"Reproducibility from shared config and dependencies. Committing project settings.json and CLAUDE.md and resolving the plugin's dependencies into shared configuration makes a clone reproduce the same permissions, approval hook, rules, and capabilities for everyone. Per-engineer installs, personal files, or a wiki cannot guarantee that consistency."},
{n:48,domain:"D1",q:"You are hardening an Agent SDK service for production: it must accept follow-up user input mid-run, never loop forever on hard tasks, and use agents defined with only the required configuration. A reviewer wants the minimal correct setup across all three concerns. Which combination is correct?",ci:2,opts:[{t:"Single-message input, no cap since the model self-terminates, and a full tools list per agent",e:"Single-message input blocks mid-run follow-ups, and trusting self-termination is the unbounded-loop defect. A full tools list is also not required."},{t:"API SSE streaming, a lowered effort level as the loop bound, and a model field on each agent",e:"SSE is output streaming, not an input mode; effort does not bound loop turns; and a model field is optional on an agent."},{t:"Streaming input, an explicit turn or budget cap, and agents with just description and prompt",e:"Streaming input supports mid-run follow-ups, an explicit turn or budget cap bounds the loop deterministically, and an AgentDefinition needs only description and prompt. This is the minimal correct setup across all three concerns."},{t:"Batch input, a 24-hour window as the loop bound, and permissionMode on each agent",e:"Batch input is a bulk asynchronous job unsuited to interactive follow-ups, and a 24-hour window is not a loop bound; permissionMode is optional."}],o:"Production loop setup. The correct minimal setup uses streaming input for mid-run follow-ups, an explicit turn or budget cap to bound the loop, and AgentDefinitions with only description and prompt. Single-message input, effort as a bound, and required extra fields each miss one of the three concerns."},
{n:49,domain:"D3",q:"A developer just finished a bug fix and now wants to begin an unrelated feature in the same running session, without the bug fix history influencing the new work or spawning a separate session. Which action best fits?",ci:0,opts:[{t:"Run /clear to reset the conversation, giving the new feature clean context this session",e:"/clear resets the conversation within the current session, so the unrelated feature starts with a clean context and no separate session is opened."},{t:"Resume a prior session, which reopens old history rather than clearing the current one",e:"Resume reopens a previous session with its history, the opposite of starting fresh in the current one."},{t:"Wait for compaction to summarize and silently drop the finished bug fix from context",e:"Compaction condenses history to save tokens but does not deliberately clear a finished task on demand."},{t:"Edit the project CLAUDE.md to delete the bug fix instructions before continuing the work",e:"CLAUDE.md holds standing project rules, not the live conversation, so editing it does not clear session history."}],o:"/clear resets within a session. When a developer wants a clean slate for new work inside the same running session, /clear resets the conversation, whereas resume reopens a prior session and compaction merely condenses history. Matching the state action to the goal keeps context focused."},
{n:50,domain:"D8",q:"A teammate claims an MCP server must be deployed as a remote web service. You are authoring one for a single-user local tool. Which statement is correct about MCP server deployment?",ci:1,opts:[{t:"An MCP server must always run as a networked remote HTTP service",e:"This is the misconception in the stem; MCP servers can also run locally as a child process."},{t:"A server can run locally as a child process or a remote service",e:"An MCP server can be a local child process over stdio or a remote networked service. The transport and deployment follow the context, not any rule that servers must be remote."},{t:"Local MCP servers cannot register tools, only resources and prompts for clients",e:"Deployment location does not restrict which primitives a server exposes; local servers can register tools too."},{t:"Only remote MCP servers may expose all three of the MCP primitives",e:"All three primitives are available regardless of whether the server runs locally or remotely."}],o:"An MCP server can run locally as a child process or as a remote service. Nothing in MCP requires a server to be a remote web service; it can be a local child process over stdio or a networked service, and the choice follows the deployment context. Primitive availability does not depend on where the server runs."},
{n:51,domain:"D8",q:"A company is deploying an MCP server as part of a customer-facing product. Many users on different machines will connect concurrently, the exposed tools act on sensitive account data, and each server should read only its own tenant's directory. Which combination BEST fits these production constraints?",ci:0,opts:[{t:"HTTP transport, OAuth 2.0, and roots-scoped filesystem access per tenant",e:"A remote, multi-user, sensitive deployment needs a networked HTTP transport, OAuth 2.0 to authenticate clients, and roots to scope each server to only its tenant's paths. Together they satisfy all three stated constraints."},{t:"stdio transport with OAuth 2.0 to authenticate the many concurrent users",e:"stdio is local single-user and cannot serve many concurrent users on different machines, so it fails the core deployment constraint."},{t:"HTTP transport with a shared API key and unrestricted filesystem access",e:"A shared API key is not the specified networked auth flow, and unrestricted filesystem access violates the per-tenant scoping requirement."},{t:"stdio transport with roots scoping and no authentication for internal simplicity",e:"stdio cannot serve many remote concurrent users, and sensitive tools require authentication rather than none."}],o:"Layering transport, authentication, and access scope. A production, multi-user, sensitive deployment requires a networked HTTP transport for reach, OAuth 2.0 to authenticate clients, and roots to confine each server to its tenant's paths. stdio cannot serve concurrent remote users, and a shared key with open filesystem access fails the security constraints."},
{n:52,domain:"D1",q:"An orchestrator spawns a subagent that discovers a fact the whole application will need across future sessions. The developer wants that fact to survive session boundaries and context compaction. Where should the fact be stored?",ci:2,opts:[{t:"In the subagent's context window, which the parent can reopen later",e:"A subagent's context is ephemeral and cannot be reopened by the parent. It does not survive session boundaries."},{t:"In the manager's running conversation history, relying on it never truncating",e:"In-context history is additive and truncates under compaction or session end. It is not durable storage for long-lived facts."},{t:"In external, durable agent memory that persists outside the live context",e:"Durable, long-lived state belongs in external agent memory that lives outside the context window. It survives compaction and session boundaries, unlike ephemeral in-context history."},{t:"In a CLAUDE.md rules file that the agent rewrites during the run",e:"CLAUDE.md is static developer-authored guidance loaded into context, not a runtime store the agent rewrites for durable state."}],o:"Durable memory versus context. In-context state is lost when the window truncates or the session ends. A fact needed across sessions must live in external agent memory, which persists through compaction and session boundaries; relying on in-context history is an architectural defect."},
{n:53,domain:"D1",q:"In production, an agent occasionally keeps calling tools and never returns, burning tokens until a request times out. The developer wants a deterministic stop that surfaces a clear signal when the agent runs too long. Which change MOST directly addresses this?",ci:2,opts:[{t:"Lower the model effort level so each turn produces fewer tool calls",e:"Reducing effort does not guarantee the loop terminates. It changes per-turn work, not the missing termination bound."},{t:"Retry the whole request with backoff whenever it exceeds the timeout",e:"Retrying an unbounded loop reproduces the same runaway behavior and wastes more budget. It treats the symptom, not the cause."},{t:"Set a turn or budget cap so the loop stops, raising a defined error",e:"A turn or budget cap gives the loop a deterministic termination bound. Hitting the cap yields a specific error subtype, the clear signal the developer wants."},{t:"Switch from streaming input to single-message input for the loop",e:"Input mode does not control loop termination. Switching it does nothing to bound the runaway loop."}],o:"Loop termination. An agent loop needs explicit termination bounds; without them, it can run indefinitely. Setting a turn or budget cap stops the loop deterministically and produces a defined error subtype, which is the clear signal an operator can act on. Retrying an unbounded loop only repeats the failure."}
];
let currentFilter = 'all';
let allExpanded = false;
let userAnswers = {};
let answered = {correct: 0, wrong: 0};
let lastAnsweredQn = null;
function renderQuestions() {
var container = document.getElementById('questionsContainer');
container.innerHTML = '';
var filtered = questions;
if(currentFilter === 'correct') filtered = questions.filter(function(q){ return userAnswers[q.n] && userAnswers[q.n].isCorrect; });
else if(currentFilter === 'wrong') filtered = questions.filter(function(q){ return userAnswers[q.n] && !userAnswers[q.n].isCorrect; });
else if(currentFilter === 'unanswered') filtered = questions.filter(function(q){ return !userAnswers[q.n]; });
filtered.forEach(function(q) {
var card = document.createElement('div');
card.className = 'q-card' + (userAnswers[q.n] ? (userAnswers[q.n].isCorrect ? ' answered-correct' : ' answered-wrong') : '');
if(allExpanded || q.n === lastAnsweredQn) card.classList.add('open');
var statusTag = userAnswers[q.n] ? (userAnswers[q.n].isCorrect ? 'correct' : 'wrong') : 'unanswered';
var statusText = userAnswers[q.n] ? (userAnswers[q.n].isCorrect ? 'Correct' : 'Incorrect') : 'Unanswered';
var optionsHtml = q.opts.map(function(opt, i) {
var selected = userAnswers[q.n] && userAnswers[q.n].selected === i;
var isCorrect = i === q.ci;
var optClass = 'option-btn';
if(selected && isCorrect) optClass += ' selected-correct';
else if(selected && !isCorrect) optClass += ' selected-wrong';
else if(userAnswers[q.n] && isCorrect) optClass += ' reveal-correct';
else if(userAnswers[q.n] && !selected) optClass += ' reveal-neutral';
var check = selected ? '✓' : (userAnswers[q.n] && isCorrect ? '✓' : '');
var dis = userAnswers[q.n] ? 'disabled' : '';
return '<button class="' + optClass + '" ' + dis + ' onclick="selectAnswer(' + q.n + ',' + i + ')">'
+ '<div class="radio-circle">' + check + '</div>'
+ '<div class="option-text-wrap">'
+ '<div class="option-main">' + opt.t + '</div>'
+ '<div class="option-explanation">' + opt.e + '</div>'
+ '</div></button>';
}).join('');
var resultHtml = userAnswers[q.n] ? (
'<div class="result-banner ' + (userAnswers[q.n].isCorrect ? 'correct' : 'wrong') + ' visible">'
+ (userAnswers[q.n].isCorrect ? '✓ Correct!' : '✕ Incorrect - see explanation below')
+ '</div>'
+ '<div class="overall-box visible"><strong>Explanation:</strong><br>' + q.o + '</div>'
) : '';
card.innerHTML =
'<div class="q-header" onclick="toggleCard(this)">'
+ '<div class="q-num-badge">' + q.n + '</div>'
+ '<div class="q-title-wrap">'
+ '<div class="q-label">Question ' + q.n + ' <span class="status-tag ' + statusTag + '">' + statusText + '</span></div>'
+ '<div class="q-text">' + q.q + '</div>'
+ '<div class="q-meta"><span class="domain-chip">' + q.domain + '</span>' + q.cat + '</div>'
+ '</div>'
+ '<div class="chevron">▼</div>'
+ '</div>'
+ '<div class="q-body">'
+ '<div class="options-list">' + optionsHtml + '</div>'
+ resultHtml
+ '</div>';
container.appendChild(card);
});
}
function toggleCard(header) { header.closest('.q-card').classList.toggle('open'); }
function selectAnswer(qn, optIndex) {
var q = questions.find(function(x){ return x.n === qn; });
var isCorrect = optIndex === q.ci;
userAnswers[qn] = {selected: optIndex, isCorrect: isCorrect};
lastAnsweredQn = qn;
if(isCorrect) answered.correct++;
else answered.wrong++;
updateStats();
renderQuestions();
}
function toggleAll() {
allExpanded = !allExpanded;
document.querySelector('.action-btn.expand').textContent = allExpanded ? 'Collapse All' : 'Expand All';
renderQuestions();
}
function applyFilter(f, btn) {
currentFilter = f;
document.querySelectorAll('.filter-btn').forEach(function(b){ b.classList.remove('active'); });
btn.classList.add('active');
renderQuestions();
}
function updateStats() {
var total = Object.keys(userAnswers).length;
var pct = total === 0 ? 0 : Math.round(answered.correct * 100 / total);
document.getElementById('scoreVal').textContent = pct + '%';
document.getElementById('scoreLbl').textContent = answered.correct + ' / ' + total;
document.getElementById('dotCorrect').textContent = answered.correct;
document.getElementById('dotWrong').textContent = answered.wrong;
document.getElementById('dotSkipped').textContent = 53 - total;
document.getElementById('progressLabel').textContent = total + ' / 53 answered';
document.getElementById('progCorrect').style.width = (answered.correct * 100 / 53) + '%';
document.getElementById('progWrong').style.width = (answered.wrong * 100 / 53) + '%';
}
function openModal() { document.getElementById('resetModal').classList.add('show'); }
function closeModal() { document.getElementById('resetModal').classList.remove('show'); }
function confirmReset() {
userAnswers = {};
answered = {correct: 0, wrong: 0};
closeModal();
updateStats();
renderQuestions();
}
updateStats();
renderQuestions();
</script>
</body>
</html>