Recover a file Claude Code overwrote
Problem
Claude Code edited or overwrote a file and you need a previous version, but the project has no git history for it.
Fix
Claude Code keeps per-session file snapshots.
- Look in
~/.claude/file-history/{session-id}/— find the session folder by date. - Files are stored as
{sha256(absolute-path)[:16]}@vN— hash the file's absolute path to locate its snapshots. - Copy the
@vNversion you need back into place.
Verified
Aug 01, 2026, on a real support case.
Stuck with something like this? I fix it daily → Services