by MinishLab
Fast and Accurate Code Search for Agents. Uses ~98% fewer tokens than grep+read
# Add to your Claude Code skills
git clone https://github.com/MinishLab/sembleGuides for using ai agents skills like semble.
Last scanned: 5/7/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-07T06:37:59.423Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}Quickstart • CLI • MCP Server • Installation • Benchmarks
Semble is a code search library built for agents. It returns the exact code snippets they need instantly, using ~98% fewer tokens than grep+read. Indexing and searching a full codebase end-to-end takes under a second, with ~200x faster indexing and ~10x faster queries than a code-specialized transformer, at 99% of its retrieval quality (see benchmarks). Everything runs on CPU with no API keys, GPU, or external services. Use it as an MCP server, a CLI tool via AGENTS.md, or a dedicated sub-agent, and any coding agent (Claude Code, Cursor, Codex, OpenCode, etc.) gets instant access to any repo.
Your agent queries Semble in natural language (e.g. "How is authentication handled?") and gets back only the relevant code snippets, without grepping or reading full files.
The fastest way to get started is the interactive installer. Install uv, then run:
uv tool install semble
semble install
semble install detects installed coding agents such as Claude Code, Codex, and OpenCode, and then lets you choose which integrations to enable:
semble-search sub-agent.To undo the setup, run semble uninstall.
For manual setup instructions (MCP config per agent, AGENTS.md snippet, sub-agent files), see the installation docs.
uv tool upgrade semble # upgrade
uv cache clean semble # for MCP users (restart your MCP client after)
Semble also ships as a standalone CLI. This is useful in scripts or anywhere you want search results without an MCP session. Indexes are built and cached on first run, and invalidated automatically when files change.
# Search a local repo (index is built and cached automatically)
semble search "authentication flow" ./my-project
# Search a remote repo (cloned on demand)
semble search "save model to disk" https://github.com/MinishLab/model2vec
# Limit results
semble search "save model to disk" ./my-project --top-k 10
# Search docs/config/everything instead of just code
semble search "deployment guide" ./my-project --content docs # or: config, all
# Find code similar to a known location
semble find-related src/auth.py 42 ./my-project
--content accepts code (default), docs, config, or all. path defaults to the current directory when omitted; git URLs are accepted. If semble is not on $PATH, use uvx --from "semble[mcp]" semble in its place.
Semble reads .gitignore and .sembleignore files to determine which files to index. Both files use standard gitignore syntax and their patterns are merged. .sembleignore lets you add semble-specific rules without touching .gitignore. Rules are applied recursively, so a .sembleignore in a subdirectory applies to that subtree.
Excluding files: add patterns the same way you would in .gitignore:
# .sembleignore
generated/ # exclude generated dir
*.pb.go. # exclude Go protobuf files
Including non-default extensions: prefix the extension pattern with ! to force-include files that semble wouldn't index by default:
# .sembleignore
!*.proto # include Protobuf files
!*.cob # include COBOL files
Semble also always skips a set of well-known non-source directories regardless of ignore files (e.g. node_modules/, .venv/, dist/, build/, __pycache__/, and similar).
semble savings shows how many tokens semble has saved across all your searches:
semble savings
Semble Token Savings
════════════════════════════════════════════════════════════════════════
Total saved: ~714.2M tokens (94%)
Total calls: 14.3k
Efficiency: ███████████████████████░ 94%
By Period
────────────────────────────────────────────────────────────────────────
Period Calls Saved Ratio
────────────────────────────────────────────────────────────────────────
Today 198 ~1.4M tokens ███████████████████████░ 95%
Last 7 days 13.1k ~707.2M tokens ███████████████████████░ 94%
All time 14.3k ~714.2M tokens ███████████████████████░ 94%
By Call Type
────────────────────────────────────────────────────────────────────────
# Call type Calls Share
────────────────────────────────────────────────────────────────────────
1. search 14.1k ████████████████ 99%
2. find_related 205 █░░░░░░░░░░░░░░░ 1%
════════════════════════════════════════════════════════════════════════
Savings are calculated as follows: for each call, semble records the total character count of the unique files containing returned chunks and the character count of the snippets returned. Estimated tokens saved is (file chars − snippet chars) / 4 (4 chars per token). This is a conservative estimate: the baseline is reading matched files in full, which is how coding agents often explore unfamiliar code.
By default, your Semble savings statistics and any saved indexes are stored in the OS cache folder (~/Library/Caches/semble/ on macOS, ~/.cache/semble/ on Linux, %LOCALAPPDATA%\semble\Cache\ on Windows). To override this location you can supply an environment variable SEMBLE_CACHE_LOCATION which should be the full path to the target cache location e.g. ~/my-folder/my-caches/semble.
Semble can also be used as a Python library for programmatic access, useful when building custom tooling or integrating search directly into your own code.
from semble import ContentType, SembleIndex
# Index a local directory (code only, the default)
index = SembleIndex.from_path("./my-project")
# Index docs and prose (markdown, rst, etc.)
index = SembleIndex.from_path("./my-project", content=ContentType.DOCS)
# Index everything (code, docs, and config)
index = SembleIndex.from_path("./my-project", content=[ContentType.CODE, ContentType.DOCS, ContentType.CONFIG])
# Index code and docs together
index = SembleIndex.from_path("./my-project", content=[ContentType.CODE, ContentType.DOCS])
# Index a remote git repository
index = SembleIndex.from_git("https://github.com/MinishLab/model2vec")
# Search the index with a natural-language or code query
results = index.search("save model to disk", top_k=3)
# Find code similar to a specific result
related = index.find_related(results[0], top_k=3)
# Each result exposes the matched chunk
result = results[0]
result.chunk.file_path # "model2vec/model.py"
result.chunk.start_line # 127
result.chunk.end_line # 150
result.chunk.content # "def save_pretrained(self, path: PathLike, ..."
Semble runs as an MCP server so agents can search any codebase directly as a native tool call. Repos are indexed on demand and cached; local paths are re-indexed automatically on file changes.
| Tool | Description |
|---|---|
search |
Search a codebase with a natural-language or code query. Pass repo as a local path or an https:// git URL. |
find_related |
Given a file path and line number, return chunks semantically similar to the code at that location. |
For per-agent setup instructions, see the installation docs.
We benchmark quality and speed across ~1,250 queries over 63 repositories in 19 languages (left), and token efficiency against grep+read at equivalent recall levels (right).
The quality benchmark (left) scores retrieval quality (NDCG@10) against total latency; semble achieves 99% of the quality of the 137M-parameter [CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankE
semble is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by MinishLab. Fast and Accurate Code Search for Agents. Uses ~98% fewer tokens than grep+read. It has 5,160 GitHub stars.
Yes. semble passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/MinishLab/semble" and add it to your Claude Code skills directory (see the Installation section above).
semble is primarily written in Python. It is open-source under MinishLab on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh semble against similar tools.
No comments yet. Be the first to share your thoughts!