CCDV-F - Prompt and Context Engineering - Section 6.1

Apply context and memory management techniques to Claude applications.

Published skill weight 3.8 percent. Covers context window management, preventing context drift and context bloat through tool output pruning and compaction, and isolating context through subagents or a multi-step agentic workflow so that one verbose phase cannot poison the rest of a session.

context window managementcontext drift and bloattool output pruningcompactioncontext isolation through subagents

Practice question for this objective

Free samplePrompt and Context Engineeringmedium

A release monitoring assistant calls a tool that fetches a build dashboard page, and each result is several thousand lines of raw markup of which about ten lines carry the status the assistant reasons over. A run makes roughly fifteen such calls, and the team measures that most runs exhaust the working context before the final report is written. Findings for earlier builds are recorded as short notes as the run proceeds, and cost per run must not rise. Select TWO changes that address the stated cause.

  • AHave the tool handler extract the status lines from the fetched page and return those, so the raw markup never enters the conversation in the first place. Correct
  • BDrop the superseded tool results for builds whose finding note has already been recorded, keeping the note and letting the older payloads fall out of the request history. Correct
  • CLet the conversation run as it does and rely on compaction to summarise the accumulated markup once the working context approaches its limit near the end of a run.
  • DDispatch one subagent per build so each fetch happens in an isolated context, and have the coordinator receive each subagent's raw page result in full afterwards.
  • EReduce the ceiling on generated output for every request so that each assistant turn is shorter and the accumulated conversation grows more slowly across the run.
Verbose tool results are cured by pruning the payload at the handler and dropping superseded results, not by compaction or isolation. Context exhaustion driven by tool payloads is a bloat problem, and bloat is fixed where the payload enters the conversation. Filtering the result in the handler and discarding results whose finding is already recorded both reduce what the request carries, without changing the number of calls or the quality of the final report.

Why A is correct: Correct. Pruning at the handler is the instrument for verbose tool output: the bulk is discarded before it is ever appended, so the context grows by the useful lines rather than by the whole page.

Why B is correct: Correct. Once a payload has yielded its finding it carries no further value, so removing it from the history recovers capacity while the run keeps the result it actually needs.

Why C is wrong: Tempting because compaction does reclaim room in a long conversation, but it is the wrong instrument here: it summarises material that should never have been carried, and the payloads keep arriving at the same rate.

Why D is wrong: Tempting because isolation genuinely protects a coordinator's context, but returning the raw page to the coordinator reinstates the bloat and adds a model turn for every build.

Why E is wrong: Tempting as a general trimming measure, but the growth comes from tool results rather than from assistant text, and a lower output ceiling truncates the final report instead.

See more CCDV-F practice questions, answers explained.

More in this domain

Back to all Prompt and Context Engineering objectives, or the CCDV-F cert hub.

Examworthy is not affiliated with or endorsed by Anthropic. Original, blueprint-aligned practice material only.