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.
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.