Skip to main content

LrClean

Free a full photo drive without losing a photo or breaking a Lightroom Classic catalog.

CI Latest release Python 3.13 Windows No dependencies MIT

What it is · Safety · Quick start · Phases · Before a real run · Tested with · Limits · Guide

What it is

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.

How it keeps your photos safe

  • 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 undo works until the purge.
  • Online-only placeholders are never opened.

The rules in full are in the guide.

Quick start

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": ["C:\\System Volume Information"],
  "group_depth": 1
}

A whole system drive has folders that a user without administrator rights cannot list. When inventory cannot read a path, it names the path and marks the root's scan partial. Add the unreadable subfolder (for a file, the folder that holds it) to exclude in work/config.json, then run inventory again. Excluding a root does not help: move a file lying directly in a root into a subfolder and exclude that folder, make an unlistable root readable, or remove that root from the configuration.

hash, verify and the report's verdicts skip file rows from partial scans. backup-plan needs at least one complete library scan and walks photo_root directly. rejects selects rejects from the catalogs and uses hashes only from complete library scans when looking for twins.

--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.

The phases

Each is its own phase; the step-by-step is in the guide.

  1. Report. Reads every catalog it can find (from copies), walks the photo drive, hashes files and reports what each file is.
  2. Backup. Copies every photo and video folder to two archive drives from a list you approve, and verifies every copy. backup-plan refuses if any archive drive is missing. backup-run refuses if its manifest's drive is missing.
  3. Reject check. After you cull in Lightroom, decides which rejects can safely leave and writes a removal list.
  4. Unrecorded copies. Lists byte-identical copies that no catalog records: a second removal list, in the same format.
  5. Offload. stage (a reversible move into a staging folder, with undo), then purge (a permanent delete, after everything is checked again).

Before a real run

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, hash and backup-verify were run again just before this run, with both archive drives connected.
  • catalog_roots is compared with the drives and folders you use.
  • No junction or substituted drive points into photo_root from a path a catalog root uses.
  • The list's configuration is not edited between copies and the last stage.
  • The set of paths the main catalog records that are missing is taken before stage and after each stage --apply, and is unchanged: a newly missing path means you stop and look before going on.

Tested with

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.

Working with an AI assistant and the Lightroom plug-in

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.

  • lrclean never 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.

Limits and the rest

  • purge cannot 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.

Metadata

Release files for lrclean 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lrclean 0.1.1
File Size Uploaded Provenance Actions
lrclean-0.1.1.tar.gz 266.1 kB With provenance Details for lrclean-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lrclean 0.1.1
File Interpreter ABI Platform Actions
lrclean-0.1.1-py3-none-any.whl Python 3 none any Details for lrclean-0.1.1-py3-none-any.whl

Total release size: 360.2 kB

Release files / lrclean-0.1.1.tar.gz

Download URL lrclean-0.1.1.tar.gz
Size 266.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2423b9de4c23d58a78aa13d85076374aeba201e5ca36ff1f444bbd81722af7ac
BLAKE2b-256 checksum
How to use checksums
38c78a3fb76a08fe972ba18790220f80b487e32cf93693e3e6cdfc3dffebe4c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / lrclean-0.1.1-py3-none-any.whl

Download URL lrclean-0.1.1-py3-none-any.whl
Size 94.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00dce3de96de2ac89e38298c8220ad85c885693b32da2a3d320c4fa4f82dc122
BLAKE2b-256 checksum
How to use checksums
82810e8df836666e7abb4a152ed52966bd9bb22eb8a75a48abc05780ab92326d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for lrclean 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lrclean-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page