All Mini Tutorials

AI Does It For You

Rename Hundreds of Files With AI — No Coding

Give an AI coding agent a folder and a naming rule, preview every proposed filename first, then safely rename the files in one go.

5 minBeginnerFiles, Windows, MacCodex / Claude Code

The problem

You may have dozens or hundreds of files with names like IMG_4821.jpg or scan001.pdf. Renaming them manually is slow. An AI coding agent can inspect the folder, suggest better names and rename them for you. But bulk file changes need one important rule: preview first. Do not let AI rename hundreds of files before showing you exactly what it plans to do.

What you need

  • Codex or Claude Code
  • The folder containing the files
  • A simple idea of how you want the files named, such as CustomerName-Invoice-001.pdf or Holiday-Photo-001.jpg

Safety first

Make a copy of the folder first if the files are important. Before changing anything, the AI must show current filename → proposed new filename. It must never delete files, overwrite an existing filename, change file contents or modify anything outside the folder you supplied. It must preserve file extensions such as .jpg, .png, .pdf, .docx and .xlsx. The extension is the small ending that tells the computer what type of file it is.

Copy-paste prompt

I want to safely rename the files in this folder: [FOLDER PATH] The naming rule I want is: [DESCRIBE THE NEW FILENAMES IN SIMPLE WORDS] For example: CustomerName-Invoice-001.pdf CustomerName-Invoice-002.pdf IMPORTANT SAFETY RULES: - Work only inside the folder I gave you. - Do not delete any files. - Do not overwrite any existing files. - Preserve the correct file extensions. - Do not change file contents. - Do not rename anything yet. FIRST: Inspect the folder. Then show me a preview table: Current filename → Proposed new filename Flag: - duplicate proposed names; - naming conflicts; - files you are unsure about; - anything that does not match the naming rule. Then STOP. Do not rename anything until I explicitly approve the preview.

When you are ready to approve

Approval prompt

I have reviewed the rename preview. Proceed with ONLY the approved filename changes. Keep these rules: - do not delete anything; - do not overwrite anything; - preserve file extensions; - do not modify file contents; - do not change files outside this folder. After renaming, show me: 1. how many files were renamed; 2. any files that were skipped; 3. any conflicts or errors.

Steps

  1. Make a backup copy. Copy the folder if the files matter. This gives you an easy way back if the naming rule turns out to be wrong.
  2. Open Codex or Claude Code where it can access the folder or project. You do not need to write code yourself.
  3. Paste the first prompt. Replace [FOLDER PATH] and [DESCRIBE THE NEW FILENAMES IN SIMPLE WORDS] with the real details.
  4. Check the preview. This is the most important step. Look through several old-name → new-name examples. Check that names look right, numbering makes sense, extensions remain correct and nothing important is changing unexpectedly. For example: IMG_4821.jpg → Joburg-Shop-Photo-001.jpg, IMG_4822.jpg → Joburg-Shop-Photo-002.jpg and IMG_4823.jpg → Joburg-Shop-Photo-003.jpg. Only after reviewing this preview should you approve the rename.
  5. Only when satisfied, paste the approval prompt. Let the agent perform the approved rename. Do not tell it to rename files however it thinks is best, approve an unchecked preview, allow conflicting filenames to be overwritten, or combine deletion and cleanup with this task. Keep one task to one job.

What success looks like

Before: a folder contains IMG_4821.jpg, IMG_4822.jpg, IMG_4823.jpg and IMG_4824.jpg. After: the same files have useful names such as Joburg-Shop-Photo-001.jpg through Joburg-Shop-Photo-004.jpg. The number of files should stay the same unless you intentionally excluded some. Nothing should have been deleted.

If it goes wrong

If the filenames are wrong, STOP. Do not ask AI to make another large batch change immediately. Use the backup copy, then fix the naming rule and preview again. Stop making changes. Do not rename anything else. Show me: 1. every filename you changed; 2. the old filename; 3. the new filename; 4. any skipped or failed files. Do not make further changes until I approve them.

Next useful tutorial

Clean a Messy Customer Spreadsheet With AIFind Duplicate Customers in Excel With AI
Rename Hundreds of Files With AI — No Coding | NonDevApps