rag-design

rag-design is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 18 tokens per session (1,234 once invoked), scanned A, original, MIT.

An interactive planning command for designing a production RAG system and recording the decisions in an architecture document. RAG means retrieving relevant documents to help an AI model answer.

In plain words
What is it for?
It is for choosing a RAG stack, gathering system requirements, and creating an architecture decision record in a project documentation folder.
Why use it?
It exposes important design choices about documents, search, users, scale, and compliance before implementation begins. The result gives the project a written record of why the architecture was chosen.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit It is for choosing a RAG stack, gathering system requirements, and creating an architecture decision record in a project documentation folder.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/rag-design
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.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

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-design

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/rag-design.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/rag-design)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/rag-design"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/rag-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 18 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,234 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.00018 $0.01234
Opus 5 $0.00009 $0.00617
Sonnet 5 $0.00004 $0.00247
Haiku 4.5 $0.00002 $0.00123

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

Security

Grade A, and why

rag-design 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.

.claude/commands/rag-design.md · 140 lines

How it starts

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

/rag-design — Interactive RAG Architecture Design

You are helping the user design a production RAG system for the project: $ARGUMENTS.

Produce an Architecture Decision Record (ADR) in markdown, saved to docs/adr/NNN-rag-architecture.md (auto-numbered).

Phase 1: Discovery (ask interactively)

Ask these questions one at a time. Wait for the user's answer before continuing. Do not assume:

  1. Corpus characteristics

    • What kinds of documents? (PDF / Markdown / HTML / DOCX / mixed)
    • Approximate corpus size? (thousands / hundreds of thousands / millions of docs)
    • Update frequency? (static / daily / hourly / real-time)
    • Are there tables, code, images, or scanned docs?
  2. Query patterns

    • What kinds of questions will users ask? Give 3–5 representative examples.
    • Are there proper nouns, IDs, error codes, or rare terms? (BM25 needed)
    • Are queries conversational or keyword-style?
    • Single-question or multi-step (comparisons, multi-hop)?
  3. Users and isolation

    • Single-tenant or multi-tenant?
    • Access control requirements? (roles, groups, document-level ACLs)
    • Regulatory regime? (HIPAA, GDPR, SOC2, none)
  4. Latency and scale

    • Target p95 latency?
    • Expected QPS?
    • Cost ceiling per query (if known)?
  5. Non-RAG needs

    • Are some questions actually about structured data (orders, inventory, account state) that should hit SQL / API instead?
    • This is the §19.5 question — flag it explicitly.

Phase 2: Apply the playbook decision framework

Based on answers, walk these decisions and explain each:

  1. Is RAG the right tool for each query type? Some may route to SQL/API/tool use (§19.5).
  2. Chunking strategy (chunking decision tree, §10.2)
  3. Embedding model selection (§14, §15)
  4. Retrieval method — likely hybrid (BM25 + dense + RRF), justify (§23)
  5. Filtering / multi-tenancy pattern (§17, §20.2 — always pre-filter)
  6. Reranking — cross-encoder default (§28)
  7. Abstention threshold strategy (§30)
  8. Generation prompt + answer contract (§32)
  9. Eval approach for v1 — golden set size, metrics (§33–37)
  10. Operational concerns — observability, cost, ingestion lifecycle

Read the full file on GitHub · 140 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 · 140 lines · 18 tokens per session scan A 56efdc241255

Subscribe to this mod's changes

rag-design is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 18 tokens to every session and 1,234 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-09-03.