Bulk File Operations
How to rename, organize, and convert hundreds of files at once using Claude Code
From one file to hundreds
In the previous pages, you automated a workflow that processes one file at a time. But some tasks aren't about doing the same thing every week — they're about doing the same thing to hundreds of files right now.
Renaming 200 event photos so the filenames make sense. Sorting a year's worth of downloads into folders. Converting a batch of images to a different size or format.
These are the tasks where you feel the difference most. An afternoon of clicking through files, renaming one by one — or a few minutes of describing what you want.
But the stakes are higher. When you're touching hundreds of files, a mistake gets multiplied hundreds of times. So this page is as much about doing it safely as doing it fast.
The golden rule: work on a copy
Before you let Claude Code touch a large batch of files, copy the folder.
This isn't optional. It's the most important habit in this entire module.
Right-click the folder in Finder (Mac) or File Explorer (Windows) and duplicate it.
Name the copy something obvious — photos-backup or downloads-ORIGINAL.
Then point Claude Code at the working copy, not the originals.
Why? Because some file operations can't be undone. When Claude Code renames a file, the old name is gone. When it moves a file into a subfolder, the original location is gone. And when it deletes a file, it doesn't go to your trash — it's permanently deleted.
Heads up: File moves and renames overwrite the destination without warning. If a file called
report.pdfalready exists in the target folder, it gets silently replaced. Working on a copy protects you from this.
Once you've verified the results look right, you can delete the backup. But start with a safety net.
Renaming files in bulk
Here's a common situation.
You have a folder of 200 photos from a company event, all named IMG_4521.jpg through IMG_4720.jpg.
Nobody can tell what's in them from the filenames.
Open your terminal, navigate to the copied folder, and start Claude Code:
Rename all the photos in this folder. Use the format "event-001.jpg", "event-002.jpg", and so on, in the order they were taken. Keep the numbering sequential.Claude Code reads the files, checks their creation dates to determine the order, and renames them in sequence. It will show you the plan first — a list of old names and new names — and ask for permission before making changes.
Review the list. Do the numbers look right? Is the ordering what you expected?
If you want something more descriptive, you can be more specific:
Rename the photos using the date they were taken and a sequence number. Format: "2026-01-15-001.jpg", "2026-01-15-002.jpg". Start a new sequence for each date.The key is describing the pattern you want. Claude Code handles the mechanics.
A note on accuracy
In real-world testing, bulk renaming gets about 70% of files exactly right. That number comes from a test case where someone sorted 2,200 files in their Downloads folder — Claude Code organized them into 11 categories with logical subfolders and renamed 67 files from generic names to descriptive ones.
Most of the misses aren't catastrophic. A photo might get the wrong sequence number, or a file might land in a slightly wrong category. But the 30% that need fixing is still a lot less work than doing all 2,200 by hand.
This is why you spot-check. After a bulk rename, scan through the results. Open a few files at random. If something looks off, tell Claude Code what to fix.
Organizing files into folders
Renaming is one half of the picture. The other half is organizing — getting files into the right folders.
Say your Downloads folder has accumulated 500 files over the past year: PDFs, images, spreadsheets, zip files, installers, random screenshots. You want them sorted.
Organize all the files in this folder into subfolders by type. Put PDFs in a "documents" folder, images in "images", spreadsheets in "spreadsheets", zip files in "archives", and everything else in "other".Claude Code goes through the files, sorts them by type, creates the subfolders, and moves everything into place.
You can get more specific:
Organize these files into subfolders by type, but also separate work files from personal files. Use the filename and content to figure out which is which. Put work files in "work/documents", "work/spreadsheets", etc.Claude Code does its best to infer "work vs. personal" from filenames, folder context, and file contents when readable. It won't nail every judgment call, but it gets you most of the way there — and the files it gets wrong are quick to drag to the right folder.
The 1,400 screenshots case
Here's a real one: someone had 1,400 screenshots piled up on their Mac. They pointed Claude Code at the folder, and it analyzed each image, figured out which project or topic it related to, and sorted them into folders by project and content type. Twenty minutes, start to finish.
Two gotchas from that case worth knowing about. macOS screenshots have invisible special characters in their filenames that can trip up file operations. If you hit errors working with screenshot files, tell Claude Code: "Some filenames have special characters — use wildcard patterns to handle them."
The other one: very large images (over 2,000 pixels wide) can cause problems when Claude Code tries to look at multiple images at once. If you're organizing high-resolution photos, tell Claude Code to process them in smaller batches rather than trying to analyze everything at once.
Converting files in batch
You can also convert files between formats in bulk.
Some common ones:
- Resize images for a presentation or website
- Convert a folder of Word documents to PDF
- Change image formats (PNG to JPEG, or the other way around)
- Compress images to reduce file size
For image work, Claude Code often uses tools already built into your computer.
On a Mac, there's a built-in tool called sips that handles resizing and format conversion.
You don't need to install anything.
Resize all the images in this folder so none of them are wider than 1200 pixels. Keep the proportions the same — just make the large ones smaller. Save the resized versions in a new folder called "resized".Claude Code figures out the right commands and runs them.
You see the result: a resized/ folder with smaller versions of every image, originals untouched.
For document conversions (Word to PDF, Markdown to HTML), Claude Code may need to install a conversion tool.
It will ask your permission first.
If it suggests installing something called pandoc or libreoffice, those are standard, safe tools — go ahead and approve.
The "test on five, then run on all" approach
Here's an approach that will save you from a lot of grief: before running anything on hundreds of files, test it on a small sample.
Pick five photos from this folder and rename them using the pattern I described. Show me the results before doing the rest.Review the five results. Are the names formatted correctly? Are the files still intact?
If everything looks right:
Looks good. Do the same thing to all the photos in the folder.This two-step approach catches problems before they multiply. It's the same instinct you'd have if someone offered to rearrange your entire office — you'd want to see one desk done first.
Handling permissions during bulk operations
When Claude Code renames or moves files, it asks your permission for each action by default. For five files, that's fine. For 500 files, clicking "approve" 500 times defeats the purpose.
There's a shortcut. After a few approvals, Claude Code will ask if you want to allow the same type of action for the rest of the session. Say yes. This grants session-level permission for that specific action (like renaming files) without turning off safety checks for everything else.
The permission resets when you close Claude Code. Next time, it will ask again — fresh start, fresh permissions.
Tip: If Claude Code is about to do something you want to review step by step, use Plan mode. Press Shift+Tab twice to switch into Plan mode. Claude Code will analyze the files and show you its complete plan — every rename, every move — without doing anything. You can review the whole plan, suggest changes, and then let it run.
What's next
You've got the core bulk operations down: renaming, organizing, and converting. Next, you'll apply these same ideas to text and documents — finding and replacing across files, extracting data from documents, and processing written content in batches.