Skip to content
CCAF Preparation

Task Statement 5.1·Domain 515% of exam

Context Window Management

Manage conversation context to preserve critical information across long interactions

Jump to practice →

Official Exam Guide Objectives

Task 5.1: Manage conversation context to preserve critical information across long interactions.

Knowledge of

  • Progressive summarization risks: condensing numerical values, percentages, dates, and customer-stated expectations into vague summaries
  • The "lost in the middle" effect: models reliably process information at the beginning and end of long inputs but may omit findings from middle sections
  • How tool results accumulate in context and consume tokens disproportionately to their relevance (e.g., 40+ fields per order lookup when only 5 are relevant)
  • The importance of passing complete conversation history in subsequent API requests to maintain conversational coherence

Skills in

  • Extracting transactional facts (amounts, dates, order numbers, statuses) into a persistent "case facts" block included in each prompt, outside summarized history
  • Extracting and persisting structured issue data (order IDs, amounts, statuses) into a separate context layer for multi-issue sessions
  • Trimming verbose tool outputs to only relevant fields before they accumulate in context (e.g., keeping only return-relevant fields from order lookups)
  • Placing key findings summaries at the beginning of aggregated inputs and organizing detailed results with explicit section headers to mitigate position effects
  • Requiring subagents to include metadata (dates, source locations, methodological context) in structured outputs to support accurate downstream synthesis
  • Modifying upstream agents to return structured data (key facts, citations, relevance scores) instead of verbose content and reasoning chains when downstream agents have limited context budgets

What You Need to Know

What reaches the context window decides whether a Claude-based system holds together. Multi-turn conversations, multi-agent pipelines, long-document extraction — each one lives or dies on that. The failures are not abstract either: the support agent that has forgotten the refund amount, the research pipeline that drops its citations, the extraction that loses precision on exactly the fields anyone cared about.

The Progressive Summarisation Trap

Long conversations tempt you into compressing earlier turns to recover budget. It is a trap, and a specific one: summarisation destroys precisely the categories of information that transactional systems depend on — figures, dates, percentages, and the expectations a customer has stated aloud.

Here is how it plays out. A customer contacts support about a refund:

Turn 3: "I'd like a refund of $247.83 for order #8891 placed on March 3rd"

After summarisation, this becomes:

Summary: "Customer wants a refund for a recent order"

Everything needed to actually issue the refund — the amount, the order, the date — has gone, and what remains is a description of the conversation rather than its content. This is not an unlucky example. Summarising is lossy in exactly this direction by construction: specifics are what compression removes.

The fix: persistent case facts blocks. Pull the transactional facts — amounts, dates, order numbers, statuses — into a structured block carried in every prompt and held outside the summarised history. Nothing ever compresses it, so it survives whatever happens to the conversation around it.

{
  "caseFactsBlock": {
    "customerId": "C-4421",
    "issues": [
      {
        "orderId": "#8891",
        "orderDate": "2024-03-03",
        "refundAmount": "$247.83",
        "status": "pending_refund",
        "itemDescription": "Wireless headphones — defective"
      }
    ]
  }
}

Where one conversation covers several problems at once, give each its own entry in that layer rather than letting them share a narrative. Kept separate, one issue's order number cannot migrate onto another during compression — which is what cross-contamination looks like in practice.

The "Lost in the Middle" Effect

Position matters. What sits at the start and end of a long input is attended to reliably; what sits in the middle can be weighted lightly or missed altogether. The effect is well documented across large language models, and it governs how aggregated input should be laid out.

The fix is structural, not prompt-based. Lead with a summary of the key findings, then present the detail under explicit headers. Feeding a synthesis agent the output of three research subagents means opening with the conclusions and following with the material they came from, each part clearly bounded.

## Key Findings Summary
- Source A: 12% market growth in renewable sector (2023)
- Source B: Patent filings increased 34% year-on-year
- Source C: Regulatory framework delayed until Q3 2025

## Detailed Findings

### Source A: Market Analysis Report
[Full details here...]

### Source B: Patent Database Analysis
[Full details here...]

### Source C: Regulatory Review
[Full details here...]

Tool Result Trimming

Tool output drains the budget quietly. An order lookup may return forty-odd fields — audit timestamps, warehouse codes, carrier identifiers, fulfilment centre references — where five bear on the refund being discussed. The other thirty-five do not merely cost tokens once; they sit in the history and are re-sent on every subsequent turn.

Trim verbose tool outputs to only relevant fields before they accumulate in context. Left undone, a multi-turn system silts up with stale output until nothing else fits. This is structural, not tidying.

const RELEVANT_FIELDS = [
  "order_id", "order_date", "total_amount", "return_eligible", "item_description",
];

function trimOrderResult(rawResult: Record<string, unknown>, relevantFields = RELEVANT_FIELDS) {
  return Object.fromEntries(
    Object.entries(rawResult).filter(([k]) => relevantFields.includes(k))
  );
}

Do it in a PostToolUse hook, or inside the tool itself — the requirement is only that it happens before the result joins the conversation. After that point there is no removing it, and it is paid for on every turn that follows.

Full Conversation History

The Claude API holds no state between requests, so each one carries the entire conversation. Drop earlier messages and the model loses the thread, because there is no server-side session quietly remembering them on your behalf.

Which sets up the tension this task statement exists to resolve: coherence wants everything, and the window grows with every turn. The case facts block is what reconciles them — narrative can be summarised freely once the facts that matter are held somewhere summarisation does not reach.

Upstream Agent Optimisation

In a multi-agent pipeline, what an upstream agent finds natural to return is rarely what a downstream agent needs. Reasoning chains and raw content arrive at a synthesis agent whose budget is finite, and the reasoning is unusable to it — it cannot act on how another agent reached a conclusion, only on the conclusion.

Modify upstream agents to return structured data — the claims, their sources, relevance scores — in place of prose and deliberation. Require the metadata that downstream work depends on, including dates, source locations and methodological context, so synthesis has what it needs to be accurate rather than merely fluent.

{
  "findings": [
    {
      "claim": "Renewable energy investment grew 12% in 2023",
      "source": "IEA World Energy Report 2024",
      "sourceUrl": "https://example.com/report",
      "relevanceScore": 0.92,
      "publicationDate": "2024-01-15"
    }
  ]
}

The saving in tokens is the obvious benefit and not the largest one. A downstream agent handed structure reads fields; handed prose, it re-derives them, and every re-derivation is a chance to get one wrong.

Prompt Caching

Caching addresses context economics from the other side: rather than reducing what the model reads, it stops you paying to reprocess the parts that never change. A cache_control breakpoint marks a stable prefix, the API keeps that prefix in processed form, and subsequent requests reuse it at a fraction of the input cost.

Matching runs from the beginning of the prompt forward, prefix by prefix, which makes layout decisive. Anything constant goes first — system instructions, tool definitions, long reference material — with the breakpoint closing that block. Anything that varies per request, the user's message above all, comes after it.

// The cache breakpoint goes on the last stable block. Everything volatile
// (the user's question) sits after it, so the prefix stays byte-identical.
const response = await client.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 4096,
  system: [
    { type: "text", text: LONG_STATIC_INSTRUCTIONS },
    { type: "text", text: REFERENCE_DOC, cache_control: { type: "ephemeral" } },
  ],
  messages: [{ role: "user", content: dynamicUserMessage }],
});

Order it the other way and the benefit vanishes completely rather than partially: a single varying token ahead of the static block changes the prefix, so nothing matches and every request pays in full. The window is short as well — an ephemeral breakpoint survives roughly five minutes from last use, which makes caching a tool for bursts of related requests rather than for material reused across a working day.

Deep Dive

Context window sizes per model, and the 1M-token default

The captured lesson content never states an actual number — this is the gap. As of the current model line-up, Claude Fable 5, Opus 5, and Sonnet 5 ship a 1,000,000-token context window; Claude Haiku 4.5 ships 200k. For every model with a 1M window, 1M is the default — there is no beta header to opt in, and long-context requests bill at standard pricing. Max output is 128k tokens for Fable 5, Opus 5, and Sonnet 5 (64k for Haiku 4.5) on the synchronous Messages API; the Message Batches API raises this to 300k output tokens on Opus/Sonnet with the output-300k-2026-03-24 beta header.

Sources: https://platform.claude.com/docs/en/about-claude/models/overview · https://platform.claude.com/docs/en/build-with-claude/context-windows (fetched 2026-07-30)

What counts toward the context window

The context window is "all the text a language model can reference when generating a response, including the response itself" — a working memory distinct from training data. Concretely, everything in the request counts: the system prompt, every message in messages (including tool results, images, and documents), and the tool definitions. The model's output for the turn — including its extended thinking — counts too. Cached prompt prefixes still occupy the window; prompt caching changes what you pay for those tokens, not whether they count. This is why untrimmed tool results (Task 5.1's central example) are a budget problem even when they're cheap to reprocess.

Sourceplatform.claude.com › context-windowsfetched 2026-07-30

Overflow behaviour: 400 error vs model_context_window_exceeded

If the input alone already exceeds the model's context window, the API returns a 400 invalid_request_error ("prompt is too long") on every model — there is no silent truncation. On Claude 4.5 models and newer, if input tokens plus max_tokens together exceed the window, the request is instead accepted, and if generation reaches the limit it stops with stop_reason: "model_context_window_exceeded" (earlier models return a validation error instead). To avoid both failure modes, the docs recommend the token counting API (POST /v1/messages/count_tokens) to estimate usage before sending a request; that endpoint is "free to use but subject to requests per minute rate limits", and token counting and message creation have "separate and independent rate limits".

Sources: https://platform.claude.com/docs/en/build-with-claude/context-windows · https://platform.claude.com/docs/en/build-with-claude/token-counting (fetched 2026-07-30)

Context rot: why more context is not automatically better

"As token count grows, accuracy and recall degrade, a phenomenon known as context rot. This makes curating what's in context just as important as how much space is available" — straight from the docs, and echoed by Anthropic's engineering team: context must be "treated as a finite resource with diminishing marginal returns" because LLMs draw on a limited "attention budget" that every added token depletes. Two causes are named: the n² pairwise attention relationships between tokens get stretched thin as sequences lengthen, and models simply see fewer long sequences than short ones in training. This is the mechanism behind the lost-in-the-middle effect and the reason a bigger context window is not a substitute for trimming and structuring what goes into it.

Sources: https://platform.claude.com/docs/en/build-with-claude/context-windows (the "context rot" definition) · https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents (attention budget and causes) (fetched 2026-07-30)

Context awareness: automatic token-budget tracking

Claude Sonnet 5, Sonnet 4.6, Sonnet 4.5, and Haiku 4.5 have built-in "context awareness": these models track their own remaining context window (their "token budget") throughout a conversation via budget tags the API injects automatically — there is nothing to enable. This lets the model itself factor "how much room is left" into decisions such as when to compress its own output or wrap up a turn, independent of any case-facts or trimming pattern the developer builds on top.

Sourceplatform.claude.com › context-windowsfetched 2026-07-30

Compaction: the official long-horizon technique, and its risk

Anthropic names the pattern this lesson's case-facts block is a variant of: compaction is "the practice of taking a conversation nearing the context window limit, summarizing its contents, and reinitiating a new context window with the summary." It is one of three long-horizon techniques (alongside structured note-taking and sub-agent architectures) for work that outlasts a single context window. The risk is explicit: "overly aggressive compaction can result in the loss of subtle but critical context whose importance only becomes apparent later" — exactly the failure mode this lesson calls the progressive summarisation trap. The lightest-touch form is "tool result clearing", which the post calls "one of the safest lightest touch forms of compaction" and notes was "most recently launched as a feature on the Claude Developer Platform". Separately, the API docs describe a beta server-side compaction feature, available for Claude 4.6 and later models, that "automatically summarizes earlier parts of the conversation on the server, so the conversation can continue past the context window limit".

Sources: https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents (compaction, note-taking, sub-agents, tool result clearing) · https://platform.claude.com/docs/en/build-with-claude/context-windows (beta server-side compaction) (fetched 2026-07-30)

Quick Reference

FactValue
Context window — Fable 5, Opus 5, Sonnet 51,000,000 tokens (default, no beta header)
Context window — Haiku 4.5200,000 tokens
Max output — Fable 5, Opus 5, Sonnet 5128k tokens (300k via Batches API beta on Opus/Sonnet)
What counts toward the windowSystem prompt + all messages (incl. tool results/images/docs) + tool definitions + output (incl. thinking)
Cached tokensStill count toward the window; caching changes cost, not window usage
Input alone > window400 invalid_request_error ("prompt is too long")
Input + max_tokens > window (4.5+ models)Request accepted; stops with stop_reason: "model_context_window_exceeded"
Stay-within-limits toolToken counting API, POST /v1/messages/count_tokens (free, separate rate limit)
Context rotAccuracy/recall degrade as token count grows — curate, don't just expand
Context awarenessSonnet 5/4.6/4.5 and Haiku 4.5 auto-track remaining token budget; nothing to enable
CompactionSummarise a conversation nearing the limit, reinitiate with the summary; risk = losing subtle context
Lightest-touch compactionTool result clearing (Developer Platform feature)
Server-side compactionBeta, Claude 4.6+, summarises earlier turns server-side to continue past the limit

Exam Traps

Practice Scenario

A customer support agent handles a multi-issue session. After several turns, the agent refers to 'your recent refund request' instead of the specific $247.83 refund for order #8891. The conversation history is being summarised between turns to manage context length. What is the most effective fix?

Build Exercise

Build a Persistent Case Facts Context Manager

Difficulty: Intermediate (2/4)

45 minutes

  1. Create a case facts extractor that identifies transactional data (amounts, dates, order numbers, statuses) from tool results

Why: The persistent case facts block is the single most important pattern in context window management. Extracting transactional facts into a structured block that is never summarised prevents the progressive summarisation trap from destroying critical numerical values and identifiers.

You should see: A function that takes raw tool output and returns a structured object containing only the transactional facts: customer ID, order numbers, amounts, dates, and statuses. Non-transactional narrative content should be excluded.

  1. Implement a persistent case facts block that is prepended to every prompt, outside summarised history

Why: The case facts block must persist across every turn regardless of what happens to the conversation history. It sits outside the summarised portion of the context, ensuring amounts, dates, and order numbers survive even when earlier conversation turns are compressed.

You should see: A prompt construction function that always includes the case facts block at the top of every message, followed by any summarised history, followed by the current turn. The case facts block should be clearly delimited with a section header.

  1. Build a tool result trimmer that filters order lookup responses from 40+ fields to only the 5 relevant return-related fields

Why: Untrimmed tool results are a silent context budget killer. An order lookup returning 40+ fields consumes tokens in every subsequent turn as conversation history grows. Trimming to relevant fields before results enter context is essential, not optional.

You should see: A trimming function that takes a raw tool result object and returns only the fields needed for the current task. The trimmed result should be 80-90% smaller than the original.

  1. Test with a multi-turn conversation where summarisation occurs and verify that transactional facts survive intact across all turns

Why: This validates that the persistent case facts pattern actually works. The exam tests whether you understand that progressive summarisation destroys specific amounts and dates, and the case facts block is the fix. You need to verify this empirically.

You should see: A 6-8 turn conversation where summarisation occurs after turn 4. After summarisation, the agent should still reference the exact refund amount ($247.83), order number (#8891), and date (March 3rd) from the case facts block. Without the block, these values would be lost to summarisation.

  1. Add key findings placement logic that positions summaries at the beginning of aggregated inputs to mitigate the lost-in-the-middle effect

Why: Models process information at the beginning and end of long inputs reliably, but findings buried in the middle may be missed. Placing key findings summaries at the start of aggregated inputs is a structural fix for this well-documented phenomenon.

You should see: An aggregation function that places a Key Findings Summary section at the top of combined inputs, followed by detailed results with explicit section headers. The key findings should be concise bullet points drawn from the detailed content.

Sources


Appendix A — Build Exercise Step Hints

Progressive hints revealed by the "Stuck? Get a nudge" control on each step.

Step 1. Create a case facts extractor that identifies transactional data (amounts, dates, order numbers, statuses) from tool results

Why: The persistent case facts block is the single most important pattern in context window management. Extracting transactional facts into a structured block that is never summarised prevents the progressive summarisation trap from destroying critical numerical values and identifiers.

You should see: A function that takes raw tool output and returns a structured object containing only the transactional facts: customer ID, order numbers, amounts, dates, and statuses. Non-transactional narrative content should be excluded.

Stuck? Get a nudge

Step 2. Implement a persistent case facts block that is prepended to every prompt, outside summarised history

Why: The case facts block must persist across every turn regardless of what happens to the conversation history. It sits outside the summarised portion of the context, ensuring amounts, dates, and order numbers survive even when earlier conversation turns are compressed.

You should see: A prompt construction function that always includes the case facts block at the top of every message, followed by any summarised history, followed by the current turn. The case facts block should be clearly delimited with a section header.

Stuck? Get a nudge

Step 3. Build a tool result trimmer that filters order lookup responses from 40+ fields to only the 5 relevant return-related fields

Why: Untrimmed tool results are a silent context budget killer. An order lookup returning 40+ fields consumes tokens in every subsequent turn as conversation history grows. Trimming to relevant fields before results enter context is essential, not optional.

You should see: A trimming function that takes a raw tool result object and returns only the fields needed for the current task. The trimmed result should be 80-90% smaller than the original.

Stuck? Get a nudge

Step 4. Test with a multi-turn conversation where summarisation occurs and verify that transactional facts survive intact across all turns

Why: This validates that the persistent case facts pattern actually works. The exam tests whether you understand that progressive summarisation destroys specific amounts and dates, and the case facts block is the fix. You need to verify this empirically.

You should see: A 6-8 turn conversation where summarisation occurs after turn 4. After summarisation, the agent should still reference the exact refund amount ($247.83), order number (#8891), and date (March 3rd) from the case facts block. Without the block, these values would be lost to summarisation.

Stuck? Get a nudge

Step 5. Add key findings placement logic that positions summaries at the beginning of aggregated inputs to mitigate the lost-in-the-middle effect

Why: Models process information at the beginning and end of long inputs reliably, but findings buried in the middle may be missed. Placing key findings summaries at the start of aggregated inputs is a structural fix for this well-documented phenomenon.

You should see: An aggregation function that places a Key Findings Summary section at the top of combined inputs, followed by detailed results with explicit section headers. The key findings should be concise bullet points drawn from the detailed content.

Stuck? Get a nudge

Appendix B — Interactive Study Prompts

Two prompts to paste into Claude. B1 drills the judgement the exam actually measures; B3 reviews the code you wrote for the Build Exercise above. The exam simulator between them is the interactive quiz on this page.

B1. Concept Check — Discrimination Drill

Prompt — paste into Claude

You are examining me for the Claude Certified Architect – Foundations (CCAR-F) exam, Domain 5: Context Management & Reliability (15% of the exam), Task Statement 5.1: Context Window Management. Use British English throughout.

What this exam actually measures. Not one item on the official exam asks what something is. Every item drops you into a production system that is already misbehaving, offers four defensible engineering responses, and asks which is best. The skill being tested is proportionality: fix the root cause with the cheapest instrument that gives the guarantee the situation demands. So do not quiz me on definitions. Make me choose between options that are both defensible, then attack whatever I chose.

How to run this session.

  • One question at a time. Stop and wait. Never answer your own question, and never move on until I have committed.
  • Never reveal which option is right before I commit to one.
  • Do not praise me. A correct answer earns "Yes" and the next question. If I am right for the wrong reason, say so — that is the failure that costs marks on exam day.
  • When I am wrong, quote the exact phrase in my answer that gave it away, correct it in one sentence, and move on. One correction at a time.
  • If I write something fluent but empty, name it: "That is a restatement, not a reason."
  • Set every scenario inside one of the exam's production contexts: the Customer Support Resolution Agent (Agent SDK, MCP tools get_customer, lookup_order, process_refund, escalate_to_human, held to an 80%+ first-contact resolution target), the Multi-Agent Research System (a coordinator delegating to web-search, document-analysis, synthesis and report-generation subagents that produce cited reports), Structured Data Extraction over batches of documents, or Code Generation with Claude Code over an unfamiliar repository.

Session plan — about twelve questions.

Round 1 — Anchor (1 question). One concrete question to check I have actually read the material. If I cannot answer it, stop the session and tell me to read the lesson before continuing.

Round 2 — Discrimination (5 questions). Each one: describe a symptom in one of the contexts above, with a number or a log observation in it. Offer exactly two responses, both defensible. Ask me to pick one and justify it in a single sentence. Then argue the case for the option I rejected as strongly as you can, and ask whether I am holding or changing my answer. Only after I answer that, tell me which is right and why the other one is the more tempting trap.

Round 3 — Proportionality (2 questions). Both turn on the size of the instrument, which is where this domain is decided: resolve it in the prompt or build infrastructure, absorb it or put a human on it. Ask the first where the cheap fix is genuinely enough — reordering an aggregated input, trimming a tool result, adding a facts block to the prompt — and a new summarisation service, a classifier or a bigger model would be over-engineering. Ask the second on a symptom that reads the same but where an incorrect refund amount is the cost of being wrong, so a probabilistic instruction to the model no longer buys the guarantee and enforcement in code — trimming and fact extraction in the tool layer or a PostToolUse hook — is what the situation demands. Tell me which was which only after I have answered both. If I reach for the elaborate option both times, or the cheap one both times, that is the finding — say so.

Round 4 — Code review (3 questions). Present a colleague's confident proposal containing one of the trap errors listed below, written the way a teammate would write it in a pull request. Ask me what is wrong with it. Do not signal that anything is wrong.

Round 5 — Verdict. Rate me green, amber or red on each concept below. Name the single weakness most likely to cost me marks, and give me one specific next action: a section of this lesson to re-read, or a step of the Build Exercise to redo. If I am not ready for this task statement, say so plainly.

Concepts in scope

  1. Progressive summarisation trap — compressing earlier turns systematically destroys exactly the values a transactional agent needs: amounts, dates, percentages, identifiers and customer-stated expectations collapse into a vague description of the request.
  2. Persistent case facts block — transactional facts extracted into a structured block that is included in every prompt and sits outside the summarised history, with one entry per issue when a customer raises several in one session.
  3. Lost in the middle — models handle the start and end of a long input reliably and may under-weight what is buried in between; the mitigation is structural (key findings first, explicit section headers), not an instruction to pay attention.
  4. Tool result trimming — an order lookup returning forty-plus fields when five are relevant keeps costing tokens on every later turn, so the result is cut down before it enters conversation history, not after.
  5. Stateless API, full history — every request carries the whole conversation because the server holds no session state, which is why the answer to a growing context is summarisation plus a protected facts block rather than deleting messages.
  6. Upstream agent optimisation — an upstream agent feeding a downstream one with a limited budget returns structured findings with metadata (key facts, citations, relevance scores, dates, source locations) instead of its reasoning chain.

Trap errors to plant in Round 4

  • Treating progressive summarisation as safe for transactional data, so the refund amount, the order number and the date get rounded off into "a recent order".
  • Answering the lost-in-the-middle effect by telling the model to pay attention to everything, rather than reordering the input so the findings sit at the top.
  • Keeping the full forty-field tool result in context on the grounds that the model might need one of those fields later.
  • Selectively truncating earlier messages to make room and expecting conversational coherence to survive it.

Stay inside the material above. If I raise something outside it, tell me it is out of scope for this task statement and return to the drill. Begin with Round 1.

B2. Exam Simulator

Exam simulator

Question 1 of 10

Scenario · Customer Support Resolution Agent

By turn nine of a multi-issue session your agent tells the customer "I'll get that recent refund moving" instead of naming the $247.83 refund for order #8891 placed on 3 March. Your pipeline condenses every turn older than four into a running summary. What change would most effectively address this?

B3. Build Coach — Code Review

The Build Exercise and its hint ladder are already on this page. This prompt is for the one thing the page cannot do: review the code you actually wrote.

Prompt — paste into Claude

You are a staff engineer reviewing my implementation of a build exercise for the Claude Certified Architect – Foundations exam, Domain 5, Task Statement 5.1: Context Window Management. Use British English throughout.

I am building a persistent case facts context manager: a component that lifts transactional facts out of tool results into a structured block, puts that block at the top of every prompt where summarisation cannot reach it, cuts verbose order lookups down to the fields the current task actually uses, and assembles aggregated inputs so the findings sit at the front instead of the middle.

It has to satisfy all of the following:

  • An extractor that turns raw tool output into just the transactional facts — customer identifier, order number, amount, date, status — and leaves narrative content behind.
  • Prompt construction that always places the delimited facts block first, then any summarised history, then the current turn.
  • A trimmer that reduces an order lookup from its forty-plus fields to the handful the task needs, an order-of-magnitude cut rather than a token saving.
  • A multi-turn run in which summarisation happens partway through and the agent still quotes the exact amount, order number and date afterwards.
  • Aggregation that opens with a short findings summary and then presents the detail under explicit section headers.

How to review.

  • Ask me to paste my code. If I have not pasted any, ask for it and nothing else. Do not write the implementation for me, do not offer a reference solution, and do not fill in a step I have skipped.
  • Work through the criteria above in order. For each one, quote the line of my code that satisfies it, or say plainly that nothing does.
  • Then hunt for the failure modes below. Each is a real production bug, not a style preference.
  • Rank everything you find: (1) would fail in production, (2) would lose marks on the exam, (3) style. Give me the first item under (1) and then stop — wait for my fix before giving me the next one.
  • If my code satisfies everything, do not congratulate me. Change the requirements — the customer now raises a second issue mid-conversation with its own order number and amount, and the first issue's status changes after that — and make me handle it.
  • If I ask you to just write it for me, refuse once and give me the smallest nudge that would unblock me instead.

Failure modes to probe

  • The facts block built once and then left to drift, so later tool results update the conversation but not the block, which goes stale while still reading as authoritative.
  • The block placed inside the region that gets summarised, so the one thing meant to survive compression is compressed along with everything else.
  • Trimming applied after the raw result has already been appended to history, which saves nothing on the turns where it would have mattered.
  • A single hard-coded field list reused for a task that needs different fields, so the agent silently loses data it was supposed to act on.
  • The findings summary written as a paraphrase of the detail below it rather than the specific numbers, so the top of the input carries no more signal than the middle.

Start by asking me for my code.