Instant code search and code intelligence, in one Rust binary
Search any folder with no index. Index a repository for ranked search by meaning or name, definitions, callers, references and the tests a git diff touches. From the terminal, your editor or an AI coding agent.
Two engines, one binary
Each engine works on its own. Use the first on any folder right away, and the second where you want answers about the code itself.
Instant search, no index
No index, no parsers, no background process. Literal, regex, identifier in every casing, fuzzy, multiline and inverted matching over every readable file, with .gitignore awareness, parallel traversal and streamed results. Built on the crates ripgrep is assembled from, and tested against ripgrep.
Code intelligence from an index
A persistent, incremental index: tree-sitter symbols, call edges, imports, a trigram text index, semantic vectors and a learned ranker. Ranked search by meaning, name or identifier; definitions, callers, references, outlines, duplicates, structural queries, and what a git diff touches.
What it does
One command per job. Every command, option and exit code is in the CLI reference.
- RegexLiteral, regex in linear time, and PCRE2 (
-P). - Any casingOne spelling finds snake, camel and upper case (
--ident). - FuzzyMatches within N edits, also for a regex (
--fuzzy). - ArchivesInside zip and tar files and compressed files (
-z). - Ranked searchBy meaning, name or identifier, with a learned ranker (
search). - Call graphDefinitions, callers, callees, outlines, imports (
callers). - ReferencesEach name resolved through imports and scopes (
refs). - DuplicatesExact and near copies of a function (
dupes). - Structuretree-sitter queries on the syntax tree (
tsquery). - Diff impactChanged definitions, their callers, the tests to run (
impact). - Kept freshAn incremental index that follows edits (
watch). - PrivateNo network connections. Your code stays on your machine.
Quick start
Search right away, then index when you want more.
Search any folder, no index
scrutate grep "refresh_token" . # instant, ignore-aware search
scrutate grep --ident refreshToken . # finds refresh_token, RefreshToken, REFRESH_TOKEN
scrutate grep --fuzzy=1 "shortest_pth" . # within one edit
Index the repository
scrutate index
scrutate search "where do we renew expired tokens" # ranked by meaning
scrutate callers refresh_token # who calls it
scrutate impact --base main... # what my diff changes, which tests to run
Give it to an AI coding agent or an editor
scrutate setup claude # or codex, opencode, cursor, gemini: adds the MCP server
scrutate serve --watch # run the MCP server yourself, index kept fresh
scrutate lsp # language server for editors
From Python
import scrutate
for m in scrutate.grep("TODO", ["."], mode="literal"): # streamed, GIL released
print(m.path, m.line, m.text)
Install
No release archive is published yet. Build from source with Rust 1.91 or newer:
git clone https://github.com/scrutate/scrutate && cd scrutate
cargo build --release -p scrutate --locked # target/release/scrutate
Runs on macOS, Linux and Windows. Install guide
Measured, not claimed
Every speed figure comes from scripts in bench/ that you can rerun, with the faster and the slower results both shown.
Questions
What is Scrutate?
An open-source code search tool for the terminal, editors and AI coding agents, in one Rust binary. Engine A searches any folder at once with no index, like grep or ripgrep. Engine B indexes a repository and answers ranked searches by meaning or name, finds definitions, callers and references, and names the tests a git diff touches.
How is it different from ripgrep?
Engine A is built on the same grep and ignore crates as ripgrep and is tested against it. It adds one spelling for every casing of an identifier, matches within N edits and a trigram text index. Engine B has no ripgrep counterpart: it knows where each function is defined, what calls it and what each file imports.
Do I need to build an index?
No. scrutate grep needs no index, no parser and no background process. Run scrutate index when you want Engine B; the index lives in .scrutate/ at the repository root and updates incrementally.
Does my code leave my machine?
No. The binary makes no network connections and has no HTTP or DNS dependency, and the models it ranks with are compiled into it.
How do I give an AI coding agent its tools?
Run scrutate setup claude, or codex, opencode, cursor or gemini. It writes an MCP server entry into that agent's configuration, and --uninstall takes it out again.
Is it free to use?
Yes. Scrutate is licensed under MIT OR Apache-2.0, at your option, and that covers the code, the models and the documents.