{"version":"2.1.287","anchor":"session-transcript-compaction-request-deferred-until-after-a","canonical_anchor":"session-transcript-compaction-request-deferred-until-after-a","heading":"Session files are compacted only after the summary has been written","tier":"internal","area":"Compaction","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.287\/e\/session-transcript-compaction-request-deferred-until-after-a","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.287","markdown":"### Session files are compacted only after the summary has been written\n\nClaude Code now waits until a whole batch is saved before compacting the session file, instead of right after the compaction marker\n\n**What**\n\nCompaction is when Claude Code replaces older parts of a conversation with a summary to make room. Claude Code also saves each session to a transcript file on disk. When it writes a batch of entries to that file, it used to ask for the file to be compacted right after writing the compaction entry. It now notes that a compaction is waiting, finishes writing the batch, and then asks once, and only if user or assistant messages came after it.\n\n**Why**\n\nThis keeps the session file from being compacted before the summary itself has been saved.\n\n- Area: Compaction\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5"}