{"version":"2.1.327","anchor":"transcript-compaction-syncs-the-disk-before-swapping-files","canonical_anchor":"transcript-compaction-syncs-the-disk-before-swapping-files","heading":"Transcript rewrites can be saved to disk before the old file is replaced","tier":"internal","area":"Sessions","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327\/e\/transcript-compaction-syncs-the-disk-before-swapping-files","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.327","markdown":"### Transcript rewrites can be saved to disk before the old file is replaced\n\nWhen Claude Code shortens a saved transcript, it can now force the new copy onto disk first and gives up if that is late or fails\n\n**Unclear.** What decides whether the extra disk sync runs, and whether it is on by default, is not known.\n\n**What**\n\nClaude Code saves each conversation as a transcript file and sometimes rewrites it into a shorter form. It writes the new version to a temporary file and then puts it in place of the old one. Before, the swap happened straight away.\n\nIn some conditions Claude Code now runs the system's `\/usr\/bin\/sync` command on the temporary file first, which forces it to be written to disk. If that takes too long, because Claude Code has already started saving everything on its way out, or if it fails, the rewrite is given up and the old transcript is kept. Claude Code also records how long it waited.\n\n**Why**\n\nThis makes transcript rewrites safer if the computer crashes or loses power partway through. It also stops a rewrite from starting once Claude Code has begun shutting down.\n\n- Area: Sessions\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}