The File Sorter
Point it at a messy folder. It reads what is actually inside each file, proposes a folder structure, and refuses to move a single thing until two independent judges agree the plan is good.
Eighty-six files. One command.
- Reads the actual contents of each file, not just the extension — a PDF named
untitled_3830still lands in the right folder - Two judges grade every proposed plan — one a deterministic rules engine, one an AI critic. Neither sees the other's work, and both have to approve before anything moves
- If the judges disagree, the plan is thrown out and rewritten. Up to three attempts, each one scored in the open
- Sensitive files — bank statements, tax documents, medical records — are flagged for manual review instead of being quietly relocated
- Every run writes an undo log. One command puts every file back exactly where it was
Nothing moves until both agree.
-
Step 1 — Scan
Walks the target folder and builds an inventory of every eligible file. Anything matching a privacy rule is pulled aside immediately and marked for review rather than entering the plan at all.
-
Step 2 — Read and Categorize
Claude reads the inventory and proposes a taxonomy — real folder names derived from what the files actually are, not a fixed template of Documents / Images / Other.
-
Step 3 — Judge One: Rules
A deterministic critic scores the plan against hard constraints — every file accounted for, no collisions, no orphan folders, no file left worse-placed than it started. No model involved, so this score is fully reproducible.
-
Step 4 — Judge Two: Model
A separate Claude call independently rates the taxonomy on whether a human would actually find things in it. It never sees the rules engine's verdict, so the two scores can't contaminate each other.
-
Step 5 — Agree, or Retry
Both judges must clear the bar. If either objects, the plan is discarded and rewritten with the objection as feedback — up to three attempts, every score visible on screen. Only a plan both judges pass gets applied, and applying it writes an undo log first.
A real desktop, cleared.
Eighty-six real files on a real Desktop — scanned, planned, graded by both judges, then applied.
Open source, fully reversible.
-
CLI and a local web UI
Run it headless from the terminal, or launch the Streamlit interface to click through scan, plan, and apply while watching both judges score in real time. Python 3.11, public on GitHub.
-
Two critics, deliberately separate
metrics.pyis pure Python and scores the same plan the same way every time.critic.pyis the model pass. Keeping them isolated is the whole point — a single grader can talk itself into its own plan. -
Privacy filter runs before the model does
Sensitive-document detection happens locally, before anything is sent anywhere. Flagged files are surfaced for review and never included in an automatic move.
-
Undo is not optional
Applying a plan writes
undo.jsonlbefore the first file moves.declutter undoreplays it in reverse.