# Preserving critical facts in long conversations

*Claude Certified Architect - Foundations Study Guide · Context Management & Reliability · Last updated October 22, 2026 · https://www.certifyforce.com/study-guide/claude-certified-architect-foundations/context-management-and-reliability/preserving-critical-facts-in-long-conversations*

How to keep amounts, dates, order IDs and rules intact as a conversation grows: pin facts in a case-facts block outside summarized history, trim tool output before it piles up, order long inputs for position effects, and choose between context editing, compaction and notes files.

- Certification: Claude Certified Architect - Foundations
- Exam section: Context Management & Reliability
- Study guide: https://www.certifyforce.com/study-guide/claude-certified-architect-foundations

**Official exam objective:**

> Manage conversation context to preserve critical information across long interactions

## What the exam expects

- Diagnose progressive summarization loss (exact amounts, percentages, dates and customer-stated promises turned into vague prose) and fix it with a persistent case-facts block and per-issue structured records kept outside the summarized history.
- Explain why a bigger context window does not remove the need to curate context (context rot), and why the stateless Messages API needs the full history on every request.
- Trim verbose tool results to the relevant fields before they accumulate, in the tool or in a PostToolUse hook.
- Assemble long multi-report inputs against the "lost in the middle" effect: key-findings summary first, each report in its own labelled section.
- Have upstream agents return compact structured data (key facts, citations, relevance, dates, sources) when the downstream agent's budget is tight.
- Choose between tool result clearing, compaction, notes files and CLAUDE.md for what must survive a long session.

Key terms: **context rot** (recall falls as tokens grow); **case-facts block** (transactional facts re-sent in every prompt, outside summarized history); **progressive summarization** (repeatedly condensing older turns); **lost in the middle** (findings in the middle of long inputs get omitted); **tool result clearing** (API context editing that replaces old tool results with a placeholder); **compaction** (replacing older turns with a Claude-written summary).

## Key facts

| Fact | Detail | Source |
|---|---|---|
| Context rot | Accuracy and recall degrade as token count grows, at any window size | [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows) |
| Messages API state | Stateless; send the full conversational history every request | [Using the Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) |
| What counts toward the window | System prompt, all messages including tool results, tool definitions, output | [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows) |
| `max_tokens` | Caps generated output (up to 128k on 1M-window models), not input room | [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows) |
| Tool result clearing defaults | `trigger` 100,000 input tokens; `keep` 3 tool uses; `clear_tool_inputs` false | [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) |
| Where clearing runs | Server-side; client keeps the full, unmodified history | [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) |
| Clearing plus memory tool | Claude gets a warning near the threshold and can save results to memory files first | [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) |
| Poor fits for compaction | Precise recall of early details; exact state across many variables | [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing) |
| Replace tool output | PostToolUse `updatedToolOutput`, any tool, both SDKs | [Agent SDK hooks](https://code.claude.com/docs/en/agent-sdk/hooks) |
| SDK compaction signal | `system` message with subtype `compact_boundary` | [Agent loop](https://code.claude.com/docs/en/agent-sdk/agent-loop) |
| Rules that survive SDK compaction | CLAUDE.md via `settingSources`, re-injected every request | [Agent loop](https://code.claude.com/docs/en/agent-sdk/agent-loop) |

## Check yourself

- Why does a 1M-token window not remove the need to curate context?
- When should a fact go in the case-facts block rather than the conversation summary?
- Why pair tool result clearing with a memory or notes file?
- Where do persistent rules go so Agent SDK auto-compaction cannot drop them?

## Sources

- [Effective context engineering for AI agents](https://www.anthropic.com/research/effective-context-engineering-for-ai-agents)
- [Context editing](https://platform.claude.com/docs/en/build-with-claude/context-editing)
- [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows)
- [Using the Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages)
- [Compaction overview](https://platform.claude.com/docs/en/build-with-claude/compaction)
- [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices)
- [How the agent loop works](https://code.claude.com/docs/en/agent-sdk/agent-loop)
- [Intercept and control agent behavior with hooks](https://code.claude.com/docs/en/agent-sdk/hooks)
- [Writing effective tools for AI agents](https://www.anthropic.com/research/writing-tools-for-agents)
- [How we built our multi-agent research system](https://www.anthropic.com/research/multi-agent-research-system)
- [Claude Certified Architect – Foundations Exam Guide v1.0](https://everpath-course-content.s3-accelerate.amazonaws.com/instructor%2F6nizmqk8tpzpfjvt6qmmav7rh%2Fpublic%2F1783542750%2FClaude+Certified+Architect+%E2%80%93+Foundations+Exam+Guide.pdf)

## About the full unit

The "Core concepts", "Exam traps" and "Worked scenario" sections of this unit, its 9 linked practice questions, and unlimited timed mock exams are included with the Claude Certified Architect - Foundations pack (USD $19): https://www.certifyforce.com/practice-exams
