rag-cite-sources

rag-cite-sources is a skill for Claude Code, Codex from lyonzin/knowledge-rag. It costs 70 tokens per session (1,446 once invoked), scanned A, original, MIT.

A rule for adding file-based citations to technical claims taken from a local document collection.

In plain words
What is it for?
Citing numbers, settings, system behavior, code examples, design decisions, runbooks, and recommendations based on indexed documents.
Why use it?
It makes answers easier to check and helps readers find the exact supporting text.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Citing numbers, settings, system behavior, code examples, design decisions, runbooks, and recommendations based on indexed documents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lyonzin/knowledge-rag/rag-cite-sources
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 lyonzin/knowledge-rag --skill rag-cite-sources
Clone the repo
git clone --depth 1 https://github.com/lyonzin/knowledge-rag

Made for: Claude Code, Codex.

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-cite-sources

README.md
[![agentmods](https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-cite-sources.svg)](https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-cite-sources)
Your own site
<a href="https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-cite-sources"><img src="https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-cite-sources.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,446 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 63
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.00070 $0.01446
Opus 5 $0.00035 $0.00723
Sonnet 5 $0.00014 $0.00289
Haiku 4.5 $0.00007 $0.00145

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

Security

Grade A, and why

rag-cite-sources 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.

skills/foundation/rag-cite-sources/SKILL.md · 150 lines

How it starts

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

rag-cite-sources — every claim traces to a source

When to use this skill

Whenever an answer contains any of these:

  • A specific number, threshold, config value, or version taken from the corpus
  • A statement about how the system currently works, was designed, or was decided
  • A code snippet, function signature, or API contract quoted from indexed files
  • A "the runbook says", "the ADR says", "the RFC decided", "we agreed" claim
  • A recommendation grounded in prior team practice

Basically: if a curious reader would want to double-check where you got that, cite.


What this skill commits to

Every technical claim in the response carries a citation of the form:

  • [path/to/file.md:42] — line-anchored (from search_knowledge result's source field)
  • [path/to/file.md#section-heading] — section-anchored for Markdown
  • [path/to/file.md] — file-only, when line/section is not available

Citations are inline at the point of the claim, not batched at the end. One claim = one citation.


Steps

  1. When you call search_knowledge or get_document, capture:

    • The source field (usually the file path)
    • The filename (short name for display)
    • Any chunk_id or line hint in the metadata
    • The actual content you are about to quote or paraphrase
  2. When you draft the response, mark every fact-carrying sentence with its source. Preferred inline syntax:

    Per ADR-0018 [docs/adr/0018-auth.md], the payment service uses mTLS between services.
    The retry policy is 3 attempts with exponential backoff [services/payment/retry.py].
    
  3. If quoting verbatim, use fenced blockquote + citation:

    > "All external API calls must timeout after 30 seconds."
    > — [docs/architecture/http-contracts.md#timeouts]
    
  4. If synthesizing across multiple sources, cite each:

    The service uses OAuth2 [docs/adr/0018-auth.md] with a 15-minute access token TTL
    [config/auth.yaml:12] and refresh-token rotation on every use [docs/security/oauth-flow.md].
    

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

Subscribe to this mod's changes

rag-cite-sources is a skill published in the GitHub repository lyonzin/knowledge-rag (273 stars, last pushed 3d ago), licensed MIT. It adds 70 tokens to every session and 1,446 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

rag-perf

Performance benchmarking for a deployed NVIDIA RAG Blueprint server: profiling pass + aiperf load test driven by a single YAML config. Not for accuracy / RAGAS scoring (use rag-eval) or for deploying / repairing services (use rag-blueprint).

NVIDIA-AI-Blueprints/rag · 56 tokens

rag-blueprint

NVIDIA RAG Blueprint — deploy, configure, troubleshoot, and manage. Handles any RAG action: deploy, install, start, enable, disable, toggle, change, configure, troubleshoot, debug, fix, shutdown, stop, or tear down any RAG feature or service (Agentic RAG, VLM, guardrails, query rewriting, models, search, ingestion…

NVIDIA-AI-Blueprints/rag · 92 tokens

rag-eval

Filesystem RAG benchmarks: corpus/, train.json, evaluaterag.py (RAGAS quality). Not for prod monitoring, latency/throughput benchmarking (use rag-perf), or evals outside this repo layout.

NVIDIA-AI-Blueprints/rag · 48 tokens

pinecone:full-text-search

Create, ingest into, and query a Pinecone full-text-search (FTS) document index using the graduated document-schema API (Python SDK 10.0.0, API version 2026-07). Use when the user or agent asks to build a text search index on Pinecone, add dense or sparse vector fields, ingest documents, construct scoreby clauses…

pinecone-io/pinecone-claude-code-plugin · 163 tokens

pinecone:n8n

Build n8n workflows using the Pinecone Assistant node or Pinecone Vector Store node. Use when building RAG pipelines, chat-with-docs workflows, configuring Pinecone nodes in n8n, troubleshooting Pinecone n8n nodes, or asking about best practices for Pinecone in n8n.

pinecone-io/pinecone-claude-code-plugin · 67 tokens

rag

Use when building grounded Q&A over your own corpus — chunk, retrieve hybrid, rerank, ground, cite chunk ids, refuse when the sources fall short — or when the right document is retrieved but the answer is still wrong, invented, or unmeasured. NOT operating the store itself — collection schema, HNSW efsearch…

ericrisco/rsc-harness · 79 tokens