Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Zoekt

$ zoekt Community Low Risk
Sourcegraph · Files & Search · Apache-2.0 · macos / linux

Zoekt 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.

FCRS-1.0 Score
76 /100
Good
Medium Confidence
Zero-Friction Install
go install github.com/sourcegraph/zoekt/cmd/zoekt@latest
CLI vs MCP Decision CLI Preferred vs MCP

Local zoekt queries prebuilt trigram shards in milliseconds without running an extra MCP daemon.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
— NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 16 / 25

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 -l file listing and query predicates
  • No --json output mode on cmd/zoekt
Trust & Safety 22 / 25

zoekt querying is strictly read-only; zoekt-git-index only writes .zoekt shard files into the designated -index directory.

  • Never modifies repository source files
Setup & Portability 10 / 15

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
Utility & Efficiency 12 / 15

Sub-10ms trigram search across thousands of repositories outperforms linear scanners once shards exist.

  • Trigram + symbol index scales to multi-GB monorepos
Maintenance & Lineage 9 / 10

Actively maintained by Sourcegraph under Apache-2.0 as its core code-search backend.

  • Active sourcegraph/zoekt repository
Docs & Verifiability 7 / 10

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

Auth Modes
No Auth
Credential Storage

None required for local zoekt search; zoekt-mirror-github optionally reads a token file if mirroring remote orgs.

Side Effects
Read-Only Local Write
Cost & Quotas

100% free, offline, and open-source (Apache-2.0).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Query indexed Go code by language filter
zoekt -index_dir ~/.zoekt 'lang:go func NewServer'

Searches pre-indexed trigram shards for matching Go lines across indexed repositories.

List matching files only
zoekt -index_dir ~/.zoekt -l 'repo:my-service TODO'

Prints only unique matching file paths (-l) to keep output compact.

Controlled Writes & Previews

Build or refresh trigram index shards for a Git repo
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-index is re-run after commits.
  • ! Not packaged in Homebrew; cmd/zoekt prints plain text with no --json flag.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI