[BUG] Rewind said it couldn't restore, but still overwrote ~20h of edits across the project and deleted files created since (conversation not rewound)
Status Open
Reported on v2.1.212
Maintainer reply ✓ Yes — 7487
Activity 3 comments · opened Oct 11, 2026
💡 Likely answer: A maintainer (7487, contributor)
responded on this thread — see the highlighted reply below.
What happened
I used the rewind / restore-code feature in an interactive session. The UI told me it couldn't do it ("Cant do it"). My files on disk were changed anyway, and the conversation was not rewound. The next turn then arrived with the reminder "The user restored files to how they were at an earlier point in this conversation, without rewinding the conversation to that point."
About 20 hours of work in the files Claude Code had edited was lost. I am not using git for most of this project, so there is nothing else to recover from.
Evidence (from the session transcript and ~/.claude/file-history)
- Session:
2026-10-10T03:01Zto2026-10-11T05:13Z, about 24k transcript lines, 107file-history-snapshotrecords, 135 project files tracked. - At 16:06:00 local time (
2026-10-11T05:06:00Z) many tracked files were rewritten at the same second. At05:06:21ZI ran/model; the restore had already happened. - The files now on disk are byte-identical to backups referenced by the snapshot of message
039124d7-1685-434a-ab87-f07ad7a0f7c0(2026-10-10T09:09:05Z, my prompt "Build was done in 24.4s ? Why u waiting for"): 102 of 135 tracked files match it. - The restore point I picked was one of my "it's been restarted" messages. The closest candidate is
d9a26ecd-e314-4aa5-81b3-c47e8b3a46f5("Okay its been restarted",2026-10-10T09:53:56Z), which is the next user message after the snapshot the files match. Against that message's own snapshot only 10 of 135 tracked files match. If that was the one I picked, the result is about 45 minutes before it, and everything after is gone, not just the last turn. I can't tell from the transcript which message the rewind UI actually used. - 8 files that were created after that point with the Write tool no longer exist (new source files and scripts).
- Files that were edited by another program and saved by it (untracked by Claude Code) were left alone. The project is now a mix of old and new versions of files that depend on each other, so it doesn't build the way it did.
- 33 tracked files match no backup at all. I believe these are files I also edit through my own in-app editor (saved to disk outside Claude Code), but I haven't verified that.
Expected
- If a rewind says it can't be done, nothing on disk should change.
- If it does restore files, it should be the ones for the message I selected, and it should say which files will be overwritten or deleted before doing it.
- A restore should keep a copy of the pre-restore state so it can be undone.
Environment
- Claude Code 2.1.212, Windows 11 (10.0.26200)
- Model at the time: Opus 5.5 (switched to Sonnet 5.5 right after, by me, because of the other bug below)
- Project folder inside a OneDrive-synced folder (this is how I'm recovering it)
Related
The same session had three false-positive safeguard refusals just before this, in another issue I'm filing. The rewind was my attempt to get out of that.
3 Comments
Based on the transcript and file-history evidence in this report, this appears to be a particularly serious failure mode: the restore reports failure while still changing files on disk, without rewinding the conversation. Could the team investigate the restore failure path and ensure it is atomic (or preserves a recoverable pre-restore snapshot) before it mutates files? I have not independently reproduced this, so I am relying on the reporter’s evidence.
Thanks for flagging it. Here are reproduction steps, put together from the session's own transcript and file-history records. The rewind action itself isn't recorded in the transcript, so the two UI details in step 6 are from memory and marked "not sure".
The session
entrypoint: claude-desktop), Claude Code 2.1.212, Windows 11 (10.0.26200)How big it was at the moment of the rewind
| | |
|---|---|
| Session length | 26 hours (
2026-10-10T03:01Zto the rewind at2026-10-11T05:06Z) || Transcript (
.jsonl) | 494 MB, 23,991 records || Human prompts | 104 |
| Assistant records | 8,142 (4,445 with tool calls) |
|
file-history-snapshotrecords | 105 ||
file-history-deltarecords | 133 || Files tracked by file history | 135 in the project (the largest snapshot lists 276 entries) |
|
~/.claude/file-history/<session>| 756 backup files, 32 MB || Auto-compactions | 5 (
10-05 05:35Z,10-10 04:03Z,10-10 09:21Z,10-10 13:59Z,10-11 00:55Z) |Steps
d9a26ecd-e314-4aa5-81b3-c47e8b3a46f5("Okay its been restarted",2026-10-10T09:53:56Z), the first message after the compact boundary at09:21:12Z. Itsfile-history-snapshotis empty (trackedFileBackups: {}, 0 files). The previous non-empty snapshot is for039124d7-1685-434a-ab87-f07ad7a0f7c0(276 entries,09:09:05Z), before that compaction.13:59Zand2026-10-11T00:55Z), editing files and creating new ones with Write.model_refusal_no_fallback, categoryreasoning_extraction, at05:02:59Z,05:04:47Zand05:05:23Z). After the first I kept talking to Opus: two more messages (05:04:30Z,05:05:04Z), both refused the same way. So the conversation's last entry was a synthetic API-error message (f0a986e5-f277-4cb4-9d2b-bd83f3eaf101), not a real response.d9a26ecdabove. All three candidates are from before the latest compaction:8e3abbf8(10-10 08:05Z, its snapshot lists 264 files)d9a26ecd(10-10 09:53Z, 0 files, first message after a compaction)8e42ce7b(10-10 12:21Z, 18 files)Result
05:06:00Zthe tracked files were rewritten in the same second, to the snapshot of039124d7(09:09:05Z): 102 of 135 files are byte-identical to it. That is about 45 minutes befored9a26ecd, and 20 hours of work after it was lost.What I think is happening (not confirmed)
After the rewind
/modelat05:06:21Z). It worked normally straight away: no refusals from its first reply at05:07:08Zonwards.05:23:35Z, and Opus was fine again too: normal replies from05:23:53Z, same session. So the refusals didn't persist.I can share the snapshot and file-history records privately if they'd help.
Thanks @AlexC1991 for reconstructing the sequence from the transcript and file history. The empty post-compaction snapshot and the byte comparisons provide concrete cases for the core team to investigate.
One qualification to my earlier comment: because the exact target and selected action were not recorded, the unchanged conversation alone does not establish that the conversation rewind failed; a code-only restore would normally leave it unchanged. The reported failure message, overwritten files and missing new files still warrant investigation. The two proposed causes should remain hypotheses until reproduced.
A controlled test in a disposable project could compare code-only and code-and-conversation restores across a compaction boundary, including an empty target snapshot, files created afterward and externally edited files. For each action, it should verify the resolved target, final files and conversation, and that a failed restore preserves or can recover the pre-restore file state. I have not reproduced this on Windows or in the desktop runtime, so the incident evidence remains your reconstruction.