{"version":"2.1.304","anchor":"transcript-compaction-verifies-staged-size-and-reports-error","canonical_anchor":"transcript-compaction-verifies-staged-size-and-reports-error","heading":"Safer rewriting of session history files","tier":"notice","area":"Sessions","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304\/e\/transcript-compaction-verifies-staged-size-and-reports-error","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.304","markdown":"### Safer rewriting of session history files\n\nWhen Claude Code compacts a session's history file, it now checks the file size and any rows added meanwhile, and fails safely if they don't match\n\n**What**\n\nClaude Code keeps a file with your session's history, called a transcript, and sometimes rewrites it more compactly. It now checks the result before using it:\n\n- the written file must be exactly the size expected, or compaction fails as `staged_size_mismatch`\n\n- rows added to the history while compaction ran must be readable, or it fails as `appended_rows_unread`\n\nBefore, it wrote the file without checking its size. Failure reports now include an error code.\n\n**Why**\n\nA compaction that goes wrong is caught instead of leaving a damaged session history.\n\n- Area: Sessions\n- Tier: You'll notice\n- Useful: 2\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}