name: Photos
description: Organize, index, and search local photo libraries with AI-powered metadata and safe file handling.
metadata: {"clawdbot":{"emoji":"๐ผ๏ธ","requires":{"bins":["exiftool"]},"os":["linux","darwin","win32"]}}
Safety First
Never delete photos directly โ move to
.photo-trash/folder with original path preserved in filenameNever overwrite originals โ edits go to
edited/subfolder, originals stay untouchedBefore bulk operations, create manifest:
photos-pending.jsonwith planned actions for user reviewWhen user says "delete duplicates", move to trash and report count โ let them empty trash manually
Indexing Strategy
Create
.photo-index/in library root with one JSON sidecar per photoSidecar filename:
{original-hash}.jsonโ survives renames and movesIndex fields:
hash,path,date_taken,camera,gps,description,tags,indexed_atRun indexing incrementally โ skip files with matching hash already indexed
Store description from vision analysis in sidecar, not in EXIF (non-destructive)
Vision Analysis (Token-Efficient)
Don't analyze every photo upfront โ index on-demand when user searches or asks
Cache vision results permanently in sidecar JSON โ never re-analyze same photo
For bulk analysis, process in batches of 20 with progress updates
Use concise prompts: "Describe this photo in 2-3 sentences. List people, objects, location, activity."
Skip screenshots and memes (detect by aspect ratio + lack of EXIF) unless explicitly requested
Duplicate Detection
Generate perceptual hash (pHash) alongside content hash โ catches near-duplicates and resized copies
Group duplicates by pHash similarity, keep highest resolution as "original"
Report duplicates with thumbnails/paths, never auto-delete
Consider EXIF date โ oldest is likely the original, newer copies are backups
Search Patterns
By content: Search sidecar descriptions with simple text match first, vision re-analysis if no hits
By date: Parse EXIF DateTimeOriginal, fall back to file mtime
By location: Reverse geocode GPS once, store city/country in sidecar for text search
By person: If user identifies someone once ("that's Maria"), tag all similar faces in index
EXIF Handling
Read:
exiftool -json photo.jpgโ returns all metadata as JSONWrite date:
exiftool -DateTimeOriginal="2024:03:15 14:30:00" photo.jpgStrip GPS before sharing:
exiftool -gps:all= photo.jpg(operates on copy, not original)Batch read:
exiftool -json -r /photos/โ recursive, outputs array
File Organization
Propose structure, don't impose:
YYYY/MM/orYYYY/MM-DD/based on user preferenceRename pattern:
YYYYMMDD_HHMMSS_originalname.extโ preserves original name, adds sortable prefixHandle timezone: EXIF dates are local time โ ask user's timezone once, store in
.photo-index/config.jsonHEIC to JPEG:
sips -s format jpeg input.heic --out output.jpg(macOS) orheif-convert(Linux)
NAS/Remote Libraries
For Synology/NAS: work with mounted paths, don't assume local speeds
Test connection before bulk operations:
ls /Volumes/photos | head -1For slow connections, build local index cache that syncs periodically
Respect
@eaDir(Synology thumbnails) and.DS_Storeโ skip in indexing