Comment by jftuga

1 month ago

Script to auto-rename screenshots with Claude Code

I'm sure there are a ton of other projects out there that do this, but I couldn't find one that fit my needs exactly, so I threw this together in a few hours.

claude-image-renamer uses Claude Code CLI to analyze screenshots and rename them to something actually usable. It combines OCR text extraction with Claude's vision capabilities, so instead of "Screenshot 2025-12-29 at 10.03.10 PM.png" you get something like "vscode_python_debug_settings.png".

A few things it does:

    Handles those annoying macOS screenshot filenames with weird Unicode characters
    Uses OCR to give Claude more context for better naming
    Keeps filenames clean (lowercase, underscores, max 64 chars)
    Handles naming conflicts automatically

If you're on macOS, you can also set this up as a Folder Action so screenshots get renamed automatically when they are saved to a folder, typically ~/Desktop. This is useful if you take a lot of screenshots and hate digging through "Screenshot 2025-12..." files later.

GitHub: https://github.com/jftuga/claude-image-renamer

Very interesting! This inspired me in making something similar to clean up my old "Download" folders from 10 years ago that are full of screenshots and random images, but I would also need it to preserve the "last-modified" of the file otherwise when I sort by date it would show me all the renamed images.

Very cool, I do something similar! except I don't rename the image, but I have the LLM create a matching text file in a separate folder with a description of everything in the image and a guess of the possible reasons why I took a screenshot.

I use screenshot on my phone to remember stuff, so this way it's super easy to search those text files if I'm trying to find something that I only vaguely remember.

Remembering specific words is hard for me, but I can get neighboring words and get in the ballpark, and simple text search or claude code gets me the rest of the way.

The screenshot gets uploaded from my phone to Dropbox, then on my desktop at home a script just periodically checks if there's any new screenshots. It's been running since Jan of last year, so coming up on a year now.

I'm doing it with gemini-cli: 1. analyze '/Users/YOURNAME/Movies/' and for each mp4 file give a meaningful name base on the content of the video 2. analyze '/Users/YOURNAME/Pictures/' and for each image file give a meaningful name base on the content of the image

For single-purpose LLM tools, I personally prefer ollama. idk if you can make the provider agnostic or not

I bet you are running some personal server or tinkering VM. Why not use a dedicated, coherent tool like Immich to manage all your image organisation needs? I don't see how this renaming would help me in any way, to make use of old screenshots left in random places.

  • Maybe instead of shooting people down in “What are you working on” threads (I see you have priors), you can instead share something cool that you’re working on.