Rename multiple files at once to a clean pattern
14 messy lecture files renamed “01 - Cells.pdf” to “14 - Revision.pdf”, in order.
A real run on 13 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan.
The short answer.
On a Mac, select the files, Control-click and choose Rename to replace text or add numbers. On Windows, the free Microsoft PowerToys adds PowerRename, which takes find-and-replace patterns. Neither can add a leading zero to a number that's already in the name, or read a file to find the number that's missing from its name. Stella (stella.sh) renames to the pattern you describe in words, reading inside the files when the name isn't enough.
Stella does this on Windows, Mac and Linux.
What happened.
All 14 renamed in about 15 seconds. Checked afterwards against an answer key written before the run, by file contents: every file is named NN - Topic.pdf with its correct lecture number (including 09, not 101, for BIO101 L9 Inheritance.pdf, and 13 and 14 for the two without numbers), renamed not copied, with lower-case .pdf and nothing else added to the folder.
The lecture PDFs were made for this run. Stella's first message is a terse working note (“Titles match filenames and are clean; renaming.”) rather than its usual plan. The run isn't sped up.
How Stella does it.
- Opens the Biology 101 folder: 14 PDFs named like
Lec 2 Membranes (final).pdf,lecture10_genetics.PDFandPlant hormones.pdf - Reads the title inside each PDF, such as “Lecture 13: Plant hormones”, and checks it against the number in the file name
- Uses the inside title for the two files with no number in their names
- Renames all 14 to
NN - Topic.pdf, dropping leftovers like “v2”, “(final)” and “(1)” and making.PDFlower case - Lists the new names in order
The prompt.
The lecture slides in the Biology 101 folder in my Documents have messy names and sort in the wrong order. Rename them all like '01 - Cells.pdf': the two-digit lecture number, a dash, then the topic.
This is the exact prompt from the recording. If your files are somewhere else, say where.
Do it yourself.
Mac: Finder's Rename
Select the files, Control-click and choose Rename… Use Replace Text to remove words like
Lecture,_andv2one at a time. Format can number files, but only in the order Finder shows them, not by the number in the name.Windows: PowerToys PowerRename
Install Microsoft PowerToys (free), turn on PowerRename, select the files, right-click and choose Rename with PowerRename. Tick “Use regular expressions” to pull out the number and topic, and preview the new names before applying.
Add the leading zeros
2sorts after10unless it's written02. In PowerRename, do a second pass on the single-digit names (search^(\d) -and replace with0$1 -). In Finder, fix those few by hand.Open the files with no number
A file called
Plant hormones.pdfgives no clue to its lecture number. Open it, read the title, and rename it by hand.Keep a list of old names
Before renaming a big batch, take a screenshot of the folder or copy the names into a note. Neither tool keeps an undo list once you close it.
Where it stops.
- When names depend on what's inside, Stella opens each file. For scans, that means text recognition, which is slower.
- It doesn't keep a list of old and new names unless you ask; add “keep a list of the old names” to the prompt if you want an undo record.
- The first lines of each PDF go to the AI model you use in Stella so it can read the titles. The renaming happens on your computer.
- Recorded on Linux. On a Mac or Windows PC Stella may install a small PDF-reading library first, which wasn't recorded.
Questions.
Why do my files sort 1, 10, 11, 2?
Some apps sort names letter by letter, so 10 comes before 2. Two-digit numbers (01, 02 … 10) sort right everywhere.
Can it rename files based on what's inside them?
Yes. Here it read lecture titles; for invoices, statements and letters see rename PDFs by their content.
Can I undo a bulk rename?
Windows' Ctrl+Z undoes a PowerRename batch right after. Otherwise you need a list of old names, so ask Stella to save one next to the files.
Can it rename and gather files from subfolders at once?
Yes, in one prompt. See move files from subfolders into one folder, where Stella put each old folder name into the new file name.
Is Stella free for this?
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.
Can I control what Stella changes on my computer?
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.
Checked against these sources on 13 November 2026.