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.
npx agentmods add instructions/qduc/code-rag/agents-mdgit clone --depth 1 https://github.com/qduc/code-ragWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01347 | $0.01347 |
| Opus 5 | $0.00674 | $0.00674 |
| Sonnet 5 | $0.00269 | $0.00269 |
| Haiku 4.5 | $0.00135 | $0.00135 |
Grade A, and why
code-rag AGENTS.md 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code-RAG: Quick Start for Developers
What is Code-RAG?
Code-RAG is a CLI tool that makes codebases searchable using semantic search. It converts source code into vector embeddings, stores them in a database, and lets you query them using natural language.
Example: Instead of grepping for function names, ask "authentication logic" and find all relevant auth code.
Architecture Overview
┌─────────────┐
│ CLI / MCP │ Entry points
└──────┬──────┘
│
┌──────▼──────┐
│ API │ Orchestration layer (CodeRAGAPI)
└──────┬──────┘
│
┌────────────┼────────────┬────────────┐
│ │ │ │
┌───▼───┐ ┌───▼───┐ ┌───▼───┐ ┌───▼───┐
│Process│ │Search │ │Manage │ │ Embed │
└───┬───┘ └───┬───┘ └───┬───┘ └───┬───┘
│ │ │ │
┌───▼───┐ ┌───▼───┐ ┌───▼───┐ ┌───▼───┐
│Chunker│ │Rerank │ │Index │ │Storage│
└───────┘ └───────┘ └───────┘ └───────┘
Key Design: Orchestrated Plugin architecture. The CodeRAGAPI centralizes logic, while specialized components handle chunking, indexing, search analysis, and storage.
Components
1. API Layer (src/code_rag/api.py)
- What: The central hub for all Code-RAG operations.
- How: Integrates embedding, database, reranking, and indexing logic. Used by both CLI and MCP.
- Features: Session tracking, auto-generated collection names, and unified indexing flow.
2. File Processor & Chunker
- What: Discovers source files and breaks them into logical chunks.
- How: Uses
SyntaxChunker(tree-sitter based) for code-aware splitting, falling back to line-based. - Output: Text chunks with rich metadata (file path, line numbers, symbol names).
3. Metadata Index (src/code_rag/index/metadata_index.py)
- What: Tracks state of indexed files for incremental updates.
- How: Stores
mtime,size, andsha256hashes. - Benefit: Only re-indexes modified files, significantly speeding up subsequent runs.
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.
- yesterday First seen · 124 lines · 1,347 tokens per session scan A 984bda5b5776
code-rag AGENTS.md is an instructions file published in the GitHub repository qduc/code-rag (1 stars, last pushed 3mo ago), licensed MIT. It adds 1,347 tokens to every session, about $0.0067 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-31.
Other instructions, from other repositories
graphiti AGENTS.md
Instructions for getzep/graphiti, covering repository guidelines, project structure & module organization, build, test, and development commands, coding style & naming conventions and testing guidelines.
nuwax AGENTS.md
Instructions for nuwax-ai/nuwax, covering ai agent system documentation, 系统概述, ai agent 架构, 核心组件 and ai 功能特性.
moss AGENTS.md
Instructions for usemoss/moss, covering agents.md, what this repo is, repository layout, integrations & cookbooks and framework cookbooks (examples/cookbook/).
OpenKB AGENTS.md
Instructions for VectifyAI/OpenKB, covering agents.md — openkb map for coding agents, read next, dev commands, module map (openkb/) and hard invariants.
honcho CLAUDE.md
Claude Code instructions for plastic-labs/honcho, covering claude.md, honcho overview, what is honcho?, core concepts and peer paradigm.
Starcat AGENTS.md
Instructions for starcat-app/Starcat, covering agents.md, 🚨 硬性铁律(每次写代码前必读,违反即返工), 🌿 git 分支与 worktree(强制), 🧭 主进度索引(每次开工前必读) and 状态符号(与功能实现总览.md 同步).