fast_code_search
Code search that ranks like code. fast_code_search indexes your source trees once, keeps a trigram index in memory, and ranks every hit the way a reader of the code would: definitions above usages, files the rest of the codebase imports above the ones nothing depends on, the phrase you typed above lines that merely contain its words. Queries answer in milliseconds over gigabytes of code, from a command-line client, a web UI, or REST and gRPC APIs.
fcs 'fn main' returns fn main() lines first. fcs symbols Widget returns
the type’s definition, not its two hundred uses. fcs refs Widget returns
those uses. See Ranking for why.
Where to go
| You want to… | Read |
|---|---|
| install and run a first search | Install, then First index, first search |
| use it from a terminal or an editor | Command-line client, Editors |
| give a coding agent the index | Coding agents (MCP) |
| keep it running on your machine | Run at startup |
| index many repositories or a monorepo | Configuration cookbook |
| know what a request or config key does | API and configuration, Query syntax |
| know where results differ from grep or ripgrep | Matching compared with grep and ripgrep |
| understand the ranking or the index | How it works |
| check the numbers | Benchmarks |
| fix something | Troubleshooting |
The parts
flowchart LR
subgraph clients
W[web UI<br/>embedded]
F[fcs<br/>command line]
E[editors, scripts]
G[coding agents]
end
subgraph server["fast_code_search_server"]
A[REST + MCP :8080] --> X[(in-memory index<br/>trigrams · symbols · import graph)]
R[gRPC :50051] --> X
V[watcher] --> X
X <--> P[/index file on disk/]
end
W --> A
F --> A
E --> A
E --> R
G --> A
T[(your source trees)] --> V
F -. offline fallback .-> P
fast_code_search_serverbuilds and holds the index, watches the tree for changes, and serves the web UI on127.0.0.1:8080and gRPC on127.0.0.1:50051.fcsis the command-line client: grep-style output and exit codes,--jsonfor tools, and an offline fallback that searches the saved index when the server is down.- The web UI is embedded in the server: search-as-you-type, hover previews, references, regex help, a dependency explorer for the import graph, a diagnostics page.
- REST and gRPC expose the same queries to editors and scripts, and
MCP at
/mcpexposes them to coding agents.
Source, issues and releases: github.com/jburrow/fast_code_search.