Free a full photo drive without losing a photo or breaking a Lightroom Classic catalog.
What it is · Safety · Quick start · Phases · Before a real run · Tested with · Limits · Guide
lrclean is a command-line tool that finds the files on a full drive that one large Lightroom Classic catalog, and
many small per-shoot catalogs, point at. It reads copies of the catalogs, never the originals. It copies every photo
folder to two archive drives and verifies each copy byte for byte. It decides, file by file and with the evidence
written down, which rejects and which byte-identical unrecorded copies can leave the disk. It then moves them off in
two steps, the first reversible. Lightroom's own duplicate finder only sees photos in the open catalog; nothing in
Lightroom compares the files on disk with several catalogs and with the backups at once, and that is the gap this
tool fills.
Who it is for: a photographer with a backlog of raw files and JPEGs, many catalogs, duplicates across them, and a full drive.
- Catalogs are never written. They are copied and read there; removing a photo from a catalog is done by you, in Lightroom.
- Nothing leaves the drive without a verified copy on each of two archive volumes (separate drive letters and volume serials; that they are separate physical drives is yours to check, see Before a real run).
- Every removal is from a list approved by its SHA-256.
- Every removal is staged first, and
undoworks until thepurge. - Online-only placeholders are never opened.
The rules in full are in the guide.
Windows, Python 3.13.
pipx install lrclean
Make a tool folder outside your photo folders, make a work folder inside it, and write work/config.json there.
These are the nine required keys, with made-up values (archive_roots, two folders on two archive drives, is added
before the backup phase):
{
"library_roots": ["C:\\"],
"photo_root": "C:\\Photos",
"catalog_roots": ["C:\\Photos"],
"backup_roots": ["E:\\Old-backup"],
"live_catalog": "C:\\Photos\\Main\\Main.lrcat",
"old_states": [],
"excluded_catalogs": [],
"exclude": [],
"group_depth": 1
}--base defaults to the current folder, so run from the tool folder or put --base <tool folder> before the
command: lrclean --base <tool folder> report. Close Lightroom, then run the read-only report. It writes only inside
the tool folder (work/ and out/):
lrclean catalogs
lrclean inventory
lrclean hash
lrclean report
Read out/summary.md first. It gives counts per section; the files themselves are listed in the numbered CSV files
beside it (for example 08_missing.csv). Every key and command is in
the guide.
Each is its own phase; the step-by-step is in the guide.
- Report. Reads every catalog it can find (from copies), walks the photo drive, hashes files and reports what each file is.
- Backup. Copies every photo and video folder to two archive drives from a list you approve, and verifies every copy.
- Reject check. After you cull in Lightroom, decides which rejects can safely leave and writes a removal list.
- Unrecorded copies. Lists byte-identical copies that no catalog records: a second removal list, in the same format.
- Offload.
stage(a reversible move into a staging folder, withundo), thenpurge(a permanent delete, after everything is checked again).
These checks are made by hand today:
- Lightroom is closed, and the sync client is stopped.
- The archive drives are identified by label and serial, and are two separate physical drives.
catalogs,inventory,hashandbackup-verifywere run again just before this run, with both archive drives connected.catalog_rootsis compared with the drives and folders you use.- No junction or substituted drive points into
photo_rootfrom a path a catalog root uses. - The list's configuration is not edited between
copiesand the laststage. - The set of paths the main catalog records that are missing is taken before
stageand after eachstage --apply, and is unchanged: a newly missing path means you stop and look before going on.
Windows 11 and Python 3.13. The catalog format numbers the work database has recorded so far are six: 0600008, 0700003, 1303001, 1400000, 1500000 and 1504001 (an example from one library). Older formats are untested, not known to fail.
AGENTS.md holds the rules for an AI assistant that works on the code.
On the first library, a third-party Lightroom plug-in (an MCP server; MIT) was used for work that is otherwise done by hand, photo by photo: flagging duplicates as rejects only after every catalog had been checked for develop work and picks; giving both copies of a duplicate the union of their keywords; and removing the records of purged files from the per-shoot catalogs by id, each write proved by counts before and after.
lrcleannever needs the plug-in and never talks to it.- When it is used, previews and metadata go to the model: pin a version that has been read, and keep removals behind a confirmation.
purgecannot be undone: only the two archive copies remain.- A sync client deletes the cloud copy of a file that is moved out of a synced folder.
- Windows only.
- Lightroom's catalog format is private; a future version could change the tables the tool reads.
How long a pass takes depends on the drives and on how much is read again; the guide's
Limits gives one example. Roadmap: the 0.2 milestone.
How it was built: docs/process/README.md. Licence: MIT.
lrclean is an independent project, not made or endorsed by Adobe.