Skip to main content
Sourcegraph is a code intelligence platform used by engineering teams at companies ranging from a few hundred developers to more than 40,000. It indexes all of your repositories across every code host, giving developers and engineering leaders a complete, up-to-date understanding of their codebase.

Quickstart

Get up and running with Sourcegraph Cloud or a self-hosted instance in minutes.

Take the tour

See how Sourcegraph helps with real-world developer tasks like code review, debugging, and exploration.

Code Search

Fast, cross-repository search with regex, structural, and diff search across all your code hosts.

Cody AI

AI code assistant that reads, writes, and understands your entire codebase.

Key features

Sourcegraph code search is fast, works across all your repositories at any commit, and has minimal indexing delay. Search across every branch and every code host simultaneously using powerful query syntax. Key capabilities include:
  • Regex and structural search — match patterns, code blocks, and nested expressions using Comby syntax
  • Commit diff and message search — find changes to particular functions, classes, or areas of the codebase over time
  • Multi-line search — search queries that cross multiple lines, not just line-oriented patterns
  • Search contexts — scope searches to a curated set of repositories and revisions
  • Symbol search — filter results to functions, variables, and other symbols across 75+ languages

Explore Code Search

Learn about all Code Search features and query syntax.

Cody AI

Cody is Sourcegraph’s AI coding assistant. Unlike general-purpose AI tools, Cody has full context over your entire codebase—not just the files open in your editor—making its answers more accurate and grounded.
  • Chat — ask questions about your codebase and get sourced, detailed answers
  • Autocomplete — context-aware inline code completions as you type
  • Commands — built-in actions for explaining code, generating tests, fixing bugs, and more
  • Multiple clients — available in VS Code, JetBrains IDEs, and the Sourcegraph web UI

Get started with Cody

Set up Cody and run your first AI-assisted code interaction.
Deep Search is an agentic code search tool that understands natural language questions about your codebase. Unlike traditional search, Deep Search uses AI to intelligently explore your code, following leads and synthesizing information to provide comprehensive, conversational answers.
  • Ask questions in natural language and get detailed, sourced answers about architecture, implementations, and code patterns
  • Use @-mentions to scope searches to specific repositories, files, directories, or symbols
  • Follow up with additional questions to drill deeper into specific aspects of your codebase
  • View all sources — see exactly which searches were performed and which files were analyzed
Deep Search is available on Enterprise Starter and Enterprise plans.

Learn about Deep Search

Explore how Deep Search agents explore your codebase to answer complex questions.

Code Navigation

Sourcegraph gives your development team cross-repository, IDE-like features directly in the browser—no local checkout required:
  • Go to definition — jump to where a symbol is defined, even across repositories
  • Find references — enumerate all call sites and usages across your entire codebase
  • Hover tooltips — inline documentation and type information
  • Symbol search — navigate directly to functions, types, and variables by name
  • Find implementations — navigate from interface definitions to all implementing types
Sourcegraph offers both search-based code navigation (available for 40+ languages with no setup) and precise code navigation using SCIP/LSIF data, which delivers compiler-accurate results with no false positives across 11 languages including Go, TypeScript, Java, Rust, and Python.

Code Navigation docs

Set up precise code navigation and explore all navigation features.

Batch Changes

Automate large-scale code changes across many repositories and code hosts. Batch Changes lets you write a specification for what to change, preview the results, and create pull requests on all affected repositories simultaneously. Common use cases:
  • Update API callsites after a library upgrade
  • Patch critical security vulnerabilities across all repos
  • Rename symbols or update configuration files at scale
  • Track migration progress until all PRs are merged

Batch Changes docs

Learn how to create, preview, and manage large-scale code changes.

Code Insights

Reveal high-level information about your codebase at its current state and over time. Code Insights turns any Sourcegraph search query into a visualization you can track on customizable dashboards. Use Code Insights to track:
  • Migration progress (e.g., framework or library upgrades)
  • Version adoption across all repositories
  • Vulnerability remediation status
  • Codebase size trends and code smell patterns
  • Ownership and component deprecation

Code Insights docs

Build dashboards to measure and act on engineering goals.

Deployment options

Sourcegraph is available in two deployment models:

Sourcegraph Cloud

A single-tenant, fully managed instance hosted and operated by Sourcegraph. No infrastructure to manage.

Self-hosted

Deploy Sourcegraph on your own infrastructure using Docker Compose or Kubernetes. Full control over your environment.
For most enterprise teams, Sourcegraph Cloud is the fastest way to get started. Sourcegraph manages upgrades, scaling, and availability on your behalf.

Who uses Sourcegraph?

Sourcegraph is a good fit for your team if:
  • You have a large number of repositories or a large, complex monorepo
  • You host code across multiple code hosts (GitHub, GitLab, Bitbucket, Perforce, or others)
  • You rely heavily on “go to definition” and “find references” in your editor and want that capability at the codebase level
  • You need to make coordinated changes across many repositories
  • You want visibility into codebase-level trends over time
Facebook and Google built in-house code intelligence tools comparable to Sourcegraph. A published Google research paper found that 98% of developers surveyed considered their internal tool critical, using it an average of 5.3 sessions per day. Sourcegraph provides those same capabilities to every engineering team.

Integrations

Sourcegraph integrates with your existing tools:
  • Code hosts — GitHub, GitLab, Bitbucket Cloud, Bitbucket Server/Data Center, Perforce, and other Git hosts
  • Editors — VS Code, JetBrains IDEs, Gitpod
  • Browsers — Chrome, Firefox, and Safari extensions add code navigation directly on GitHub, GitLab, and Bitbucket
  • MCP Server — connect AI tools and IDEs to Sourcegraph’s code intelligence via the Model Context Protocol

Integration overview

Browse all available integrations and how to configure them.

APIs

GraphQL API

Access all data stored and computed by Sourcegraph.

Stream API

Consume search results as a real-time event stream.

MCP Server

Connect AI tools and IDEs via the Model Context Protocol.

Build docs developers (and LLMs) love