scrub-metadata
Skill21 starsChanged 7 days agoMITView on GitHub
Strip EXIF / IPTC / XMP metadata from images using exiftool. Use when the user wants to remove identifying metadata (GPS, camera, timestamps, thumbnails) from a single image, a folder, or a recursive tree before sharing or publishing. Supports preview, backup-first, whitelist of fields to keep (e.g. Orientation), and recursive operation. Logs each run to notes/.
- Installs packages
In this repository28 other files it gives its agents.
- ai-graphicsSkill
- auto-deskewSkill
- auto-toneSkill
- auto-white-balanceSkill
- batch-set-copyrightSkill
- check-model-pricingSkill
- convert-to-avifSkill
- fast-resizeSkill
- fast-thumbnailSkill
- from-jxlSkill
- images-to-pdfSkill
- install-depsSkill
- new-projectSkill
- new-workflowSkill
- open-workspaceSkill
- optimize-jpegSkill
- optimize-pngSkill
- pdf-extract-embedded-imagesSkill
- pdf-to-imagesSkill
- read-metadataSkill
- set-metadataSkill
- svg-to-rasterSkill
- to-jxlSkill
- transcode-jpeg-to-jxl-losslessSkill
- upscale-imageSkill
- vectorizeSkill
- web-readySkill
- workspace-setupSkill
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 7 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Remove EXIF / IPTC / XMP metadata from images in place (or to a copy), with preview and logging.
- Distinctive: line 14
Before publishing photos to a public blog, social media, or client deliverable.
- Distinctive: line 22
Ask the user (and confirm before touching files):
- Distinctive: line 25
Recursive?: If the target is a folder, ask whether to descend into subfolders.
- Very specific: line 26
Backup first?: Default yes — exiftool keeps _original sidecars automatically, but offer an explicit backup/ copy for the nervous case.
- Distinctive: line 40
Run a read-only pass and show the user a summary:
- Distinctive: line 59
Wait for user confirmation.
- Very specific: line 90
If the user asked to keep additional fields, extend the -tagsFromFile @ -Field1 -Field2 ...
- Very specific: line 106
Write notes/scrub-metadata-{YYYY-MM-DD-HHMMSS}.md in the target folder (or the cwd if the target was a single file).
- Very specific: line 115
If notes/ doesn't exist, create it.
- Distinctive: line 123
Never operate on the only copy of irreplaceable originals without a backup.
- Distinctive: line 124
Do not push scrubbed files anywhere automatically — that's a human decision.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Scrub Image Metadata
Remove EXIF / IPTC / XMP metadata from images in place (or to a copy), with preview and logging. Wraps exiftool — do not hand-roll metadata parsing.
When to use
- Before publishing photos to a public blog, social media, or client deliverable.
- Bulk-cleaning an archive that may contain GPS or serial-number metadata.
- Preparing reference images for distribution where only orientation should be preserved.
Procedure
1. Establish scope
Ask the user (and confirm before touching files):
- Target path — single file, folder, or recursive tree. Default: current working directory.
- Recursive? If the target is a folder, ask whether to descend into subfolders. Default no (flat, current folder only) unless the user says "recursive" or supplies a root.
- Backup first? Default yes —
exiftoolkeeps_originalsidecars automatically, but offer an explicitbackup/copy for the nervous case. - Whitelist — fields to preserve. Common sensible default: keep
Orientationso the image renders right-way-up. Ask if the user wants to preserve anything else (ColorSpace, ICC profile, copyright). - Dry run vs apply — always preview first.
2. Check tooling
command -v exiftool || echo "exiftool not installed — install with: sudo apt install libimage-exiftool-perl"Abort if missing.
3. Preview what will be stripped
Run a read-only pass and show the user a summary:
# Show metadata currently present on a sample file
exiftool -G1 -a -s "sample.jpg"
# Count files that would be touched
find <target> -maxdepth <1|999> -type f \
\( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \
-o -iname '*.heic' -o -iname '*.webp' -o -iname '*.tif' \
-o -iname '*.tiff' \) | wc -lPrint:
- File count by extension.
- Which tag groups will be removed (EXIF, GPS, IPTC, XMP, MakerNotes, Thumbnail).
- Which tags will be kept (the whitelist).
- Whether a
backup/copy will be made.
Wait for user confirmation.
4. Backup (if requested)
mkdir -p backup/
cp -r <target>/. backup/Note that exiftool also keeps its own <file>_original sidecars in-place unless -overwrite_original is passed — decide with the user whether to keep those or clean them up at the end.
5. Strip metadata
Two patterns — pick based on scope:
Folder (non-recursive):
exiftool -all= -tagsFromFile @ -Orientation \
-ext jpg -ext jpeg -ext png -ext heic -ext webp -ext tif -ext tiff \
"<target>"Recursive tree:
exiftool -r -all= -tagsFromFile @ -Orientation \
-ext jpg -ext jpeg -ext png -ext heic -ext webp -ext tif -ext tiff \
"<target>"If the user asked to keep additional fields, extend the -tagsFromFile @ -Field1 -Field2 ... list. If the user asked to preserve nothing (full nuke), drop the -tagsFromFile clause — just -all=.
To discard the _original sidecars in the same run, append -overwrite_original. Only do this if a backup was made in step 4, or if the user explicitly waived backup.
6. Verify
Sample a few output files and show their remaining metadata:
exiftool -G1 -a -s "<sample-output>.jpg"Confirm only whitelisted tags remain. If unexpected metadata survived (common with PNG text chunks or XMP sidecars), flag it and offer a second pass with -xmp:all= or a manual exiftool -ext xmp -overwrite_original -all= <path>.
7. Log
Write notes/scrub-metadata-{YYYY-MM-DD-HHMMSS}.md in the target folder (or the cwd if the target was a single file). Include:
- Target path and whether recursive.
- Backup taken? Where?
- Whitelist used.
- File count processed, count skipped, count failed.
- Sample before/after metadata dump for one file.
- Any warnings (XMP sidecars found, MakerNotes that resisted strip, etc.).
If notes/ doesn't exist, create it.
Notes
exiftoolis the only sane tool for this — don't useconvert -strip(ImageMagick) as the primary path; it silently drops colour profiles and doesn't touch XMP sidecars reliably.- GPS is the most common sensitive leak — always explicitly confirm it's gone in step 6 (
exiftool -GPS:all <file>should return nothing). - For HEIC from iPhones, there are often two copies of EXIF (container + embedded).
exiftool -all=handles both, but verify. - For PNGs, metadata lives in
tEXt/iTXt/eXIfchunks —exiftool -all=covers them. Do not rely onoptipng -strip allas a primary scrubber. - Never operate on the only copy of irreplaceable originals without a backup. If the user is working on an archive, insist on step 4.
- Do not push scrubbed files anywhere automatically — that's a human decision.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

