DEV Community

jg-noncelogic
jg-noncelogic

Posted on • Originally published at github.com

Claude Code's compaction discards data that's still on disk

Claude Code's compaction discarded data still on disk — bug report & discussion: https://github.com/anthropics/claude-code/issues/26771. If you run Claude Code storage, treat this as an integrity incident, not a curiosity.

What happened: compaction removed physical files that metadata still referenced. That's a metadata↔disk ordering/race — deletion happened before durable metadata confirmation, leaving live references to missing data.

Why it matters: silent corruption. Apps expect compaction to be safe; when files disappear while indexes still point at them you get lost vectors, corrupted sessions, or errors that only surface under load or recovery.

Takeaway for builders: stop blind deletes. Use a retention window, two‑phase deletes (mark → confirm → delete), fsync/atomic renames, end-to-end integrity checks, frequent snapshots, and chaos-tests for compaction. Follow the issue:

Top comments (0)