What they did
Kashfian, a litigation attorney with no programming background, kept receiving hundreds of badly named PDFs when his firm took over cases from other firms. He wrote ChatGPT a specification as if assigning the job to a colleague: pick a folder, enter a six digit file number, and propose names in the form date, file number, short description such as Mtn, Opp or Decl ISO. He then iterated with it one change at a time. The program reads text from PDFs and Word files, runs local OCR through Tesseract for scanned pages, and can match documents against a docket downloaded from the court. He gave it explicit rules for which date counts: the filed stamp first, then minute order date, signature date, and proof of service date, never a hearing date. He also had ChatGPT write automated tests for the date and naming rules.
How it went
He ended up with a working program, Case File Renamer, that he now uses and has released on GitHub. Proposed names sit next to the originals, weak guesses are marked for review and cannot be applied until a person confirms them, existing files are never overwritten, and a batch can be undone. He reports the iterative loop of trying it on a few documents and reporting specific errors back, such as a hearing date picked instead of the filing date. He gives no figures for time saved or how long the build took.
Worth knowing
Court filing stamps are often images even inside searchable PDFs, so OCR mattered more than expected. The tool is tuned for California state court practice, and docket import supports the Los Angeles Superior Court format or a generic CSV. Run it on a copy of a folder first, and check whether any tool like this sends client files to an outside service; his runs entirely locally.