Local code search over your git checkouts. A CLI and an MCP stdio server for Claude Code, backed by zoekt.
csl walks the directories you configure, indexes every git repo it finds, and searches them with zoekt's trigram index. You get grep-like queries across dozens of checkouts in milliseconds, without shipping your code to a cloud service.
There is no server to manage. A short-lived search daemon is spawned on demand from the same binary, keeps zoekt shards mmap'd across queries, and exits after ten minutes of idleness.
Use it in two ways:
- At the terminal:
csl search,csl count,csl repo,csl read. - Inside Claude Code (or any MCP client).
csl mcpexposes eightcsl_*tools so the agent can search, resolve repo paths, and read files without shelling out.
Requires Go 1.25+.
go install github.com/mad01/code-search-local/cmd/csl@latestFrom a checkout:
make install # builds with version embedded, copies to ~/code/bin/cslCreate ~/.config/csl/config.yaml listing the directories that contain your git checkouts:
dirs:
- ~/code/src/github.com
- ~/workspacecsl walks each directory concurrently and records every directory whose immediate child is .git. Nested repos are not descended into once a .git is found.
csl repo --list # list every indexed repo
csl search "func Walk" # search all indexed repos
csl search "TODO" --repo myrepo # filter to one repo
csl search "fmt\.Errorf" --lang go --output-mode content -C 3
csl count "TODO" --group-by repo # cross-repo tally
csl doctor # check index + daemon healthFirst search in a fresh checkout triggers an initial index build. Subsequent searches are served by the daemon and return in hundreds of milliseconds.
claude mcp add --scope user csl -- csl mcp
claude mcp list # expect: csl: csl mcp - ✓ ConnectedThe MCP server exposes eight tools: search, count, query validation, repo lookup/info/pull/reindex, and file read. See docs/mcp.md for the per-tool reference.
- Getting started — install, configure, first search.
- Configuration — config file, paths, environment.
- CLI reference — every subcommand and flag.
- MCP server reference —
csl mcptool reference for Claude Code. - Architecture — how the daemon, index, and MCP adapter fit together.
MIT. See LICENSE.