Sourcegraph
Sourcegraph is a code intelligence platform. You search and navigate across many repositories, see definitions and references, and (on paid tiers) run batch changes and insights. This guide focuses on what matters for product and engineering: when to use it, core concepts, and how it fits alongside your IDE and Git host.
Sourcegraph Code Search Overview
Why sourcegraph fits product work
Core concepts that matter
Code search
Search is the core: you run queries over one or many repositories. Support includes keyword, literal, regex, and structural search (e.g. “function named X that calls Y”). Use filters to restrict by repo, file path, language, or branch. Results show matching snippets; click through to the file and then use “Find references” or “Go to definition” for navigation.
Intro to Code Search
Repositories and code hosts
Sourcegraph indexes repositories from your code host (GitHub, GitLab, Bitbucket, or custom Git). You choose which repos to add and how often to sync. Indexing makes search fast; without it, search may fall back to slower or less complete modes. For large orgs, admins typically configure repo discovery and permissions via the code host connection.
Navigation: definitions and references
Go to definition jumps to where a symbol is defined; Find references lists every use. This is “IDE-style” navigation at the scale of the whole org. Use it when you’re changing a shared lib or API and need to see impact before editing.
Batch changes (paid)
Batch changes let you define a change (e.g. “replace import X with Y” or run a script) and apply it across many repos and branches. You review a preview, then create a batch change and attached PRs (or MRs) in your code host. Useful for dependency upgrades, renaming, and enforcing patterns.
Insights (paid)
Insights run saved searches (or other queries) over time and show trends-e.g. “where is deprecated API X still used?” or “adoption of library Y.” Helps product and eng leadership see tech debt and migration progress.
Practical habits
repo: and file: and lang: to scope.When sourcegraph isn’t the fit
Pricing (high level)
Free - Limited search and navigation; often for personal or small teams. See Sourcegraph’s site for current free tier.
Team / Enterprise - More repos, batch changes, insights, SSO, and support. See Sourcegraph’s pricing for current plans.
For orgs with many repos and a need to “search everywhere and refactor at scale,” Sourcegraph is a strong default. Start with search and navigation; add batch changes and insights when you have recurring refactors or want visibility into usage and tech debt.

