semble
Fast and Accurate Code Search for Agents. Uses 99% fewer tokens than grep+read
Install / Use
claude mcp add MinishLab -- npx -y github:MinishLab/sembleIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Our assessment of semble
semble scores 93/100 on our quality scale, 195th of 965 AI & Machine Learning skills we index (top 21%).
Its MCP Server is 16 KB long, well organised into 28 sections with 10 code examples: a thorough specification that gives an agent plenty to work with.
With 6,361 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so semble is actively maintained.
- Our last check on 2026-10-17 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 95/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-24. Automated pattern scan on 2026-09-24. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
semble compared with similar skills
All 4 of these similar skills score higher than semble; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| semble (this skill)by MinishLab | 93 | 6.4k | 2d ago | MCP Server |
| claude-memby thedotmack | 100 | 113.5k | today | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 109.2k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 90.9k | 10d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.9k | today | CLAUDE.md |
Frequently asked questions
- How do I install semble?
- Run
claude mcp add MinishLab -- npx -y github:MinishLab/semble. The install tabs above show the steps for each supported agent. - Which AI agents does semble work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is semble safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 95/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is semble still maintained?
- The repository was last updated 2 days ago, so semble is actively maintained.
Skill content
View source on GitHubQuickstart • CLI • MCP Server • Installation • Benchmarks
</div>Semble is a code search library built for agents. It returns the exact code snippets they need instantly, using ~99% fewer tokens than grep+read. Indexing and searching a full codebase end-to-end takes under a second for most repos, matching the retrieval quality of a code-specialized transformer while indexing ~380x faster and querying ~17x faster (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.
<picture> <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/MinishLab/semble/main/assets/images/demo-dark.gif"> <img src="https://raw.githubusercontent.com/MinishLab/semble/main/assets/images/demo-light.gif" width="1000" alt="semble install detecting Claude Code, Cursor, and Codex, then semble search returning ranked code snippets from pydantic" /> </picture>Quickstart
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:
- MCP server: lets the agent call Semble directly as a tool.
- Instructions: adds CLI usage guidance to AGENTS.md / CLAUDE.md.
- Sub-agent: installs a dedicated
semble-searchsub-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.
<details> <summary>Updating Semble</summary>uv tool upgrade semble # upgrade
uv cache clean semble # for MCP users (restart your MCP client after)
</details>
<details>
<summary>Unattended install</summary>
For sandboxed or scripted environments, skip the prompts with --agent and, optionally, --type:
semble install --agent claude --type mcp subagent --yes
--agent accepts one or more agent ids (e.g. claude, codex, pi); --type accepts mcp, instructions, subagent, or all (default: all); --yes skips the confirmation prompt (requires --agent for a fully non-interactive run).
Main Features
- Fast: indexes an average repo in ~500 ms and answers queries in ~1 ms, all on CPU.
- Accurate: NDCG@10 of 0.854 on our benchmarks, on par with code-specialized transformer models, at a fraction of the size and cost.
- Token-efficient: returns only the relevant chunks, using ~99% fewer tokens than grep+read.
- Zero setup: runs on CPU with no API keys, GPU, or external services required.
- MCP server: works with Claude Code, Cursor, Codex, OpenCode, VS Code, and any other MCP-compatible agent.
- Local and remote: pass a local path or a git URL, or several of them to search related repos together.
CLI
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
# Search several repos at once (results are prefixed with the repo name)
semble search "invoice endpoint" ./service-a ./service-b
# 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
# Show only the first N lines of each result's snippet (0 = path/line range only)
semble search "authentication flow" ./my-project --max-snippet-lines 10
--content accepts code (default), docs, config, or all. --format accepts json (default) or text. 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 --version (or -V) prints the installed version.
Passing several paths or URLs searches them as one corpus, so a query from repo A can find an endpoint defined in repo B. Each index is cached per repo and merged at query time. Result paths are prefixed with the repo name (service-b/api/invoices.py) and the output includes a repos map from prefix to absolute path or URL. Pass the prefixed path to find-related to search across all repos from a known location.
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.
Files larger than 1 MB are skipped during indexing to keep index builds lean. Skipped files are reported as a warning at index time. If you work with large generated or ingested documents, you can raise (or lower) this limit with the SEMBLE_MAX_FILE_BYTES environment variable (in bytes).
On first use, Semble also downloads the embedding model from Hugging Face and caches it in the standard Hugging Face cache (~/.cache/huggingface/ by default, or $HF_HOME if set); this only happens once and requires network access.
Use semble clear to remove cached data: semble clear index (saved indexes), semble clear savings (usage stats), semble clear orphans (indexes for repos no longer present on disk), or semble clear all (everything).
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")
# Merge indexes from several repos into one (chunk paths are prefixed with the repo name)
index = SembleIndex.merge([("./service-a", SembleIndex.from_path("./service-a")), ("./service-b", SembleIndex.from_path("./service-b"))])
# 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, ..."
</details>
MCP Server
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 (or a list of them to search several repos together) and content as code, docs, config, or all (default: code). |
| find_related | Given a file path and line number, return chunks semantically sim
Truncated for display — read the full file on GitHub.
Related Skills
claude-mem
113.5kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Agent-Reach
109.2kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Understand-Anything
90.9kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.9kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
