Brings repo HEAD up to current live skill state in ~/.claude/skills/screenshot-rename/. - recognize CleanShot AND Apple Screenshot filenames in one pass - normalize U+202F (NARROW NO-BREAK SPACE) before AM/PM in Apple Screenshot names - preserve user-typed keyword prefix and merge into description - skip files already in renamed form (idempotent re-run) - gotchas #11-13 added to SKILL.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
screenshot-rename
A Claude Code skill that turns a folder of timestamp-named screenshots into a folder of human-readable, searchable filenames — using parallel Haiku vision agents.
Documentation: pages.tojo.team/cardinale/screenshot-rename — full homepage with the workflow, gotchas, and use-case worked examples.
CleanShot 2026-04-15 at 09.14.07.png
↓
CleanShot - Shamel Studio Affiliate Referral Code Modal - 2026-04-15 at 09.14.07.png
Built for CleanShot-style screenshot folders, but works on any directory of .png / .gif / .mp4 / .pdf files named only by timestamp.
Highlights
- Parallel — describes ~200 files in 3 minutes using 10 concurrent Haiku subagents.
- Safe — pre-builds the full rename plan in memory, validates uniqueness and target collisions, then renames atomically with file-count audit. Designed after losing 4 files to a
mvoverwrite during prototyping. - Handles video/PDF — extracts the first frame so vision agents can describe them.
- Resizes for the vision tool — Retina screenshots exceed Read's image cap; pipeline downsamples to 1568px max.
Installation
This is a Claude Code skill. Drop the screenshot-rename/ directory into ~/.claude/skills/:
git clone https://gitea.tojo.team/cardinale/screenshot-rename.git ~/.claude/skills/screenshot-rename
In your next Claude Code session, ask:
rename all the cleanshot files in
~/Documents/Screenshots/based on their content
The skill will activate automatically.
Usage from the command line
You can also drive the pipeline directly:
# 1. Prep — extract frames, resize, build batches
python3 pipeline.py prep --src "/path/to/folder" --batch-size 19
# 2. (In a Claude Code session, dispatch one Haiku subagent per
# /tmp/screenshot-rename/full-batch-NN file using the prompt template
# in SKILL.md.)
# 3. Plan — aggregate descriptions, validate, build rename map
python3 pipeline.py plan --src "/path/to/folder"
# 4. Execute — apply the plan, audit file count
python3 pipeline.py execute --src "/path/to/folder"
The dispatch step (#2) currently requires a Claude Code session. See Roadmap.
Documentation
- Homepage with worked examples: docs/index.html
- Full skill spec: SKILL.md
- Pipeline source: pipeline.py
The gotchas this skill encodes
This skill exists because every one of these caused real damage during development:
- The macOS
Readtool has an image-size cap. Resize first. - Vision can't read
.mp4or multi-page.pdfdirectly. Extract a frame. - Bash regex
[[ =~ ]]does NOT populateBASH_REMATCHin zsh. Targets become empty. Loops collide on the same filename. Files vanish. Use Python for any filename mutation. mvsilently overwrites. Usemv -noros.renamewith explicit pre-existence check.- Pre-build the entire rename plan in memory and validate uniqueness before any
mv. - Audit
len(os.listdir(DEST))before and after. Equal count == proof no overwrites. - iCloud-synced files in Time Machine local snapshots are file-provider stubs, not bytes. External backups (Backblaze, Time Machine to physical disk) are the real recovery source.
Bash run_in_backgroundmay exit early onwhile readloops. Run renames foreground via Python.- Haiku occasionally returns the resized
.jpgfilename instead of the original.png. Validator must try alt extensions. - Always preserve the original
.mp4/.pdfextension — describe via the extracted frame, rename the source.
The full discussion is in SKILL.md.
Roadmap
- Direct Anthropic API mode (no Claude Code session required) — needs
ANTHROPIC_API_KEY - Custom prompt templates per-folder
- Optional preservation of dots in technical strings (
v2.1currently becomesV21) - Dry-run flag on
execute
License
MIT — see LICENSE.