Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep
TL;DR Highlight
A CPU-only code search tool returns just snippets, cutting tokens about 99% versus grep+read.
Who Should Read
A developer whose coding agent (Claude Code, Cursor) burns tokens by grepping and reading whole files.
Core Mechanics
- Returns only relevant snippets, not whole files
- You ask in natural language like "How is authentication handled?" and get back only matching chunks.
- The README claims about 99% fewer tokens than grep+read.
- It reports 96% recall at 2k tokens, while grep+read needs a 100k context to reach 85%.
- Hybrid of semantic and keyword search
- tree-sitter splits code into function- and class-level chunks.
- Static Model2Vec embeddings (potion-code-16M-v2) and BM25 are merged with RRF (rank fusion).
- Reranking adds definition boosts, identifier stem matching, and penalties for tests and legacy code.
- Runs on CPU in under a second
- Indexing an average repo takes about 500 ms and queries about 1 ms.
- No API keys, GPU, or external services are needed.
- It claims about 480x faster indexing and 23x faster queries than a code-specialized transformer.
- Quality on par with code-specific embedding models
- It scores NDCG@10 of 0.855 on 63 repos, 19 languages, and about 1,250 queries.
- It claims parity with the 137M-parameter CodeRankEmbed.
- Plugs in via MCP, CLI, or sub-agent
- semble install detects your agents and lets you pick MCP server, AGENTS.md instructions, or a semble-search sub-agent.
- It can search several repos and git URLs at once.
- Changed files are reindexed incrementally.
- Savings are an estimate against reading whole files
- semble savings computes (file chars − snippet chars)/4 per call.
- The baseline is reading the matched files in full.
Community Reactions
- Opinion that agents trust grep too much to adopt new tools
- One commenter tried RTK and LSP and found models, heavily RL-trained on grep, retry and reread, wiping out token savings.
- Others report codex-cli hanging on the MCP and the agent running ripgrep after semble anyway.
- Mixed real-world cost tests
- In browsercode with Pi and gpt-5.4, rg+fd used 10.9% context and $0.144, while Semble used 9.8% and $0.172.
- In OpenCode, Semble used 14.7% and $0.282 versus 19.0% and $0.352, but the non-Semble run finished about twice as fast.
- Pushback that fewer tokens is not lower total cost
- A commenter ran RTK and headroom with pi and GPT 5.5 and found context shrank but turns increased, raising total cost.
- They argue the benchmarks measure tokens, not final work quality or cost.
- Experience beating a homegrown search
- One commenter found Semble outperformed their own BM25+vector setup by about 20% on successful searches.
- It also did well on documentation-heavy content.
- Alternatives and complements mentioned
- LSP, colgrep, cs, WarpGrep, and codemogger came up as comparisons.
- One commenter said a one-line AGENTS.md pointing to a PROJECT.md used fewer tokens.
How to Apply
- Install Semble and compare on your own repo
- Run uv tool install semble, then semble search "auth flow" ./your-project.
- Compare the size of results against what rg returns for the same question.
- Run the same question twice and measure total cost
- Ask your agent the same code-exploration question with Semble enabled via semble install and disabled.
- Record turns, time, cost, and answer accuracy, not just tokens.
- Use it for multi-repo search
- If your services span repos, run semble search "question" ./service-a ./service-b.
- Use the repo prefix in result paths to see which service the code is from.
- Control what gets indexed
- Add generated code to .sembleignore to exclude it.
- Force-include skipped extensions like .proto with !*.proto.
Try It
# Paste into AGENTS.md/CLAUDE.md for Claude Code or a terminal agent (after installing semble)
## Code search
When exploring code, use the semble CLI first before grepping and reading whole files.
- Natural-language search: semble search "{{question}}" {{repo path}}
- Find similar code: semble find-related {{file}} {{line}} {{repo path}}
- For docs/config, add --content docs or --content config.
- Use rg only if the results are insufficient.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques