index

A command that builds or refreshes a local search index of the repository's code. It also reports whether the repository is ready for retrieval-augmented search, which finds relevant code from a natural-language question.

In plain words
What is it for?
Use it to index a repository, reuse unchanged results with incremental updates, request a full rebuild when needed, and review parsing warnings and search readiness.
Why use it?
It shows whether indexing actually made the repository searchable, rather than only confirming that files exist.

Command

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.

agentmods
npx agentmods add commands/skymanbp/rag-your-code/index
Clone the repo
git clone --depth 1 https://github.com/skymanbp/rag-your-code
Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 470 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00031 $0.00470
Opus 5 $0.00015 $0.00235
Sonnet 5 $0.00006 $0.00094
Haiku 4.5 $0.00003 $0.00047

Measured yesterday against content hash 1ee54c51c626, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

index 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.

commands/index.md · 53 lines

What it actually says

/rag-your-code:index

Build or refresh the local retrieval index, and say what the repository still needs before search is actually good.

What to do

  1. Make sure the package is importable. A plugin install copies these commands but not the Python package, so check once per machine. Use python -m pip so it lands in the interpreter the later commands run under.

    python -c "import ragyourcode" || python -m pip install --user rag-your-code
    
  2. Run bootstrap against $ARGUMENTS if the user named a path, otherwise .:

    python -m ragyourcode.cli bootstrap .
    

    Use --full only after a parser or schema upgrade, or suspected corruption — the default incremental path reuses unchanged files. --compact is a flag on index, not on bootstrap; a repository already built with index --compact stays compact when bootstrap refreshes it.

  3. Report back three things, briefly:

    • how many declarations were indexed, and whether the run was incremental;
    • the rung bootstrap named, in plain language;
    • any warnings or files it could not parse.

Why the rung matters

Indexing is not the same as being searchable. A fresh index retrieves against a sentence the parser generated from identifiers the author already chose, so it adds no word the source did not have — a question phrased in domain terms reaches nothing. Say so explicitly if descriptions are pending, and offer /rag-your-code:describe, because this is where most of the available retrieval quality still sits and the user has no other way to learn it.

If the repository is indexing files it should not — a vendored tree, generated output — that is configuration, not something to work around:

python -m ragyourcode.cli config set index.ignore '["vendor", "generated"]'
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. yesterday First seen · 53 lines · 31 tokens per session scan A 1ee54c51c626

Subscribe to this mod's changes

index is a command published in the GitHub repository skymanbp/rag-your-code (1 stars, last pushed 5d ago), licensed MIT. It adds 31 tokens to every session and 470 once invoked, about $0.0002 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.