Claude Code Deleted My Files: How to See What It Changed

October 19, 2026 · Dirk

If an AI coding agent just deleted files you needed, start with the checks below: most of them work in the next five minutes, without installing anything. After that, this post covers why agent deletions are so easy to miss, a few real cases from the last weeks, and how to see every file an agent touches the next time.

What to check right now

Work through these in order. Each one recovers a different kind of loss.

  1. Git, for tracked files. git status lists what is missing or changed, git diff shows the exact lines, and git restore <path> brings a deleted tracked file back. If history itself was rewritten, git reflog still lists the commits your branch pointed to.
  2. Git, for staged but uncommitted work. git fsck --lost-found writes the contents of files that were staged with git add but never committed into .git/lost-found/. The file names are gone, the contents usually are not.
  3. Your editor's local history. VS Code keeps earlier versions of files you saved in it. Open the Timeline view in the Explorer and look for Local History entries.
  4. Snapshots and backups. A filesystem snapshot (btrfs, ZFS, LVM) or a backup of the machine is the only way back for files that were never in git and never opened in an editor.
git status                 # what is missing or changed
git diff                   # the exact lines
git restore <path>         # bring back a deleted tracked file
git reflog                 # commits a rewrite left behind
git fsck --lost-found      # staged content that was never committed

Two things that do not help. rm does not use the trash, so there is nothing to undelete there. And Claude Code's own /rewind only covers files Claude edited with its file editing tools: according to the checkpointing documentation, a file that only Bash commands such as rm, mv or cp changed is not tracked and cannot be restored that way.

Why agent deletions are easy to miss

The hard part is often not restoring the files, it is knowing which ones are gone. Several things work against you.

Real cases from the last few weeks

These are first-person reports from public issue trackers and forums, not hypotheticals.

None of these was malicious. Most were a reasonable command run in the wrong place: an empty variable, a symlink, a misread instruction. That is exactly why they are hard to predict and easy to miss.

How to see it next time

Every recovery step above starts with the same question: what exactly changed? kaimon answers it for AI coding agents on Linux.

What it does not do, stated plainly: kaimon observes and reports, it never blocks a deletion. It does not keep copies of your files, so it tells you what to restore rather than restoring it. It records from the moment it is installed, and keeps up to the last two days on your machine. It runs on Linux, including a Linux dev box or VM you work on from macOS or Windows over VS Code Remote-SSH.

Get the VS Code Extension

Always free and 100% local: nothing leaves your machine. See how it works.

Making the next one smaller

FAQ

Can Claude Code's /rewind bring back a file it deleted with rm?

Only if Claude had edited that file with its own file editing tools earlier in the session. Checkpoints track those files, and rewind also undoes later Bash changes to them. A file that only a Bash command such as rm, mv or cp touched is not tracked, so rewind cannot restore it. Use git, editor local history, snapshots or backups.

Can kaimon restore deleted files?

No. It records every file an agent changes or deletes, with the agent, tool, path and size, so you know exactly what to restore and from where. It does not keep copies of file contents.

Does kaimon stop an agent from deleting files?

No. It observes and reports, and never interferes, so it cannot break an agent's workflow.

Does kaimon work on macOS or Windows?

kaimon runs on Linux hosts, which includes a Linux dev box or VM you work on from macOS or Windows through VS Code Remote-SSH.

Ready to Align Your AI Agents?

Two minutes to install. From then on, every file change your agents make is on record.

Get the Free VS Code Extension

Linux, local or over Remote-SSH · Nothing leaves your machine

Running a team? Get notified about kaimon for Teams