A production application uses Claude to power a long-running legal document review session. After 90 minutes of dialogue, the messages array has grown to 140,000 tokens, approaching the model's context limit. The application must continue the session without losing critical case context. What is the correct architectural approach?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — c is correct because hierarchical summarization preserves semantic continuity while reducing token consumption. Compressing resolved threads into a structured case brief maintains the facts and decisions from earlier in the session without requiring all raw message history.
Full explanation below image
Full Explanation
C is correct because hierarchical summarization preserves semantic continuity while reducing token consumption. Compressing resolved threads into a structured case brief maintains the facts and decisions from earlier in the session without requiring all raw message history. This is the architecturally sound approach for long-running professional sessions where context fidelity matters. A is wrong because max_tokens controls output length, not context window size — it cannot be used to extend the input limit. B is wrong because a naive sliding window in a legal review context will discard earlier evidence citations, prior rulings discussed, and key factual agreements — precisely the material that informs later analysis. D is wrong because prompt caching reduces latency and cost by not reprocessing unchanged prefixes, but cached tokens absolutely count against the context window; caching does not expand the context limit.