# How do I compact a Claude conversation without losing decision-critical context?

Exam: CCAR-F — Claude Certified Architect - Foundations (CCAR-F)
Knowledge domain: Context Management & Reliability
Updated: 2026-11-25T09:22:58.108174+00:00
HTML: https://learningpathx.com/faq/CCAR-F/ccarf-claude-compaction-preserve-state.html

## Also asked as

- What should I preserve when summarizing a long Claude conversation?
- How should a Claude API workflow continue from compaction while keeping evidence and open decisions?

Use compaction to summarize older conversation turns when the next decision can proceed from a concise state record. Preserve current policy and authorization constraints, decisions already made, open questions, and references to the original evidence. Keep a protected record of the session ID and the history range summarized. Apply the appropriate access and retention policy to both the source and its summary.

On supported Claude Messages API models and deployments, on-demand compaction uses `compaction: {"type": "summarize"}` and the `compact-2026-09-04` beta header. Use the same system prompt and tools for the summarization request. Verify `stop_reason: "compaction"` and the returned block, then send the signed block back unchanged, first in `messages`, in place of the summarized messages. Include the same beta header whenever you send that block. Threshold compaction uses `compact_20260112` in `context_management.edits` and the `compact-2026-01-12` beta header. It runs at the configured input-token trigger. Append the response with its compaction block so the API can drop older blocks on later requests. Check the availability and compatibility table for the mode you choose. Keep the top-level on-demand `compaction` request separate from requests using `context_management`.

Check that the handoff preserves pending decisions and expected evidence references before relying on it. If the summary is unavailable or drops an essential detail, use a smaller evidence set or retrieve the original record. Reapply any still-active policy instructions that lived in the summarized on-demand history. Validate the next output against the underlying evidence and the workflow’s evaluation criteria.

[Claude compaction overview](https://platform.claude.com/docs/en/build-with-claude/compaction) · [Compaction on demand](https://platform.claude.com/docs/en/build-with-claude/compaction-on-demand) · [Compaction at a token threshold](https://platform.claude.com/docs/en/build-with-claude/compaction-threshold)

Source: [Context Windows, Compaction, and Tool-Context Control](https://learningpathx.com/news/context-windows-compaction-and-tool-context-control.html)
