[BUG] Rewind with code restore deletes a renamed file on case-insensitive macOS

Status Open
Reported on v2.1.292
Maintainer reply None cached
Activity 0 comments · opened Oct 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Rewinding with code restore deleted a file that no checkpoint ever wrote under its current name.

Checkpoints track the path a file was created with by the Write tool. Renames done with mv in Bash are not tracked. When the tracked path does not exist at a checkpoint, the snapshot records it as absent (backupFileName: null). Restoring that checkpoint deletes the tracked path. On a case-insensitive filesystem, deleting A-note.md removes a-note.md, so a file that only matches by case is lost.

What Should Happen?

Expected: a-note.md stays, because no checkpoint wrote that name.
Actual: a-note.md is deleted, silently.

Error Messages/Logs

No error is shown. The file is gone after the restore.

Steps to Reproduce

On macOS with the default case-insensitive APFS:

  1. Ask Claude to create A-note.md. It uses the Write tool.
  2. Next message: ask it to rename the file to A_note.md. It runs mv in Bash.
  3. Next message: ask it to rename the file to a-note.md. It runs mv in Bash.
  4. Rewind to the message from step 3 and choose to restore code.
  5. a-note.md no longer exists.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.292

Platform

Anthropic API

Operating System

macOS 26.7.1

Terminal/Shell

iTerm2

Additional Information

This happened once in a real session. The steps above mirror it, and the session's file-history snapshots show the tracked path with backupFileName: null at the rewound message.

Suggestion: before deleting during a restore, compare the on-disk file's canonical path with the tracked path, and skip or warn when only the case matches.

View original on GitHub ↗