Answer: Compaction is the automatic summarization of your conversation when the context window approaches its limit. Project-root CLAUDE.md and auto memory survive compaction, but instructions given only in conversation may not. Status: Confirmed Entry: tool/claude-code/memory-and-context/what-is-compaction Revision: 3 Digest: sha256:a0054b95425a5621 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:17Z Last changed: 2026-11-19T12:16:36Z (what survives: Project-root CLAUDE.md and auto memory → Project-root CLAUDE.md and auto memory survive compaction) Last verified: 2026-11-20T12:21:02Z Next check: 2026-11-21T12:21:02Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of what survives | Project-root CLAUDE.md and auto memory survive compaction | [1] | 2026-11-20 manual trigger command | /compact | [1] | 2026-11-20 Sources: [1] Anthropic. "Glossary". https://code.claude.com/docs/en/glossary.md Role: primary. Accessed: 2026-11-20T12:21:02Z Quote: "Project-root CLAUDE.md and auto memory survive compaction, but instructions given only in conversation may not." (Supports: what survives) Quote: "Run `/compact` to trigger manually, optionally with a focus like `/compact focus on the API changes`." (Supports: manual trigger command) Published: 2026-11-20T10:31:29Z Snapshot SHA-256: 9710e9dd45dfbb7bc5446cae9c7e560eb798451ecdcf49756a0e31d0797a5f75 (captured 2026-11-20T12:21:02Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:21:02Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:21:02Z Last attempt: 2026-11-20T12:21:02Z Notes and limitations: Extracted automatically from a single official source (section "Compaction"). Related: https://latestn.com/tool/claude-code/memory-and-context/what-loads-before-typing What loads into Claude Code's context window before I type anything? https://latestn.com/tool/claude-code/memory-and-context/what-survives-compaction What survives compaction in Claude Code's context window? https://latestn.com/tool/claude-code/memory-and-context/when-context-fills-up When does Claude Code's context window fill up and trigger compaction? https://latestn.com/tool/claude-code/memory-and-context/lower-always-on-plugin-cost How can I reduce the always-on token cost of a Claude Code plugin? https://latestn.com/tool/claude-code/memory-and-context/tool-search-default-tools-loaded How many tools does Claude Code tool search load into context by default? https://latestn.com/tool/claude-code/memory-and-context/what-is-claude-md What is CLAUDE.md in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-19T12:16:36Z | changed | what survives: Project-root CLAUDE.md and auto memory → Project-root CLAUDE.md and auto memory survive compaction | [1] 2026-11-15T12:21:00Z | changed | what survives: Project-root CLAUDE.md and auto memory survive compaction → Project-root CLAUDE.md and auto memory | [1] 2026-11-13T03:04:17Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/memory-and-context/what-is-compaction/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/memory-and-context/what-is-compaction POST: https://latestn.com/dispute/tool/claude-code/memory-and-context/what-is-compaction with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/memory-and-context/what-is-compaction?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What is compaction in Claude Code? Revision 3, last verified 2026-11-20T12:21:02Z. https://latestn.com/tool/claude-code/memory-and-context/what-is-compaction (accessed 2026-11-21T10:00:13Z). @misc{LatestN_tool_claude_code_memory_and_context_what_is_compaction_r3, title = {What is compaction in Claude Code?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/memory-and-context/what-is-compaction}}, note = {Revision 3; digest sha256:a0054b95425a5621; last verified 2026-11-20T12:21:02Z; accessed 2026-11-21T10:00:13Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/memory-and-context/what-is-compaction