Skip to content
All projects

FileKeeper

Finds duplicates and wasted space across your drives and proposes a cleaner folder structure. It only changes files you approve.

Go
SQLite
React

The problem

Years of copies across several drives, with no safe way to tell which files are duplicates and no wish to let a script delete things on its own.

How it works

  • A scanner reads files read-only and builds an index in SQLite. Hashing is lazy: a file is hashed only if another file has the same size, or it is small.
  • A planning layer produces plans as JSON. It never performs actions.
  • The only part that writes is an executor that runs an approved plan. Deleted files go to a quarantine folder with a retention period, and each step is journaled.
  • The dashboard is a React app embedded in a single Go binary. It listens on loopback only and makes no outbound network calls.

A decision: Plan, approve, execute, with a journal

Separating proposing from doing means I can read exactly what will happen first, and deleted files sit in quarantine until their retention period ends.

What was hard

Hashing every file on multi-terabyte drives is hours of disk reads. Hashing only same-size candidates, and comparing the first 256 KiB of large files before reading them whole, avoids most of it.