csp (Code Search Please) is a code search library built for agents. It returns the exact code snippets they need instantly, using about 98% fewer tokens than grep+read. Indexing and searching a full codebase end-to-end takes under a second. Everything runs locally on CPU with no API keys, GPU, or external services.
Run it as an MCP server or call it from the shell via AGENTS.md, and any agent (Claude Code, Cursor, Codex, OpenCode, and others) gets instant access to any repo.
Main features
- Fast: indexes an average repo in well under a second and answers queries in milliseconds, all on CPU.
- Accurate: hybrid retrieval (dense embeddings + BM25) with code-aware reranking.
- Token-efficient: returns only the relevant chunks, using about 98% 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.
- Single binary: a self-contained Rust executable. Install via Homebrew with no runtime, or via npm/bun/pnpm (Node 22+ or Bun on
PATH).
Where to go next
Installation
Homebrew, the install script, npm/bun/pnpm, or Cargo. Install the CLI.
Quickstart
The three complementary setup paths: MCP server, AGENTS.md, sub-agent. Get started.
CLI reference
search, index, find-related, init, savings, clear. Read the reference.
How it works
Tree-sitter chunking, Model2Vec + BM25, RRF, and the ranking signals. Under the hood.
Credits
csp is a Rust port of Semble by Thomas van Dongen and Stéphan Tulkens at MinishLab. The algorithm, ranking signals, and overall architecture are theirs; this project simply brings them to Rust.
If you use the underlying ideas in your research, please cite the original Semble paper:
@software{minishlab2026semble,
author = {{van Dongen}, Thomas and Stephan Tulkens},
title = {Semble: Fast and Accurate Code Search for Agents},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.19785932},
url = {https://github.com/MinishLab/semble},
license = {MIT}
}License
csp is a derivative work of MinishLab/semble, which is also MIT-licensed.