Skip to content

Let the newer /rewind backup take its name in a copy, and say what happened - #23

Merged
lr00rl merged 2 commits into
mainfrom
fix/20261022_rewind-backups
Oct 23, 2026
Merged

lr00rl merged 2 commits into
mainfrom
fix/20261022_rewind-backups

Conversation

@lr00rl

@lr00rl lr00rl commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Summary

A copy left every differing file in the target alone, including /rewind backups (file-history/<id>/<hash>@vN), and only printed "1 conflicts left alone". Claude Code numbers a file's backups per process and reuses @v1, @v2… after a resume, replacing its own older backups, so the same name with other content is expected, and the transcript's newest references to that name mean the newest backup.

  • For /rewind backups, the newer of the two (modification time) takes the name, as Claude Code would do; the older target backup moves to archive/<time>/<target account>/ first. A target backup that is as new or newer is left alone. Other differing files are left alone as before; without an archive folder nothing is replaced. resume -a's sync now gets the archive folder too.
  • copy and the resume sync say what they replaced, where the older backup went, and why each file left alone was left alone.
  • README, tutorial (with real output from the demo home) and DESIGN.md explain the clash and its one effect: /rewind's restore of code at an older checkpoint, which Claude Code already gets wrong after a resume.

Test plan

  • go vet ./..., gofmt -l ., go test ./...
  • New test: newer incoming backup replaces the older (which lands in the archive, with the source's time kept), a newer target backup is left alone, and nothing is replaced without an archive folder.
  • Demo home: a fast-forward copy with a clashing backup replaces it and prints where the older one went.

…at happened

A copy left every differing file in the target alone, including /rewind
backups, and reported only "1 conflicts left alone" with a path. For
backups that is the wrong default: Claude Code numbers a file's backups
per process and writes @v1, @v2 again after a resume, replacing its own
older backups, so the same name with other content is expected, and the
transcript's newest references to that name mean the newest backup. In
1087b979, default kept a September @V3 while the October references
point at talcum's.

For files under file-history/<id>/, the newer of the two (by
modification time) now takes the name, as Claude Code would do; the
older target backup is moved to archive/<time>/<target account>/ first,
and a target backup that is as new or newer is still left alone. Other
differing files are left alone as before, and without an archive folder
nothing is replaced. resume -a's sync now gets the archive folder too.

copy and the resume sync say what they replaced and where the older
backup went, and why each file left alone was left alone. README,
tutorial and DESIGN.md explain the clash and its one effect: /rewind's
restore of code at an older checkpoint, which Claude Code already gets
wrong after a resume.
A /rewind backup a copy created got the time of the copy, so a later copy
could take an old backup for the newer one and replace a backup Claude
Code wrote since. Copied backups now keep their source's modification
time. The swap records a replaced backup before setting its time, puts
the older backup back only if nothing took its place, and does not let
two copies in the same second overwrite each other's set-aside file.
@lr00rl
lr00rl merged commit 24aaced into main Oct 23, 2026
2 checks passed
@lr00rl
lr00rl deleted the fix/20261022_rewind-backups branch October 23, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant