vector-db-cleanup

vector-db-cleanup is a skill for Claude Code from richfrem/agent-plugins-skills. It costs 115 tokens per session (505 once invoked), scanned A, original, MIT.

A maintenance tool that removes search-index entries for files that were deleted or renamed.

In plain words
What is it for?
It is for synchronising a ChromaDB vector database with filesystem changes after deletions, moves, or refactors.
Why use it?
It prevents meaning-based search from returning chunks that point to files no longer present in the repository.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the agent-memory plugin — 13 skills, 2 commands, 9 agents shipped together

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 skills/richfrem/agent-plugins-skills/vector-db-cleanup
Any agent
npx skills add richfrem/agent-plugins-skills --skill vector-db-cleanup
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Made for: Claude Code.

Or install agent-memory, the plugin that ships this one along with the rest of its 13 skills, 2 commands, 9 agents.

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 vector-db-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/vector-db-cleanup.svg)](https://agentmods.dev/skills/richfrem/agent-plugins-skills/vector-db-cleanup)
Your own site
<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/vector-db-cleanup"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/vector-db-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 505 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.1 $0.00115 $0.00505
Opus 5 $0.00057 $0.00253
Sonnet 5 $0.00023 $0.00101
Haiku 4.5 $0.00012 $0.00051

Measured 2d ago against content hash e72502782151, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

vector-db-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 2d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/cleanup.py, scripts/init.py, scripts/query.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/agent-memory/skills/vector-db-cleanup/SKILL.md · 67 lines

What it actually says

Dependencies

This skill requires the chromadb and langchain packages defined in the plugin root.


VDB Cleanup Agent

Role

You remove stale and orphaned chunks from the ChromaDB vector store. A chunk is stale when its source file no longer exists on disk. Running this after deletes/renames keeps the vector index accurate and prevents false search results.

This is a write (delete) operation.

When to Run

  • After deleting or renaming files that were previously ingested.
  • After a major refactor that moved directories.
  • When query.py returns results pointing to non-existent files.
  • Periodically as housekeeping to maintain index health.

Execution Mode

This skill defaults to In-Process mode for zero-latency direct disk access. No background server is required.

Execution Protocol

1. Identify Search Profile

Verify available profiles in .agent/learning/vector_profiles.json. The default profile is usually wiki.

2. Run Cleanup

Note: The --profile flag is mandatory to ensure the correct collection and disk paths are loaded.

python ./scripts/cleanup.py --profile wiki

3. Verify Store Integrity (Optional)

Run the consistency check to verify that remaining facts are still supported.

python ./scripts/vector_consistency_check.py --profile wiki --topic .agent/learning/

Rules

  • Profile Sovereignty: Always pass --profile to ensure the correct semantic space is pruned.
  • API Integrity: NEVER attempt to delete chunks from the database SQLite files directly. Always use cleanup.py.
  • Transparency: State which profile was cleaned and how many chunks were removed.
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. 2d ago First seen · 67 lines · 115 tokens per session scan A e72502782151

Subscribe to this mod's changes

vector-db-cleanup is a skill published in the GitHub repository richfrem/agent-plugins-skills (6 stars, last pushed yesterday), licensed MIT. It adds 115 tokens to every session and 505 once invoked, about $0.0006 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-09-03.

Related

Other skills, from other repositories

embeddings

Vector embeddings with HNSW indexing, sql.js persistence, and hyperbolic support. 75x faster with agentic-flow integration. Use when: semantic search, pattern matching, similarity queries, knowledge retrieval. Skip when: exact text matching, simple lookups, no semantic understanding needed.

ruvnet/ruflo · 62 tokens

pgvector-semantic-search

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. Trigger when user asks to: Store or search vector embeddings in PostgreSQL Set up semantic search, similarity search, or nearest neighbor search Create HNSW or IVFFlat indexes for vectors…

timescale/pg-aiguide · 190 tokens

postgres-hybrid-text-search

Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). Trigger when user asks to: Combine keyword and semantic search Implement hybrid search or multi-modal retrieval Use BM25/pgtextsearch with pgvector together Implement RRF (Reciprocal…

timescale/pg-aiguide · 162 tokens

cloudflare-vectorize

Cloudflare Vectorize vector database for semantic search and RAG. Use for vector indexes, embeddings, similarity search, or encountering dimension mismatches, filter errors.

secondsky/claude-skills · 37 tokens

AgentDB Vector Search

Implement semantic vector search with AgentDB for intelligent document retrieval, similarity matching, and context-aware querying. Use when building RAG systems, semantic search engines, or intelligent knowledge bases.

ruvnet/ruflo · 41 tokens

laravel-vector-search

Use when implementing semantic/vector search in Laravel 13 with PostgreSQL + pgvector.

fusengine/agents · 22 tokens