Claude Code can automatically rename batches of images with descriptive, searchable filenames by visually analyzing each photo. Users point Claude at a folder of images and ask it to rename them based on what it sees. Because Claude Code is multimodal, it reads the visual content of each image and generates descriptive names like 001_mom-working-from-home-laptop-on-kitchen-table.jpg. The process also supports batch resizing for web use via the macOS sips command.
I downloaded a batch of stock photos for a client, a financial planner who works with moms, and ended up with files named GettyImages-1234567890.jpg through GettyImages-1234567990.jpg. A hundred files. Zero usable names.
The problem with generic file names isn’t just aesthetics. It’s that when you actually need to find a specific photo, you can’t. There’s no searching, no context, no way to know what’s in the file without opening it. And if you’re uploading images to a website, search engines and screen readers use file names to understand what an image contains. graduate-derek-presenting-with-attendees.jpg tells them something. 001.jpg tells them nothing.
So I used Claude Code to fix it. The whole thing took about 4 minutes.
What Claude Code is (quick primer)
Claude Code is a terminal-based AI tool from Anthropic. You run it in your command line, and it has access to your files. Unlike the browser version of Claude, Claude Code can read, write, move, and rename files directly on your computer without you having to copy and paste anything.
One key thing about Claude Code: it’s multimodal. That means it can actually look at images, not just read text files. It understands what’s in a photo the way you do. This makes it genuinely useful for image workflows.
The actual workflow
I had stock photos downloaded for a client. I knew a bit about who she was, what her brand felt like, who her audience was. I told Claude Code to look through the folder and rename everything with descriptive names, keeping that client context in mind.
The prompt was roughly this:
Review the images in [folder path] and rename each one based on what's in the image.
Use descriptive, lowercase, hyphenated names that someone could search for.
Keep the original number as a prefix.
Claude went through the folder, looked at each photo, and renamed them. It was pulling context about the client from files it already had access to in my project directory. So it wasn’t just describing what it saw. It was naming things with an eye toward what might actually be useful for her.
Here’s what that looked like in practice:
GettyImages-1187234521.jpg → 001_mom-working-from-home-laptop-on-kitchen-table.jpg
GettyImages-1187234551.jpg → 002_young-woman-reviewing-financial-documents.jpg
GettyImages-1187234588.jpg → 003_family-at-park-mom-laughing-with-kids.jpg
Actual descriptions. Searchable. Ready to use.
The part I didn’t expect
Claude flagged two photos as “not on brand.”
I had downloaded a couple of photos as goofs, and Claude actually caught them. It looked at the images, cross-referenced what it understood about the client, and said something like “these two don’t seem consistent with the rest of the set.”
It was right about one of them. The other one, I disagreed. I thought it was a little artistic and poetic. We had a small argument about it and I kept it in the folder.
The point is: Claude wasn’t just mechanically renaming files. It was thinking about them.
The resize step
After renaming, I resized everything for web. “Web-ready” just means the file size is small enough that it loads fast in a browser. A raw photo from a camera or stock site can easily be 5-10 MB. For web use, you want to be under 1 MB, ideally under 300 KB.
On a Mac, there’s a built-in command-line tool called sips (Scriptable Image Processing System). It can resize a batch of images without any extra software.
for img in *.jpg; do
sips --resampleWidth 1920 "$img" --out "for web/$img"
done
What this does: it loops through every .jpg in the current folder, resizes each one to 1920 pixels wide (keeping the proportions), and saves the resized version into a subfolder called for web/. The originals stay untouched.
1920px is a good default for web images. It’s wide enough to look sharp on most screens, small enough to load quickly.
For the event photos in the original version of this workflow (125 images, 1.6 GB of raw files), this step brought the total size down to 71 MB. That’s not a small difference.
Why this is worth knowing
The individual task here is pretty narrow: rename a folder of images. But the underlying pattern is bigger.
Claude Code can look at things. It can make judgment calls. It can hold context about a project while it works through a batch task. That combination shows up in a lot of creative and client workflows that used to require either manual work or expensive specialized software.
For the video version (where Claude uses ffmpeg to extract frames), see How to Rename Video Files Automatically.
If you work with images regularly, whether for clients, events, social media, or a website, this workflow is probably 15 minutes to set up the first time and then just a thing you do.
The YouTube video below is a walkthrough of the exact process:
Further reading
- Claude Code documentation for setup and getting started
- sips man page for the full list of what the macOS image tool can do
- Google image SEO guidelines on why file names and alt text matter
- Claude Code multimodal capabilities for how Claude handles images
Common Questions
Can Claude Code rename photos based on what’s in the image?
Yes. Claude Code is multimodal, meaning it can visually analyze images. Point it at a folder, and it generates descriptive, hyphenated filenames based on what it sees in each photo. It can also apply project context to make names more relevant.
How do I batch resize images for web on a Mac?
Use the built-in sips command: sips --resampleWidth 1920 "$img" --out "for web/$img". This resizes images to 1920px wide while maintaining proportions. Run it in a loop over all images in a folder. No extra software needed.
Why do descriptive image filenames matter for SEO?
Search engines and screen readers use filenames to understand image content. A name like graduate-presenting-project.jpg provides context that IMG_0042.jpg does not. Descriptive names improve image search rankings and accessibility compliance.
How long does it take Claude Code to rename a batch of images?
A batch of about 100 images takes roughly 4 minutes. Claude analyzes each image individually and generates context-aware names. A dry run shows proposed names before anything changes.
A note from Alex: hi i’m alex - i run code for creatives. i’m a writer so i feel that it is important to say - i had claude write this piece based on my ideas and ramblings, voice notes, and teachings. the concepts were mine but the words themselves aren’t. i want to say that because its important for me to distinguish, as a writer, what is written ‘by me’ and what’s not. maybe that idea will seem insane and antiquated in a year, i’m not sure, but for now it helps me feel okay about putting stuff out there like this that a) i know is helpful and b) is not MY voice but exists within the umbrella of my business and work. If you have any thoughts or musings on this, i’d genuinely love to hear them - its an open question, all of this stuff, and my guess is as good as yours.