Use Claude to Clean Up and Bulk Rename Hundreds of Files in 15 Minutes

Use Claude to Clean Up and Bulk Rename Hundreds of Files in 15 Minutes

🗂️ Use Claude to Clean Up and Bulk Rename Hundreds of Files on Your Computer in 15 Minutes

Do you have a folder of photos, invoices, or documents with names like "IMG_20250311(2).jpg", "Untitled document (7).docx", or "Scan_final_final2.pdf"? In this guide you will ask Claude to write a ready-to-run script that renames hundreds of messy files into clean, orderly names, in about 15 minutes. All you need is a Claude account (the free plan works) and the Terminal app (on Mac) or PowerShell (on Windows), both already built into your computer, nothing extra to install.

🧰 What you need

  • Claude: go to claude.ai and sign up for a free account if you do not have one.
  • Terminal or PowerShell: a command tool already built into your computer. On Mac, open Spotlight (Cmd + Space) and type "Terminal". On Windows, press the Windows key and type "PowerShell".
  • Python: if your computer does not have it yet, Claude will tell you how to install it (from python.org, free, installs like a normal app).
  • The folder you want to clean up: know its exact path, for example "Documents/Invoices 2026" or "Desktop/Travel photos".
  • 5 to 10 free minutes to read and follow each step, no prior coding knowledge needed.

This is Claude working as a coding assistant on demand, similar to how you can use Claude Code to build an automatic pricing tool for an online store: you describe the task in plain language, and Claude hands back the exact commands you paste in and run.

🪜 Step by step

Step 1: Look at the folder and decide on a new naming pattern

Before asking the AI, think about what you want the new file names to look like. For example "2026-03-11_electric-bill_01.pdf" (date, content, sequence number) is far easier to search than "Scan001.pdf". Write down one or two examples of an old name and the new name you want, this helps Claude understand your intent right away.

Step 2: Ask Claude to write the bulk-rename script

Open claude.ai and paste the prompt below (replace the bracketed parts with your real information):

I use [Windows / Mac]. I have a folder called
"[folder path]" with about [number] [photo/PDF/document]
files that have messy names like "[example old file name]".

Please write me a simple Python script that will:
1. Rename every file in that folder following this pattern:
   "[new name pattern, e.g. date_description_sequence-number]"
2. Have a "preview" mode (print old name -> new name but do
   NOT rename yet) so I can check before running it for real.
3. Skip renaming if two files would end up with the same name,
   and print a warning instead.
4. Briefly explain how to run this script on [Windows/Mac],
   including how to install Python if I do not have it yet.

Claude will return a piece of code (usually a .py file) along with instructions on how to run it. You do not need to understand every line of code, just follow the run instructions Claude gives you.

Step 3: Back up the folder before renaming anything for real

This step is mandatory, do not skip it. Copy the entire original folder somewhere else (for example to a USB drive, or create a copy named "Folder name (backup)" on your computer). If the script does not behave the way you expected, you still have the original to fall back on.

Step 4: Run the preview mode first

Follow the exact instructions Claude gave in Step 2 to open Terminal or PowerShell, move into the folder with the script, then run it in preview mode first (Claude usually gives you something like python rename_files.py --preview). Read the printed list of old names and new names carefully. If the pattern is wrong, go back to Step 2, point out exactly what Claude misunderstood, and ask it to fix the script.

Step 5: Run it for real and double-check

Once the preview list looks correct, run the script in real mode (remove the --preview flag, or follow whatever Claude instructed). Open the folder again, check a few files at the start and end to make sure the names are correct and the files still open normally.

✅ Example result

Before renaming, a photo folder might look like this:

IMG_20260311.jpg
IMG_20260311(1).jpg
Untitled.jpg
Scan_final2.jpg

After the script runs with the "date_description_sequence-number" pattern, the folder becomes:

2026-03-11_dalat-trip_01.jpg
2026-03-11_dalat-trip_02.jpg
2026-03-11_dalat-trip_03.jpg
2026-03-11_dalat-trip_04.jpg

Now you can tell at a glance what date a photo was taken and what it is about, without opening each file to guess.

💡 Tips for better results

  • Always run preview mode first, never jump straight into real mode.
  • If the folder has several file types (photos, PDFs, Word docs), ask Claude to write a separate rule for each type instead of forcing one pattern on everything.
  • Keep your naming rule simple and consistent, for example always starting with the date, searching and sorting later will be much easier.
  • If old file names contain accented characters or special symbols, tell Claude so the script can handle them correctly and avoid encoding errors.

⚠️ Limits to know

  • Never run a script you do not understand the purpose of, even one written by Claude. Always read the explanation Claude gives before running anything.
  • Bulk renaming is hard to undo without a backup, Step 3 is not an optional "just in case" step, it is mandatory.
  • For important files (contracts, company records), have someone more technical review the script once before running it on a large batch.
  • AI-written scripts can still have small bugs, especially with unusual file names, always double-check the preview output.

❓ FAQ

I know nothing about coding, can I still do this? Yes. You do not write any code, you just paste the right prompt and follow the run instructions Claude gives you step by step.

Can I use ChatGPT instead of Claude? Yes, the process is the same, only where you paste the prompt differs. If you are new to Claude, see What is Claude AI, a beginner's guide.

What if I rename things wrong, how do I recover? If you backed up in Step 3, just delete the renamed folder and swap in your backup copy. This is exactly why the backup step cannot be skipped.

Does this script delete any files? No, the script in this guide only renames files, it never deletes anything. If you want Claude to add other features (merging duplicates, deleting junk files), state that request separately and check the result very carefully before running it.

How do I avoid ending up messy again next time? Set a naming rule as soon as you save a new file, or ask Claude to write a script that automatically sorts new files into the right folder on a schedule, similar to how people automate repetitive daily tasks with AI. If you want the AI to remember your own naming rules every time you work with it, you can also check out how to teach AI your own tasks with skills and projects.

#Claude #Automation #FileOrganization #ProductivityTips #VibeCoding

More articles