rag-retrieval-audit

rag-retrieval-audit is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 66 tokens per session (3,890 once invoked), scanned A, original, MIT.

An audit for retrieval-augmented generation, a system that finds passages from a document collection and gives them to an AI model. It traces missing evidence from the query through indexing, filtering, ranking, and the model's final context.

In plain words
What is it for?
Run labeled queries, inspect retrieved chunks and source positions, calculate recall where relevance labels exist, and produce a per-query failure table. It also compares one controlled change at a time in a test index.
Why use it?
An AI answer can lack support because a document was never indexed, was filtered out, was split badly, or ranked too low. Separating these causes prevents changing the wrong part of the system.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the mas-ai-workflows plugin — 10 skills shipped together

Good fit Run labeled queries, inspect retrieved chunks and source positions, calculate recall where relevance labels exist, and produce a per-query failure table. It also compares one controlled change at a time in a test index.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/rag-retrieval-audit
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.

Any agent
npx skills add alivirgo/Major-AI-Skills --skill rag-retrieval-audit
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install mas-ai-workflows, the plugin that ships this one along with the rest of its 10 skills.

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-retrieval-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/rag-retrieval-audit/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/rag-retrieval-audit)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/rag-retrieval-audit"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/rag-retrieval-audit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rag-retrieval-audit

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/rag-retrieval-audit"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/rag-retrieval-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,890 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.00066 $0.03890
Opus 5.5 $0.00026 $0.01556
Sonnet 5.5 $0.00013 $0.00778
Haiku 4.5 $0.00007 $0.00389

Measured 21d ago against content hash 6b39bbb16512, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rag-retrieval-audit 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 21d 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.

plugins/mas-ai-workflows/skills/rag-retrieval-audit/SKILL.md · 321 lines

How it starts

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

RAG Retrieval Audit AI Skill Guide (Claude)

Overview & Engine Architecture

A RAG system fails in stages. Most “the model is wrong” tickets are retrieval, indexing, chunking, filter, or context-assembly failures that a stronger generator only hides with fluent guesses. This skill audits the retriever path only: did the answer-bearing evidence enter the final model context at the application’s real cutoff K?

Claude operates as a Principal RAG Reliability Engineer, specializing in stage-isolated failure taxonomy, ID-based Recall@K / MRR / nDCG, chunk-boundary forensics, hybrid-search arm health, and ACL-safe relevance denominators.

┌─────────────────────────────────────────────────────────────┐
│                 RAG Retrieval Audit Stack                   │
│                                                             │
│  Corpus governance                                          │
│  ├── Source docs → parse → chunk → embed → index revision   │
│  └── Metadata: ACL, tenant, version/hash, embedding_model   │
│                                                             │
│  Query path                                                 │
│  ├── Rewrite / expand → dense ± sparse (BM25) → fuse (RRF)  │
│  ├── Optional rerank → filters/thresholds → context pack    │
│  └── Generator (out of scope for retrieval metrics)         │
│                                                             │
│  Audit harness                                              │
│  ├── Labeled queries + eligible relevant chunk/doc IDs      │
│  ├── Per-query traces (retrieved IDs, ranks, scores, filters│
│  └── Metrics @ app K: hit-rate, Recall@K, Precision@K, MRR, │
│      nDCG; separate faithfulness later                      │
└─────────────────────────────────────────────────────────────┘

When to use / when not to

Use when

  • Answers are confident but wrong, and you need to know if evidence was missing vs ignored.
  • You are changing chunk size, embeddings, hybrid weights, filters, or rerankers.
  • Production has zero-result or “wrong doc family” clusters.
  • Compliance requires proving which sources were eligible for a user.

Read the full file on GitHub · 321 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 21d ago Changed · +286 lines · +36 tokens per session 6b39bbb16512
  2. 1mo ago First seen · 35 lines · 30 tokens per session scan A c7da20e526d9

Subscribe to this mod's changes

rag-retrieval-audit is a skill published in the GitHub repository alivirgo/Major-AI-Skills (2 stars, last pushed today), licensed MIT. It adds 66 tokens to every session and 3,890 once invoked, about $0.0003 per session on Opus 5.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-12.

Related

Other skills, from other repositories