prune

prune is a command for coding agents from erhangundogan/videre. It costs 15 tokens per session (1,348 once invoked), scanned A, original, Apache-2.0.

A command that removes database records for media files no longer present on disk. It does not delete the real files.

In plain words
What is it for?
Use it after deleting duplicates or reorganizing folders, first with a dry run to review which stale records would be removed.
Why use it?
It keeps library counts and reports from showing files that were deleted or moved outside the database’s tracking.

Command

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.

agentmods
npx agentmods add commands/erhangundogan/videre/prune
Clone the repo
git clone --depth 1 https://github.com/erhangundogan/videre

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 prune

README.md
[![agentmods](https://agentmods.dev/badge/commands/erhangundogan/videre/prune.svg)](https://agentmods.dev/commands/erhangundogan/videre/prune)
Your own site
<a href="https://agentmods.dev/commands/erhangundogan/videre/prune"><img src="https://agentmods.dev/badge/commands/erhangundogan/videre/prune.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,348 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00015 $0.01348
Opus 5 $0.00008 $0.00674
Sonnet 5 $0.00003 $0.00270
Haiku 4.5 $0.00002 $0.00135

Measured 4d ago against content hash f71f5372c8cb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

prune 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 4d 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.

docs/src/content/docs/commands/prune.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Syncs the database with what is actually on disk. It never deletes real files: only database rows, and cached data derived from photos that are already gone.

videre prune --dry-run                 # show what would be removed
videre prune                           # remove stale entries and refresh metadata
videre prune --silent                  # no per-file output
videre prune --db ~/photos.db          # use a specific database
videre prune --prune-unreachable       # also drop entries whose folder is gone
videre prune --force                   # allow an unusually large cleanup

When to run it

The usual moment is right after deleting duplicates:

videre dedupe | xargs trash    # files are gone from disk...
videre prune                   # ...now the database agrees

Until you do, videre stats still counts the deleted files, and reports still list them (they are filtered out at generation time, but the rows remain).

Also worth running after moving or reorganising folders by hand, since rows are keyed by path: a moved file looks like a deletion plus a new file, and the old row lingers until pruned.

Always look first on a library you care about:

videre prune --dry-run

What one pass does

  1. Removes rows for files no longer on disk
  2. Refreshes the stored timestamp of any file whose modification time has changed since the last pass
  3. Deletes embeddings whose photo is gone, across every model
  4. Deletes cached thumbnails whose photo is gone

Steps 3 and 4 are the reason to prune at all rather than ignoring stale rows: they are what actually reclaims disk space.

Step 2 only touches rows that actually differ, so the count tells you something. Its usual cause is videre fix-dates, which rewrites modification times from EXIF and deliberately leaves the database alone; running prune afterwards reports exactly the number of files it changed. On a library nothing has touched, the count is zero and a second pass is a no-op.

Read the full file on GitHub · 139 lines

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. 4d ago First seen · 139 lines · 15 tokens per session scan A f71f5372c8cb

Subscribe to this mod's changes

prune is a command published in the GitHub repository erhangundogan/videre (2 stars, last pushed 6d ago), licensed Apache-2.0. It adds 15 tokens to every session and 1,348 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-31.