File-history backup copying now writes atomically with an integrity check and retries on failure
When Claude Code's file-history feature can't create a backup of a session's files by hard-linking (a fast way to duplicate a file without copying its data) and falls back to copying instead, it now writes to a temporary file first, checks that the copied file's size matches the original, and only then renames it into place. If the rename fails, it retries for about 1.5 seconds before giving up, logging a specific message if it's ultimately refused.
This avoids leaving corrupted or incomplete backup files in place if a copy is interrupted or a rename briefly fails, which matters since file history is what lets changes to files be tracked and reviewed.