/rag-rat:init-rag-ratfrom rag-rat
Guides users through setting up rag-rat in a repository that is not yet indexed. Scans the repo, explains configuration choices, recommends local FastEmbed, writes config after confirmation, runs the first index, and optionally sets up git maintenance hooks.
Ships in rag-rat. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
rag-rat's MCP server boots dormant in a repo with no rag-rat.toml: ordinary tools return
{"status":"no_index", "remedy":"Run rag-rat init … then restart"}. This skill turns that into a
short guided setup. You own the conversation; rag-rat init owns the scan and validation — never
hand-write a config blind, and let a real config load re-check it before indexing.
Detect state. You are here because a rag-rat tool returned status: "no_index", or the user
asked to set up rag-rat. Confirm there is no rag-rat.toml at (or above) the repo root. If one
already exists, this is a reconfigure — send the user to the interactive rag-rat init wizard
and stop.
Resolve the CLI and use the same form throughout, from the target repo's root. It must
match the version the rag-rat MCP server runs, so the index you create is one the server can read —
do not use @latest, and don't blindly trust an on-PATH rag-rat:
rag-rat is on PATH, check rag-rat --version and use it only if it matches the
plugin/MCP version — a stale global install would build the index with the wrong binary. With
the plugin, ~/.local/bin/rag-rat is its version-matched binary (the MCP server links it when
it starts), so try that path too if rag-rat alone is not found.npx -y @rag-rat/[email protected] … — the plugin pins
@rag-rat/bin to its own version and caches the binary privately, so this is the
version-matched CLI; npx runs it in the current directory.Dry-run discovery. <rag-rat> init --yes --dry-run scans the repo and prints the
auto-detected config (languages, path bindings, the default local FastEmbed backend) without
writing. Read it; tell the user the material bits in a line or two (which languages and
directories) — not every commented knob.
Default to FastEmbed unless the machine is powerful (or the repo is large). FastEmbed (all-MiniLM, 384-dim, local CPU) needs zero setup and is the right call for most repos on a modest workstation. Recommend it by default. Only raise a remote / GPU embedder when it earns its keep: a large repo, a wish for a stronger code-specific embedder, or an available GPU / cloud budget.
Only if a remote embedder makes sense, load the relevant reference and configure it. Start with the overview, then the one that fits — read the file into context on demand; do not inline its content here:
references/remote-embeddings.md — the [llm.embedding.remote] block, the local↔remote
model pairing table, dim parity, and which of the two paths below to take.references/local-infinity.md — run a local infinity server via Docker (Connect mode); the
recommended default model + the CPU engine footgun.references/ephemeral-providers.md — provision an ephemeral Modal/RunPod GPU worker
(cookbook); GPU classes, the cost/trust boundary, and the local+cloud hybrid.Preview and confirm. Pick the path and confirm with the user before writing anything. Neither installs git hooks — that's a separate, consented step (step 7).
<rag-rat> init --yes --no-hooks writes rag-rat.toml, installs the
model, and builds the initial index and embeddings in one step. --no-hooks is what keeps
hook install a separate ask — plain init --yes would install the git hooks immediately. Preview
first with <rag-rat> init --yes --dry-run if the user wants to see the config. No hand-editing,
and no separate index/reconcile step for this path. It downloads the model and indexes and
embeds the whole repo, so on anything but a small repo run it in the background (or with
your longest command timeout) and poll until it exits — a foreground call can time out partway.
Its closing "connect your coding agent … claude mcp add / codex mcp add" hint is for users
without the plugin: do not run those commands — the plugin already registered the
server, and a second registration runs two servers against one index.<rag-rat> init --yes --dry-run (which writes
nothing), add the [llm.embedding.remote] block from step 5, show the final config, and write
rag-rat.toml only after the user confirms.Index + embed (custom path only), decide on the git hooks, then restart.
<rag-rat> doctor fails
loudly on a bad block (dim mismatch, gpu with endpoint, missing query_endpoint, …). Then
run two commands, in order:
<rag-rat> index --discover — builds the source/chunk rows. This does not compute
embeddings.<rag-rat> reconcile — the embedding backfill: it computes the vectors over the configured
remote backend (provisioning the ephemeral box if the config uses cookbook). Skip it and
the repo has no semantic-search vectors until a later maintenance pass — always run it
before declaring setup complete.post-checkout / post-merge / post-rewrite / post-commit hooks that keep the index fresh as
the repo changes. They modify .git/hooks, so ask the user — nothing above installed them
(the FastEmbed path ran with --no-hooks). If they agree: <rag-rat> hooks install — idempotent,
and all or nothing: if a hook rag-rat does not manage occupies any slot, it installs none and
names each one. Tell the user which hooks are in the way and that they can move them aside and
re-run hooks install; don't leave them thinking the index will stay fresh. If they decline, or
it isn't a git worktree, skip it — nothing to undo./mcp and
reconnects rag-rat; in Codex and opencode, a new session. A dormant server does not self-activate
(that would be a half-active server without the watcher and hook listener). After restart it
discovers rag-rat.toml, starts fully active, and ordinary tools work against the new index.[llm.embedding] model must be a registry model whose dim matches what
the server returns. A mismatch is rejected at load.init --yes --dry-run for the base and a real load
(doctor / index) for validation.[index] database key — the keyless config
init produces resolves to the global store, which is what lets the index and memories survive a
git clean or a deleted checkout. A per-repo database path is the deprecated, un-consolidated
deployment (it never syncs); do not introduce one.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
rag-rat, mcp-server, repo-indexing, setup-wizard, embedding-backend
4 skills in this plugin
/configure-rag-rat-dreamUse to enable and operate rag-rat's optional AI memory-maintenance passes — the `dream --verify` / `--compact` model turns that verify repo memories (flag claims that no longer hold) and compact them (shorter summaries). Off by default. This configures `[llm.dream]` / `[llm.dream.remote]` (a chat model, over a Connect endpoint or an ephemeral Modal/RunPod cookbook box — vllm/ollama, never infinity), and sets up running it on demand or on a schedule (systemd timer). Pairs with the `dream-review` skill, which triages the findings these passes produce. Triggers: "configure dream", "enable dream", "AI memory verification", "memory compaction", "schedule dream maintenance", "set up the dream model".
/dream-reviewUse when asked to review, triage, or resolve rag-rat "dream" findings — the memory-maintenance worklist the `dream` tool produces. Walks the open findings and, per kind, either fixes the underlying memory / coverage gap (which resolves the finding at the root) or records an accept / dismiss verdict with `dream_review`. Triggers: "dream review", "resolve dream findings", "triage the dream worklist", "go through pending dream findings".
/using-rag-ratUse when working in a repository indexed by rag-rat (a `rag-rat.toml` at the root and a rag-rat MCP server available). Establishes the working rule: reach for the rag-rat MCP tools (semantic_search, symbol_lookup, impact_surface, find_callers/trace_callees, repo_brief, important_symbols) to FIND and UNDERSTAND code before falling back to grep/cat, and record durable, non-obvious learnings as rag-rat memories before finishing. Triggers: "use rag-rat", "how do I navigate this repo", any code-understanding task in a rag-rat repo.
npx claudepluginhub cq27-dev/rag-rat --plugin rag-ratOther plugins' skills for the same job