index

index is a command for Claude Code from skymanbp/rag-your-code. It costs 31 tokens per session (470 once invoked), scanned A, original, MIT.

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 for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the rag-your-code plugin — 1 skill, 4 commands shipped together

Good fit 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.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/skymanbp/rag-your-code/index
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/skymanbp/rag-your-code

Made for: Claude Code.

Or install rag-your-code, the plugin that ships this one along with the rest of its 1 skill, 4 commands.

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 index

README.md
[![agentmods](https://agentmods.dev/badge/commands/skymanbp/rag-your-code/index/github.svg)](https://agentmods.dev/commands/skymanbp/rag-your-code/index)
Your own site
<a href="https://agentmods.dev/commands/skymanbp/rag-your-code/index"><img src="https://agentmods.dev/badge/commands/skymanbp/rag-your-code/index/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 index

Your own site · 80×15
<a href="https://agentmods.dev/commands/skymanbp/rag-your-code/index"><img src="https://agentmods.dev/badge/commands/skymanbp/rag-your-code/index.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
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. 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.00031 $0.00470
Opus 5.5 $0.00012 $0.00188
Sonnet 5.5 $0.00006 $0.00094
Haiku 4.5 $0.00003 $0.00047

Measured 1mo ago against content hash 1ee54c51c626, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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.

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. 1mo ago 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 1mo ago), licensed MIT. It adds 31 tokens to every session and 470 once invoked, about $0.0001 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-08-31.