sweet-index

sweet-index is a skill for Claude Code, Codex from mrsladoje/sweet-search. It costs 83 tokens per session (993 once invoked), scanned A, original, Apache-2.0.

A command for rebuilding the search index of a Sweet Search project, including code relationships, vector-based search data, and other search structures. It selects and prepares a suitable CPU or GPU processing backend for the computer.

In plain words
What is it for?
Use it to perform a full or incremental codebase reindex, rebuild search artifacts, and prepare the models needed for querying.
Why use it?
It refreshes search data across the codebase and manages model loading so indexing and later searches can use the intended hardware.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node core/indexing/index-codebase-v21.js --full.

Good fit Use it to perform a full or incremental codebase reindex, rebuild search artifacts, and prepare the models needed for querying.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/mrsladoje/sweet-search
agentmods
npx agentmods add skills/mrsladoje/sweet-search/sweet-index

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/mrsladoje/sweet-search/sweet-index/github.svg)](https://agentmods.dev/skills/mrsladoje/sweet-search/sweet-index)
Your own site
<a href="https://agentmods.dev/skills/mrsladoje/sweet-search/sweet-index"><img src="https://agentmods.dev/badge/skills/mrsladoje/sweet-search/sweet-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 sweet-index

Your own site · 80×15
<a href="https://agentmods.dev/skills/mrsladoje/sweet-search/sweet-index"><img src="https://agentmods.dev/badge/skills/mrsladoje/sweet-search/sweet-index.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 993 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00083 $0.00993
Opus 5 $0.00042 $0.00496
Sonnet 5 $0.00017 $0.00199
Haiku 4.5 $0.00008 $0.00099

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

Security

Grade A, and why

sweet-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 12d 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.

core/skills/sweet-index/SKILL.md · 95 lines

How it starts

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

/sweet-index — Index the Codebase

<default_to_action> When the user invokes /sweet-index, run the full-profile indexing command immediately. Do not ask clarifying questions — the indexer is idempotent, safe to re-run, and handles incremental vs full reindex automatically. </default_to_action>

What this does

Runs core/indexing/index-codebase-v21.js with the --full flag so every artifact is rebuilt from scratch. The indexer itself manages the model lifecycle end-to-end:

  1. Kill resident ORT CPU models — prevents memory contention and mutex fighting with the GPU models about to be loaded.
  2. Detect best backend via hardware-capability.jscoreml-cascade on M3+ Apple Silicon, candle-metal on M1/M2, candle-cuda on Linux + NVIDIA, and the optimized ORT INT8 CPU path on any host with no usable accelerator (no GPU models are loaded there).
  3. Load GPU models + warmup forward pass (accelerator hosts only) — compiles Metal pipelines, CoreML variant bundles, and BLAS thread pools so the first indexing batch pays no cold-start cost.
  4. Index the codebase — code graph, vector embeddings, HNSW, late-interaction index, quantized artifacts, sparse-gram index.
  5. Kill GPU models — releases Metal queues and Neural Engine.
  6. Load + warmup ORT CPU models — both embedding and LI get one dummy forward pass so the first query after indexing is warm.

On small-changeset incremental runs (under 20 files) — and on any host with no usable accelerator — the indexer skips the GPU swap entirely and indexes on the optimized ORT INT8 CPU path.

Usage

node core/indexing/index-codebase-v21.js --full

Or via npm script:

npm run index:full

What to report

After the command completes, pick out these lines from stderr:

  • GPU index pool armed (<backend>) → confirms which backend was used
  • embed=<load>+<warm>ms, li=<load>+<warm>ms → prewarm timings
  • CPU models warmed for queries: load=…ms, warm=…ms (embed=ok, li=ok) → confirms ORT CPU is armed for subsequent searches
  • INDEXING COMPLETE (FULL) with Duration, Files indexed, Entities, Relationships → headline stats

Read the full file on GitHub · 95 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. 12d ago First seen · 95 lines · 83 tokens per session scan A ea56d496cc1e

Subscribe to this mod's changes

sweet-index is a skill published in the GitHub repository mrsladoje/sweet-search (21 stars, last pushed yesterday), licensed Apache-2.0. It adds 83 tokens to every session and 993 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories