cleanup

cleanup is a command for Claude Code from drolosoft/immich-photo-manager. It costs 10 tokens per session (559 once invoked), scanned A, original, MIT.

A cleanup command for an Immich photo library, where Immich is a self-hosted app for storing and managing photos. It scans for screenshots, duplicate photos, or both, depending on the requested scope.

In plain words
What is it for?
Use it to inspect library statistics, find screenshots, find duplicate photos, or run a full cleanup scan; it requires a connected Immich server.
Why use it?
It helps identify unwanted or repeated images without deleting them automatically. It first checks the library and then presents the findings for review.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the immich-photo-manager plugin — 13 skills, 5 commands shipped together

Good fit Use it to inspect library statistics, find screenshots, find duplicate photos, or run a full cleanup scan; it requires a connected Immich server.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/drolosoft/immich-photo-manager/cleanup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/drolosoft/immich-photo-manager

Made for: Claude Code.

Or install immich-photo-manager, the plugin that ships this one along with the rest of its 13 skills, 5 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cleanup

README.md
[![agentmods](https://agentmods.dev/badge/commands/drolosoft/immich-photo-manager/cleanup.svg)](https://agentmods.dev/commands/drolosoft/immich-photo-manager/cleanup)
Your own site
<a href="https://agentmods.dev/commands/drolosoft/immich-photo-manager/cleanup"><img src="https://agentmods.dev/badge/commands/drolosoft/immich-photo-manager/cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 559 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00010 $0.00559
Opus 5 $0.00005 $0.00280
Sonnet 5 $0.00002 $0.00112
Haiku 4.5 $0.00001 $0.00056

Measured 8d ago against content hash 275ac92dfac5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/cleanup.md · 59 lines

What it actually says

⚠️ Connection Required — ALWAYS CHECK FIRST

Before doing ANYTHING else in this skill, call ping on the Immich MCP server.

  • If ping succeeds → proceed with the skill normally.
  • If 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:

  1. Your Immich server URL (e.g., http://192.168.1.100:2283)
  2. An Immich API key (how to create one)
  3. 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.

Run a cleanup scan on the Immich library. Scope determined by $ARGUMENTS:

  • screenshots — Find only screenshots
  • duplicates — Find only duplicate photos
  • all — Full scan (default if no argument)

Follow the photo-cleanup skill workflow:

  1. Get library statistics first
  2. Run the requested scan type(s)
  3. Present findings as a summary report — NEVER delete anything automatically
  4. Ask the user what action to take: archive, delete, or skip

There is no dry-run mode — the safety mechanism is the workflow itself: present findings first, act only after the user explicitly confirms, and use delete_assets(asset_ids, force=False) so items go to the trash and remain recoverable. Never pass force=true during cleanup. Report results in this format:

🧹 Cleanup Scan Results
━━━━━━━━━━━━━━━━━━━━━━
Library: {total} assets ({size})

📱 Screenshots detected: {count} ({percentage}%)
   High confidence: {count}
   Medium confidence: {count}
   Estimated space: {size}

🔄 Duplicates detected: {count} ({percentage}%)
   Exact copies: {count}
   Format duplicates: {count}
   Estimated space: {size}

💾 Total recoverable: {size}

What would you like to do?
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 59 lines · 10 tokens per session scan A 275ac92dfac5

Subscribe to this mod's changes

cleanup is a command published in the GitHub repository drolosoft/immich-photo-manager (47 stars, last pushed 4d ago), licensed MIT. It adds 10 tokens to every session and 559 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.