Study guides / CCDV-F

Quick reference

One condensed cheat-sheet per domain - the tables and rules worth re-reading right before the exam.

stop_reason Reference Table

Only stop_reason controls the loop. Content type, content text, and phrase-matching ("task complete") are never reliable signals - Claude can emit explanatory text in the same response as a tool_use block.

stop_reasonWhat it meansCorrect loop action
end_turnGenuinely finishedStop the loop, surface the result. The only value that means "done."
tool_useModel wants one or more tools executedExecute every tool_use block, append one tool_result per tool_use_id, continue
max_tokensCut off by your max_tokens settingTruncated, not finished - don't display it; retry with more room
model_context_window_exceededCut off by the conversation filling the context windowSame as max_tokens: don't display as final; address context growth (see 3.4)
stop_sequenceHit a custom stop sequence you configuredIntentional, controlled stop - not an error, not the same as the model deciding it's done
pause_turnLong-running turn with certain server-side toolsResubmit the conversation unchanged to continue - not an error, not completion
refusalModel declined on an otherwise normal responseSurface distinctly (human review, fallback path) - never retry blindly or show as a normal answer

Agentic Loop Anti-Patterns

Orchestration Pattern Selector

Default to single-agent. Reach for multi-agent only when you can name a concrete isolation or parallelism benefit that outweighs the coordination overhead and the roughly-multiplied token cost (N subagents ≈ N× the context each has to re-derive).

SignalPatternWhy
One well-scoped task, right tools availableSingle agentCheapest, simplest, no coordination overhead - the default
Heterogeneous subtasks (search, then analyse, then synthesise)Coordinator-subagentDifferent tools/context/jobs per subagent; coordinator integrates
Uniform, independent, parallelisable subtasks (same check, many files)Hub-and-spoke, spawned in parallelThroughput win; no specialisation needed
Independent subtasks run one at a time across sequential turnsAnti-pattern - parallelise insteadSequential invocation of independent work adds latency for no benefit

Tracing Multi-Agent Failures

Check the coordinator first. A subagent that executed correctly on what it was given still produces a bad-looking final result if the coordinator's decomposition or context-passing was the actual fault.

SymptomLikely root causeFix
Whole subtopics missing from the merged outputCoordinator's decomposition never named themFix the decomposition to enumerate full topic breadth before delegating - not "add more subagents"
A subagent can't cite sources / cite prior findingsCoordinator stripped metadata or didn't pass prior resultsPass findings in full, with attribution, explicitly into the subagent's prompt
A subagent references "the previous file's issues" it was never shownIsolation violated - nothing inherited automaticallyPass the actual prior content explicitly as part of the prompt
One subagent's output is factually wrong on its assigned, well-scoped taskGenuine subagent failureThe only case where fixing the subagent itself is the right move

Decomposition Strategy Cheat Sheet

SituationStrategyNotes
Step order knowable upfrontFixed sequential pipelineSimple to build/test - each step's prompt & output are stable and checkable in isolation
Next step depends on what was just found (unfamiliar codebase, open research)Dynamic adaptive decompositionThis is what an agentic loop already gives you - each tool choice is a decomposition decision
Several distinct objectives bundled in one prompt (summarise + extract + translate + flag)Decompose into sequential single-objective stepsFixes attention dilution - rewording the bundled prompt does not
A single coherent objective split at an arbitrary boundary (sentence 1, then sentence 2)Don't split furtherOver-decomposition: adds latency/cost/lost context with no attention-dilution problem to justify it

Granularity rule of thumb: one step = one checkable objective - something verifiable as done correctly or not from just that step's output. Always add a lightweight verification checkpoint between pipeline steps (schema check, count check, completeness pass) - an unchecked step just trusts bad upstream output and passes the error downstream.

Session Memory: Three Options

OptionWhen to useTrap it's not
Full carry-forward (keep appending)Task is genuinely continuingNot for unrelated follow-up topics - pays token cost and risks distraction from stale context
Fresh session, nothing carriedNew request unrelated to what came beforeStill isolated like a subagent - nothing recalled unless explicitly reinjected
Compact summary into a fresh sessionSome continuity matters (what was tried, what's open) but the raw transcript doesn't need to surviveNot the same as truncation - a summary is a judgment call about what matters, not a cut by position

Gate or No Gate? Decision Table

The question is never "is the model usually reliable enough?" It's whether the consequence of one single failure justifies a deterministic guarantee over a probabilistic one.

Consequence of one failureControlExample
Real money, legal/regulatory exposure, or irreversible actionCode-level deterministic gateRefund threshold requiring human sign-off; AML check before a transfer
Formatting preference, style guideline, occasional deviation doesn't matterPrompt-based guidance is fine"Prefer bullet points for lists" - a gate here is unneeded overhead

Pre- vs Post-Execution Checks

Check timingCan it prevent the action?Legitimate job
Pre-execution (e.g. PreToolUse hook)Yes - blocks or redirects before the tool runsEnforcement of a hard rule; the only kind that counts as prevention
Post-execution (e.g. PostToolUse hook)No - the action already happenedNormalisation (consistent date/status/currency shape) and audit/detection (logging, flag for review)