Zoekt
$ zoekt Community Low RiskZoekt is Sourcegraph's fast trigram-indexed code search engine. Once repositories are indexed into .zoekt shards using zoekt-git-index or zoekt-index, the zoekt CLI answers regex, symbol, and lang:/repo: queries in milliseconds across massive codebases.
go install github.com/sourcegraph/zoekt/cmd/zoekt@latest Local zoekt queries prebuilt trigram shards in milliseconds without running an extra MCP daemon.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Fast non-interactive querying with rich query filters (lang:, repo:, sym:), but cmd/zoekt lacks --json output and relies on separate indexing binaries.
- Non-interactive Go CLI with
-lfile listing and query predicates - No
--jsonoutput mode oncmd/zoekt
zoekt querying is strictly read-only; zoekt-git-index only writes .zoekt shard files into the designated -index directory.
- Never modifies repository source files
Requires go install of multiple binaries (zoekt, zoekt-git-index) and manual shard indexing; no Homebrew core formula.
- Multi-binary Go toolchain installation and explicit index management
Sub-10ms trigram search across thousands of repositories outperforms linear scanners once shards exist.
- Trigram + symbol index scales to multi-GB monorepos
Actively maintained by Sourcegraph under Apache-2.0 as its core code-search backend.
- Active
sourcegraph/zoektrepository
Query syntax and indexer usage are documented in the repository README and Go doc comments, though standalone CLI flags are sparsely documented.
- Query grammar and setup documented in
sourcegraph/zoekt
Security, Auth & Guardrails
None required for local zoekt search; zoekt-mirror-github optionally reads a token file if mirroring remote orgs.
100% free, offline, and open-source (Apache-2.0).
# Zoekt Agent Rules - Ensure shards in `-index_dir` are up to date via `zoekt-git-index` before relying on `zoekt` results. - Use `-l` or narrow `repo:` / `lang:` predicates to avoid flooding stdout.
Agent-Ready Command Recipes
Safe Read-Only Queries
zoekt -index_dir ~/.zoekt 'lang:go func NewServer'
Searches pre-indexed trigram shards for matching Go lines across indexed repositories.
zoekt -index_dir ~/.zoekt -l 'repo:my-service TODO'
Prints only unique matching file paths (-l) to keep output compact.
Controlled Writes & Previews
zoekt-git-index -index ~/.zoekt .
Writes .zoekt trigram index shards into ~/.zoekt without modifying the repository working tree.
Strengths for Agents
- + Instant trigram-indexed search across huge multi-repo codebases (
lang:,sym:,file:). - + Zero impact on working trees when indexing into a separate
-index_dir.
Caveats & Pitfalls
- ! Results can go stale unless
zoekt-git-indexis re-run after commits. - ! Not packaged in Homebrew;
cmd/zoektprints plain text with no--jsonflag.