2026-11-26 15:48 UTC

Sweet-search launches local code retrieval for coding agents

state: watchingheat: lowuncertainty: highrelevance: mediumcoding-agent-costs code-search agent-evaluationmrsladoje

What is this?

Marko Sladojević, with PanonIT named as copyright holder, presents sweet-search as an available Apache-2.0 local code-search toolkit for coding agents including Claude Code, Codex and opencode. The GitHub README describes six search and navigation tools, on-device indexing, and setup through npm; a Show HN post on November 2, 2026 publicized the release and its benchmark results. The creator reports a held-out evaluation on 200 SWE-rebench tasks across five model-and-harness combinations: both sweet-search and native search solved 481 of 1,000 pooled runs, while costs fell in each setup. These are creator-reported results, not independently verified. The detailed README also shows trade-offs: on the separate 200-question retrieval test, Sol 6.1 setups had lower answer accuracy, while Claude Opus accuracy was statistically indistinguishable from native search. The supplied web results offer no independent confirmation.

Why it matters

This is a practical attempt to make coding agents spend fewer tokens finding code, rather than a new foundation model. If its self-reported results generalize, local semantic search, grep, and code-graph tools could lower the cost of agentic software work while keeping repositories on-device. The task benchmark reports equal pooled solve counts, but only one run per task and setup; savings vary by harness, and the question benchmark exposes accuracy losses for Sol 6.1. The project is available now, so the useful next evidence is independent replication and real-world adoption.

Current assessment

Sweet-search is an available Apache-2.0 local code-search toolkit for coding agents, combining semantic and lexical retrieval, grep, symbol tracing, and incremental indexing. Its creator reports equal pooled solve counts (481/1,000 per arm) across five model-and-harness setups on 200 held-out SWE-rebench tasks, with reported cost reductions of 5.4–33.3%; the test used one run per task and setup, so results are uncertain and not independently verified. A separate retrieval test reports accuracy losses for Sol 6.1 setups, while Claude Opus changes were not significant. A Reddit cross-post adds discussion but no independent benchmark, implementation result, or adoption evidence. The practical potential is lower agent search overhead and local repository retrieval; generalization across models, harnesses, repositories, and workloads remains unresolved.

Measured heat

now 0 pts/hpeak 0 pts/hcomments 0/hpeers p10momentum: steady3 platformsage 600h
points/hour across evidence · reading as of 2026-11-27 02:23:58.509736+11:00 · deterministic, not a model opinion

How the heat travelled

11-01 16:28 (minted)⭐ origin echo-reconstructedThe GitHub repository is the original primary artifact for the project and its claims; the Hacker News post links directly to it, and the RE
Marko Sladojević (@mrsladoje) on github (echo) · attributed from hn.story.50326635 · published time unknown
—
11-01 15:36first on hacker news · published · lag ?Show HN: Sweet-search – local code search for agents (5–33% cheaper runs)
mrsladoje
—
11-04 14:27first on r/codex · published · lag ?2.5k commits later, I built a local token saver that **actually** works - sweet-search (35% cheaper per solved task, open source)
mrsladoje
—
11-01 15:36amplified on hacker newshn.story.50326635
mrsladoje
peak 3 · 0 comments · 22% of case engagement
11-04 14:27amplified on r/codex 👑reddit.post.1xnpl16
mrsladoje
peak 0 · 18 comments · 77% of case engagement
11-01 16:25our radar first saw it · lag ?discovery anchor: hn.story.50326635—
pace: p62 vs 1845 stories at the 336h mark (now 600h old) — ahead of beam-100k-agent-memory-benchmark (1.1x), behind aq-claude-code-attention-queue (0.9x)

Evidence (3) — ⭐ canonical anchor

sourceobjectauthorscorecomments
🟧 hnShow HN: Sweet-search – local code search for agents (5–33% cheaper runs)
Retrieved article excerpt

Open article · Retrieved 2026-11-01T16:27:12.147225+00:00

[sweet-search — local code search for AI coding agents](https://github.com/mrsladoje/sweet-search/blob/main/assets/sweet-search-banner-pixelated.svg)

## **🍬 Local code search for AI coding agents 🍬**

Six fast, purpose-built tools made for *Claude Code*, *Codex* & friends 👀

Every coding agent today reaches for grep + Read by reflex. *sweet-search* challenges the narrative 😎

[npm](https://www.npmjs.com/package/sweet-search)
[GitHub stars](https://github.com/mrsladoje/sweet-search/stargazers)
[license](https://github.com/mrsladoje/sweet-search/blob/main/LICENSE)
[node](https://github.com/mrsladoje/sweet-search/blob/main/package.json)
[platforms](https://github.com/mrsladoje/sweet-search#compatibility)
[inference](https://github.com/mrsladoje/sweet-search#the-index)
[video](https://www.youtube.com/watch?v=lJzgXRQprs4)

---

## ✨ Highlights

|  |  |
| --- | --- |
| 💰 **5–33% cheaper agent runs**  on 200 real engineering tasks · 5 harness + model setups · same solve count (481 vs 481) | ⚡ **Saves your time**  faster retrieval than classic grep-and-read · up to 34% less model time per code question |
| 🔄 **Index once, then forget it**  one command, GPU-accelerated · updates itself as you edit, uncommitted changes included | 🔒 **100% local**  no API keys · no cloud · no Docker · your code never leaves your machine |



---

## 📚 Table of Contents

|  |  |  |  |
| --- | --- | --- | --- |
| **GET STARTED**  [🚀 Quickstart](https://github.com/mrsladoje/sweet-search#-quickstart)  three commands to a searchable repo  [🖥️ Compatibility](https://github.com/mrsladoje/sweet-search#compatibility)  OS · harnesses · languages · hardware  [⭐ A star pls? 🥺🙏](https://github.com/mrsladoje/sweet-search#found-it-useful)  it really helps | **THE ARCHITECTURE**  [🧰 The Six Tools](https://github.com/mrsladoje/sweet-search#-the-six-tools)  search · grep · find · semantic · trace · read  [🧠 The System Prompt](https://github.com/mrsladoje/sweet-search#-the-system-prompt)  tuned for search and task completion | **INDEXING**  [🗂️ The Index](https://github.com/mrsladoje/sweet-search#the-index)  candle · fused kernels · cAST chunking  [🔄 Incremental Indexing](https://github.com/mrsladoje/sweet-search#-incremental-indexing)  reconcile daemon tracks your working tree | **THE RECEIPTS**  [📊 Benchmarks](https://github.com/mrsladoje/sweet-search#-benchmarks)  agent cost savings · engine speed · full-corpus MRR  [🧭 The Competition](https://github.com/mrsladoje/sweet-search#-the-competition)  honest wins & trade-offs vs peers  [🙏 Prior Art & Acknowledgements](https://github.com/mrsladoje/sweet-search#-prior-art--acknowledgements)  the shoulders we stand on |

## 🚀 Quickstart

- **Requires:** Node.js 22+

```
npm install -g sweet-search

cd your-repo
sweet-search init      # one-time: wires up Claude Code
                       # Codex: --codex · opencode: --opencode
                       # several: --claude --codex --opencode

sweet-search index     # builds the index — GPU-accelerated where available

sweet-search "where do we validate JWT tokens?"
```

That's it. From then on, the index updates itself as you work.

To uninstall 😢:

```
sweet-search uninstall          # this repo only
sweet-search uninstall --all    # everything: all repos, models, and the CLI
```

**Setup options & details**
  

```
sweet-search init --wizard          # interactive: shows your hardware, recommends a model tier
sweet-search init --skip-models     # download the models at the first index, not now (CI)
sweet-search init --li-model edge   # compact late-interaction model for constrained machines
sweet-search init --codex           # Codex only (per-project config, nothing under .claude/)
sweet-search init --codex --opencode # Codex and opencode
sweet-search init --claude --codex  # Claude Code and Codex
sweet-search init --agents          # Claude Code plus AGENTS.md for other AGENTS.md-reading tools
sweet-search init --no-claude --agents # streamlined AGENTS-only configuration
sweet-search uninstall --dry-run    # preview cleanup for the current repo
```

- **Footprint** — models live in `~/.cache/sweet-search/models/` and run on-device only:
  - CPU-only: a few hundred MB (INT8)
  - GPU: +~1.2 GB (FP32), skipped where it wouldn't help
  - M3+ Mac: optional +~3.2 GB CoreML cascade for the Neural Engine
- **Which agents** — pick with flags:
  - `init` alone → Claude Code
  - `--codex` / `--opencode` → only those; add `--claude` to keep Claude Code too
  - `--agents` / `--gemini` / `--cursor` → also write `AGENTS.md` / `GEMINI.md` / a Cursor rule
  - Indexing, `.sweet-search/` and `--mcp` are the same for every choice.
- **Claude Code** — your `CLAUDE.md` stays untouched; everything goes in `.claude/`:
  - `agents/sweet-search.md`: the main agent, selected in `settings.json`. Claude Code's own prompt without its grep-first advice, plus our guide.
  - `agents/general-purpose.md`, `agents/Plan.md`: replace the built-in subagents; Explore is denied.
  - `rules/sweet-search.md`: a short reminder, gitignored (it names your local memory folder).
  - the `/sweet-index` skill.
  - Start a new session after init.
  - Already chose another main agent? init keeps it, puts the full guide in `rules/` plus the `sweet-search` output style, and warns.
- **Codex** — our guide and tested base instructions in `.codex/config.toml`:
  - Codex ignores `.codex/` until you trust the project; init tells you how.
- **opencode** — our guide, tested prompt and a tool-description plugin in `.opencode/`:
  - An existing `opencode.json` / `.jsonc` is edited in place, comments kept.
- **Prewarm hook** (Claude Code, Codex): starts the search daemon when a session starts. Search works without it.
- **Search daemon:** the first search starts it. Manage it with `sweet-search daemon start|status|stop|restart`.
- **What gets indexed:** `.gitignore` is respected; `node_modules`, build dirs, minified files and files over 1 MB are skipped; add extra rules in `.sweet-search-ignore`. `ss-grep` also covers tracked vendored code, licenses and data files.

### MCP and other integrations

The CLI is the default contact surface. To also register the MCP server, run
`sweet-search init --mcp`, or add it to `.mcp.json` yourself:

```
{
  "mcpServers": {
    "sweet-search": {
      "command": "sweet-search-mcp",
      "args": []
    }
  }
}
```

- **MCP server:** 8 tools (`search`, `trace`, `read`, `read-semantic`, `index`, `health`, `repo-map`, `vocab-prewarm`), 2 resources, 2 prompts. All search tools are declared read-only and idempotent.
- **Repo maps for sub-agents:** the `repo-map` tool returns a PageRank-ranked symbol overview that fits any token budget, for briefing a delegated agent.
- **Vocabulary prewarm:** the index mines your repo's real identifiers and detects code communities (Leiden), and the daemon keeps both current as the code changes. They pre-warm all three search modes, so the first semantic query of a session is already cache-warm.
- **Committed files stay portable:** init never writes machine-specific absolute paths into committed settings files. All instruction injection is marker-delimited and reversible.

### Init flags

| Flag | Behavior |
| --- | --- |
| `--skip-models` | Download no models now; the first `sweet-search index` downloads them. Search always needs the models. |
| `--li-model standard|edge|none` | Select the late-interaction model tier or disable it. |
| `--search-reranking auto|on|off` | Control search-time late-interaction reranking. |
| `--wizard` | Choose model and reranking settings interactively. |
| `--verify-deep` | Load modules and verify checksums after setup. |
| `--force` | Re-download models even when cached. |
| `--build-coreml-cascade` | Build the optional CoreML cascade locally on eligible Apple silicon. |
| `--skip-coreml-cascade` | Skip fetching or building the CoreML cascade. |
| `--skip-dedup` | Skip near-duplicate-detection readiness checks. |
| `--skip-cuda` | Disable the CUDA backend even when available. |
| `--skip-prewarm-hook` | Do not register the Claude/Codex session-start prewarm hook. |
| `--agents` | Also write the verbatim guide to `AGENTS.md` (not needed for Codex or opencode). |
| `--codex` | Set up Codex only, in `.codex/`: guide, our base instructions, and the prewarm hook with its feature flag. |
| `--opencode` | Set up opencode only, in `.opencode/`: guide, our prompt, tool-description plugin, grep and explore off. |
| `--claude` | Include Claude Code together with `--codex` / `--opencode`. |
| `--no-lean-harness` | Keep Claude Code's own system prompt and subagents; install only the rules file and output style. |
| `--no-opencode-cache-key` | Skip the opencode cache-key plugin that lets new sessions reuse the cached prompt. |
| `--codex-enable-global-hooks` | Advanced opt-in: also enable hooks in the user-level Codex config. |
| `--no-claude` | Write nothing under `.claude/`; combine with `--agents` for AGENTS-only setup (`--codex` / `--opencode` already imply it unless `--claude` is set). |
| `--gemini` | Also write `GEMINI.md` (sharing `AGENTS.md` when enabled). |
| `--cursor` | Also write `.cursor/rules/sweet-search.mdc`. |
| `--symlink-instruction-files` | Explicitly use the default `GEMINI.md` symlink behavior. |
| `--no-symlink-instruction-files` | Use a regular `GEMINI.md` import instead of a symlink. |
| `--no-agent-instructions` | Skip all agent policy and Claude output-style installation. |
| `--mcp` | Also register the project MCP server; the CLI remains the default contact surface. |
| `--no-cli` | With `--mcp`, give agents the MCP-specific guide and remove the CLI-specific Claude output style. |
| `--enforce-tools` | Optional strict Claude mode: deny native Grep and hint native Read. |
| `--verbose`, `-v` | Print additional setup diagnostics. |
| `--help`, `-h` | Show the complete CLI help. |

### Uninstall flags and cleanup

| Flag | Behavior |
| --- | --- |
| `--all` | Remove sweet-search from this machine: every repo where `init` ran, the shared model cache, and the npm package. |
| `--dry-run` | Preview all detected removals. |
| `--force` | Skip the confirmation prompt. |
| `--help`, `-h` | Show uninstall help. |

`sweet-search uninstall` removes Sweet Search's rule, main agent and subagent
files with their settings entries, output style, AGENTS/GEMINI/Cursor instruction blocks, project hooks and skill,
MCP registration, enforcement/reminder artifacts, and `.sweet-search/` from the
current repo. The shared model cache stays for your other repos. It
preserves user-authored content. Generic Codex `[features] hooks = true` flags
are left in place because other tools may share them, and an otherwise-empty
settings file may remain as `{}`.

## 🖥️ Compatibility

|  |  |
| --- | --- |
| **💻 Platforms** | ✅ First-class: macOS (Apple Silicon, Intel) · Linux x64/arm64 (glibc) · Windows via WSL2 ☑️ Supported: musl/Alpine · other CPUs (slower) Node ≥ 22 everywhere  What makes first-class fasterThe npm package ships a **Rust engine, compiled ahead of time** for your OS and CPU. It runs every hot path:  - 🧠 **Embedding inference**: Metal, CUDA, CoreML - 🧭 **Vector search**: binary HNSW + rescoring - 🧮 **MaxSim rerank**: 9–21× faster than WASM, 80–200× faster than JS - 🔎 **`ss-grep`**: regex engine and sparse n-gram index - 🔤 **Tokenizer**, near-duplicate detection, SQLite extension - 🚀 **The `sweet-search` CLI** itself  🐢 **Supported platforms** use a WASM/JS fallback: it runs anywhere, but slower. 📦 **Zero setup**: `npm install` picks the right binary. 🪟 **Native Windows**: not yet. Use WSL2. |
| **🤖 Harnesses** | ✅ **Claude Code** · **Codex** · **opencode**  *(tuned and benchmarked)* ☑️ Cursor · any MCP client · any agent with a shell  *(also works)* |
| **🗣️ Languages** | JavaScript · TypeScript · Python · Go · Rust · Java · C · C++ · C# · Ruby · PHP · Kotlin · Swift · Scala · Dart · Elixir · Erlang · Haskell · Clojure · F# · OCaml · ReScript · Elm · Julia · R · Perl · Lua · Groovy · Objectiv
mrsladoje30
🟧 echo.github ⭐The GitHub repository is the original primary artifact for the project and its claims; the Hacker News post links directly to it, and the REMarko Sladojević (@mrsladoje)——
🟠 reddit2.5k commits later, I built a local token saver that **actually** works - sweet-search (35% cheaper per solved task, open source)
codex
mrsladoje018

Interpretation history

Decision trace