Free sample lesson ยท Context Management & Reliability
Preserve Durable Context
Where did order 8891 and its $247.83 refund go?
Lesson 1 of the Wondering course Context Management & Reliability
Overview: Preserve Durable Context
Learn how to design Claude systems that separate durable case facts from disposable context, maintain a strict context economy, and keep every claim traceable.
The Problem with Brittle Context
Imagine a support case where Order 8891 and a refund of $247.83 simply vanish. This happens when long conversations are summarized poorly.
Standard summaries often lose specific transactional details. A fluent narrative is not a reliable database.
- Fluent Narrative
- Durable Case Facts
Separating durable facts from disposable context preserves decisions. It keeps your material from becoming brittle as the history grows.
Building a Durable Case Block
Critical identifiers should live in a structured block. This block is preserved even when narrative history is compacted.
Include data like Order 8891, March 3, and $247.83. These facts remain stable while the conversation flows.
- Store Identifiers: Keep critical identifiers in a dedicated structured block.
- Protect Facts: Ensure key facts remain stable during narrative compaction.
- Update Continuously: Refresh the block whenever new facts emerge.
- Compaction plus protected facts
Update this block whenever new facts emerge.
Practicing Context Economy
A large context window is not an excuse for clutter. Trimming irrelevant data keeps the model focused on decision-relevant evidence.
When looking up an order, keep the ID, date, and amount. Discard warehouse audit fields or internal shipping logs.
Organize your context budget wisely. Request structured findings from upstream workers rather than full exploration transcripts.
Optimizing for Caching and Recovery
Place static instructions and reference material at the beginning. This creates a stable prefix for prompt caching.
Volatile content should follow static blocks. This allows the system to reuse cached data efficiently.
Design your system to recover visibly. Ensure every claim is traceable back to the preserved facts in your case block.
How to Apply It in Real Life
- Isolate Facts: Extract critical identifiers and monetary amounts into a persistent block.
- Trim Clutter: Remove non-essential tool logs and raw transcripts from the active window.
- Cache Prefixes: Place static reference rules at the very beginning of the prompt.
- Trace Claims: Ensure model outputs explicitly cite the preserved case block.
Check yourself
A fluent conversational summary _____ retains precise transactional details like order numbers and exact refund amounts across long histories.
- reliably
- unreliably
Answer: unreliably
Standard narrative summaries are prone to dropping specific transactional details over time. Critical facts must be stored in a dedicated structured block rather than relying on conversation summaries.
To optimize prompt caching efficiency, place static rules at the _____ of the prompt, followed by _____ content.
Answer: To optimize prompt caching efficiency, place static rules at the beginning of the prompt, followed by volatile content.
Static reference materials create a consistent prefix at the start of the prompt for caching, while frequently changing (volatile) content is placed afterward to maximize cache reusability.
An order lookup tool returns the order ID, transaction date, total amount, customer eligibility, and detailed internal warehouse audit logs. How should you format this data for the model's active context window?
- Preserve the order ID, date, amount, and eligibility, while dropping the warehouse audit logs.
- Include all returned fields in full, relying on the model's large context window to ignore irrelevant data.
- Discard the structured order fields and append the raw warehouse audit logs to the narrative summary.
- Convert the entire response into a narrative paragraph before passing it into the case-facts block.
Answer: Preserve the order ID, date, amount, and eligibility, while dropping the warehouse audit logs.
Practicing context economy requires keeping decision-relevant fields (ID, date, amount, eligibility) while discarding non-essential tool output like raw internal warehouse audit logs to avoid wasting context budget.
Keep going
This is lesson 1 of 6 in Context Management & Reliability. Next up:
- Escalate on Operational Evidence
- Propagate Errors Without Collapse
- Externalize Exploration State
- Calibrate Human Review
- Preserve Claim Provenance
Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.