Sourcegraph is an open-core code search and navigation tool designed for large codebases and teams. It supports literal, regex, and structural search (via the Comby library) across multiple repositories, with results typically returning in seconds. Code intelligence features include go-to-definition and find-references, using either search-based heuristics or precise LSIF-based indexing. The server is written in Go and uses zoekt (trigram-based) for indexed search. Setup via Docker Compose is straightforward, though the open-source build is poorly documented. Browser extensions for Chrome and Firefox integrate Sourcegraph features into GitHub and GitLab. Notable caveats include mandatory phone-home telemetry that can only be disabled by modifying source code, and an enterprise license restricting features like multi-repository refactoring (Campaigns) and multi-code-host support. The tool is best suited for teams of 15+ developers.

11m read timeFrom lwn.net
Post cover image
Table of contents
Searching code with SourcegraphSearching code with SourcegraphSearching code with SourcegraphZoekt & trigram backgroundSearching code with SourcegraphSearching code with Sourcegraph
2 Impressions