rag-retriever: Command for Claude Code

.claude/commands/rag-manage-collections.md

rag-manage-collections is a command for Claude Code from codingthefuturewithai/rag-retriever. It costs 0 tokens per session (973 once invoked), scanned A, original, MIT.

An administrative command guide for managing RAG Retriever collections and its vector store. It covers listing, deleting, cleaning, and checking the health of stored document collections.

In plain words
What is it for?
Use it to list collections, delete a named collection, remove the entire vector store, or assess the health and quality of a collection.
Why use it?
It provides a clear way to perform maintenance and understand the consequences of operations that remove searchable data.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is codingthefuturewithai/rag-retriever's own configuration. It tells Claude Code how to work on rag-retriever itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rag-retriever configures →

Reuse

Borrowing it

Nothing to install: this file belongs to codingthefuturewithai/rag-retriever. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/codingthefuturewithai/rag-retriever/main/.claude/commands/rag-manage-collections.md
Clone the repo
git clone --depth 1 https://github.com/codingthefuturewithai/rag-retriever

Made for: Claude Code.

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 rag-manage-collections

README.md
[![agentmods](https://agentmods.dev/badge/commands/codingthefuturewithai/rag-retriever/rag-manage-collections.svg)](https://agentmods.dev/commands/codingthefuturewithai/rag-retriever/rag-manage-collections)
Your own site
<a href="https://agentmods.dev/commands/codingthefuturewithai/rag-retriever/rag-manage-collections"><img src="https://agentmods.dev/badge/commands/codingthefuturewithai/rag-retriever/rag-manage-collections.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 973 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.00000 $0.00973
Opus 5 $0.00000 $0.00487
Sonnet 5 $0.00000 $0.00195
Haiku 4.5 $0.00000 $0.00097

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

Security

Grade A, and why

rag-manage-collections 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 7d 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.

.claude/commands/rag-manage-collections.md · 144 lines

How it starts

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

Manage RAG Retriever Collections

Administrative collection operations including deletion, cleanup, and maintenance tasks.

Prerequisites

This command requires both CLI access and MCP server configuration. Administrative operations use the CLI while status checking uses MCP tools.

Arguments

Use $ARGUMENTS to specify management operation:

  • "list" - Show all collections with detailed analysis
  • "delete COLLECTION_NAME" - Delete specific collection
  • "clean" - Delete entire vector store (nuclear option)
  • "health" - Assess collection health and quality

Examples:

  • "list" - Show all collections
  • "delete old_docs" - Delete specific collection
  • "clean" - Delete entire vector store
  • "health python_docs" - Check specific collection health

Implementation Approach

This command uses direct implementation combining MCP tools for analysis and CLI guidance for administrative actions.

Your Task

1. Parse Arguments

  • Extract operation type from $ARGUMENTS
  • Identify target collection name if specified
  • Provide guidance on available operations if unclear

2. Collection Management Operations

List Collections (Enhanced)
  • Use list_collections() to get current state
  • Analyze collection sizes, dates, and metadata
  • Identify potential issues or maintenance needs
  • Recommend collection organization improvements
Delete Specific Collection
  • IMPORTANT: This requires CLI access, not MCP
  • Use list_collections() to verify collection exists
  • Provide exact CLI command: rag-retriever --clean --collection COLLECTION_NAME
  • Explain that this is irreversible
  • Suggest verification steps after deletion
Clean Entire Vector Store
  • CRITICAL: This deletes ALL data permanently
  • Use list_collections() to show what will be deleted
  • Provide exact CLI command: rag-retriever --clean
  • Require explicit confirmation from user
  • Explain recovery options (re-indexing from sources)
Health Assessment
  • Use vector_search() to test collection functionality
  • Check for common issues (empty results, low scores)
  • Identify collections needing maintenance
  • Recommend improvement actions

Read the full file on GitHub · 144 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. 7d ago First seen · 144 lines · 0 tokens per session scan A a1f66292c9cd

Subscribe to this mod's changes

rag-manage-collections is a command published in the GitHub repository codingthefuturewithai/rag-retriever (27 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 973 tokens. 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.