Build a program that renames court case PDFs by filing date

California litigator Ryan Kashfian built a Windows tool with ChatGPT that reads inherited case PDFs and proposes names as date, file number and filing type, with OCR and docket matching.

Done withChatGPT· Oct 19, 2026

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.

Try it

With ChatGPT· 7 parts to fill in

Help me build a simple [Windows or Mac] program that organizes a folder of [legal or business] PDFs. I select a folder and enter [an ID number], and it proposes names in the format [YYYY-MM-DD - ID - short description].pdf. Read the text of each file, with an optional OCR step for scanned pages. Use [the dates that count, in priority order] and never substitute [dates that must not be used]; flag the file for review instead of guessing. Show original and proposed names side by side, let me edit or reject each one, never overwrite a file, and keep a log so I can undo a batch. Write tests for the date and naming rules. Explain in plain English how to run it, and stop after the first working version so I can test it on a copy of [a sample folder].

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related