/immich-photo-manager:storage-optimizerfrom Photo Manager for Immich
Analyzes disk usage in an Immich photo library to identify storage optimization opportunities including redundant RAW+JPEG pairs, oversized videos, and sidecar files.
Ships in Photo Manager for Immich. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Before doing ANYTHING else in this skill, call ping on the Immich MCP server.
ping succeeds → proceed with the skill normally.ping fails or the MCP tools are not available → STOP. Do not continue. Tell the user:❌ Immich is not connected. This plugin needs a running Immich MCP server to work.
Run /setup-immich-photo-manager to configure your Immich connection. You'll need:
- Your Immich server URL (e.g.,
http://192.168.1.100:2283)- An Immich API key (how to create one)
- The MCP server configured (see /setup-immich-photo-manager)
Nothing in this plugin will work until the connection is configured.
Do NOT skip this check. Do NOT try to run any other tool first. Always ping, always block if it fails.
Analyze storage usage in an Immich photo library, identify the biggest consumers, and recommend strategies to reclaim space without losing important content.
get_statistics gives the totals (photos, videos, storage used) in one call, with no database access. The query below is the optional fallback for the per-type averages and maximums Immich's API does not report; the plugin never provides database access, so it only applies to a user who already has psql on their own Immich.
-- Total storage by asset type
SELECT type,
count(*) as files,
pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as total_size,
pg_size_pretty(avg(("exifInfo"->>'fileSizeInByte')::bigint)) as avg_size,
pg_size_pretty(max(("exifInfo"->>'fileSizeInByte')::bigint)) as max_size
FROM asset WHERE "deletedAt" IS NULL
GROUP BY type;
-- Trash storage (reclaimable immediately)
SELECT
count(*) as trashed_files,
pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as trash_size
FROM asset WHERE "deletedAt" IS NOT NULL;
-- File formats by count and size
SELECT
upper(split_part("originalPath", '.', -1)) as format,
count(*) as files,
pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as total_size,
pg_size_pretty(avg(("exifInfo"->>'fileSizeInByte')::bigint)) as avg_size,
round(100.0 * sum(("exifInfo"->>'fileSizeInByte')::bigint) /
(SELECT sum(("exifInfo"->>'fileSizeInByte')::bigint) FROM asset WHERE "deletedAt" IS NULL), 1) as pct_of_total
FROM asset WHERE "deletedAt" IS NULL
GROUP BY format ORDER BY sum(("exifInfo"->>'fileSizeInByte')::bigint) DESC;
Large files (>50MB):
The MCP tool search_large_assets(min_size_mb=50, size=50) answers this without database access. It returns the biggest files largest-first with filename, size in MB and date. Use the SQL below only when you need columns it does not return, such as the camera make or the original path.
SELECT "id", "originalPath", type,
pg_size_pretty(("exifInfo"->>'fileSizeInByte')::bigint) as size,
"exifInfo"->>'make' as camera,
"localDateTime"
FROM asset
WHERE "deletedAt" IS NULL
AND ("exifInfo"->>'fileSizeInByte')::bigint > 52428800 -- 50MB
ORDER BY ("exifInfo"->>'fileSizeInByte')::bigint DESC
LIMIT 50;
RAW+JPEG pairs:
-- Find RAW files that have a matching JPEG
WITH raws AS (
SELECT "originalFileName",
regexp_replace("originalFileName", '\.[^.]+$', '') as base_name,
("exifInfo"->>'fileSizeInByte')::bigint as size
FROM asset
WHERE "deletedAt" IS NULL
AND upper(split_part("originalPath", '.', -1)) IN ('ARW', 'CR2', 'CR3', 'NEF', 'RAF', 'DNG', 'ORF', 'RW2')
),
jpegs AS (
SELECT regexp_replace("originalFileName", '\.[^.]+$', '') as base_name
FROM asset
WHERE "deletedAt" IS NULL
AND upper(split_part("originalPath", '.', -1)) IN ('JPG', 'JPEG')
)
SELECT count(*) as raw_with_jpeg,
pg_size_pretty(sum(r.size)) as raw_size_reclaimable
FROM raws r
INNER JOIN jpegs j ON r.base_name = j.base_name;
Videos by size tier:
SELECT
CASE
WHEN ("exifInfo"->>'fileSizeInByte')::bigint > 1073741824 THEN '>1GB'
WHEN ("exifInfo"->>'fileSizeInByte')::bigint > 524288000 THEN '500MB-1GB'
WHEN ("exifInfo"->>'fileSizeInByte')::bigint > 104857600 THEN '100-500MB'
WHEN ("exifInfo"->>'fileSizeInByte')::bigint > 52428800 THEN '50-100MB'
ELSE '<50MB'
END as size_tier,
count(*) as videos,
pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as total
FROM asset
WHERE "deletedAt" IS NULL AND type = 'VIDEO'
GROUP BY 1 ORDER BY min(("exifInfo"->>'fileSizeInByte')::bigint) DESC;
-- Monthly storage growth
SELECT
date_trunc('month', "localDateTime") as month,
count(*) as new_assets,
pg_size_pretty(sum(("exifInfo"->>'fileSizeInByte')::bigint)) as monthly_growth
FROM asset WHERE "deletedAt" IS NULL
AND "localDateTime" > now() - interval '12 months'
GROUP BY 1 ORDER BY 1;
Calculate: at current growth rate, how many months until disk is full?
When only a count is needed (how many videos, how many photos from one camera, how many favorites), use search_statistics instead of a query or a search: it returns the number alone, so a whole breakdown costs a handful of integers rather than pages of assets. get_timeline_buckets() gives the month-by-month volume the growth projection needs, also in one call.
STORAGE ANALYSIS
═══════════════════════════════════════
OVERVIEW
Total storage: 182.4 GB
Photos: 94.2 GB (39,596 files, avg 2.4 MB)
Videos: 85.1 GB (4,983 files, avg 17.1 MB)
Trash: 12.3 GB (8,433 files) ← RECLAIMABLE NOW
TOP CONSUMERS
1. Videos >100MB: 43 files, 18.2 GB
2. RAW files: 892 files, 22.4 GB (614 have matching JPEGs)
3. HEIC photos: 7,890 files, 31.2 GB
4. Large screenshots: 234 files, 1.8 GB
RECLAIMABLE SPACE
Empty trash: 12.3 GB
Remove RAW where JPEG exists: 15.8 GB (614 RAW files)
Remove large screenshots: 1.8 GB (234 files)
TOTAL POTENTIAL: 29.9 GB (16.4% of library)
GROWTH RATE
Last 12 months: 2.1 GB/month average
At current rate: ~24 months until 250 GB disk full
RECOMMENDATIONS
1. Empty trash immediately → 12.3 GB freed
2. Review RAW+JPEG pairs → keep JPEGs, remove RAWs for 15.8 GB
3. Review 43 videos >100MB, any worth compressing?
4. 234 large screenshots, worth keeping?
force: trueNEVER auto-delete. Always present findings and wait for approval.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/album-managerCreate, curate, and publish Immich albums organized by geography, theme, or custom criteria. Use when the user says "create an album", "organize my photos by location", "make a gallery album", "curate photos from Italy", "publish album", "geographic albums", "album from my trip to X", "share this album", or any variation of creating, managing, or publishing photo albums in Immich. Also triggers on "what albums do I have", "list albums", "album stats", "show me photos from", "generate gallery for", "show me the album".
/album-reportTurn an album or a selection into a PDF report: metadata per photo, frames per video, and Claude's own description of what is in each one. Use when the user says "PDF of the album", "album report", "export to PDF", "make a document with these photos", "catalog the album", "identify what is in each video and put it in a PDF", or any variation of wanting a printable report of a set of photos and videos.
/auto-album-curatorMonitor your Immich library for new photos that match existing albums and suggest additions. Keeps albums fresh by finding new photos that belong in existing collections based on GPS location, visual similarity (CLIP), and date patterns. Use when the user says "update my albums", "refresh albums", "new photos for albums", "curate albums", "auto-curate", "keep albums fresh", "album suggestions", "what new photos belong in my albums", "smart album update", or any variation of wanting to keep their albums up to date with recent imports.
/duplicate-reportRun a full duplicate analysis on an Immich photo library using perceptual hashing. Finds cross-source duplicates (e.g. Apple Photos vs Google Photos exports), internal duplicates, and generates a detailed report with removal recommendations. Use when the user says "find duplicates", "duplicate report", "how many duplicates", "library health check", "photo dedup report", "run duplicate analysis", "compare my photo sources", or any variation of wanting to understand duplicate photos across import sources.
/library-health-reportRun a full health check on an Immich photo library: asset counts, storage usage, metadata completeness, orphaned files, and quality indicators. Use when the user says "library health", "health report", "library status", "library audit", "how healthy is my library", "photo stats", "library overview", "what's in my library", "library report", or any variation of wanting a full overview of their photo library's state.
/metadata-fixerScan for and fix broken or missing photo metadata: dates, GPS coordinates, timezone offsets, and camera info. Detects suspicious patterns (midnight/noon timestamps, missing GPS on geotagged trips) and proposes corrections using folder structure, neighboring photos, and EXIF inference. Use when the user says "fix metadata", "fix dates", "wrong dates", "missing GPS", "metadata repair", "exif fix", "photos have wrong time", "noon dates", "midnight timestamps", "fix my photo dates", "metadata fixer", or any variation of wanting to repair photo metadata.
npx claudepluginhub drolosoft/immich-photo-manager --plugin immich-photo-managerOther plugins' skills for the same job