Sourcegraph Cody
What is Sourcegraph Cody?
Sourcegraph Cody is an AI coding assistant for engineering teams that pulls repository context into chat, edits, and completions. It combines Sourcegraph Search, Chat, Auto-edit, Context Filters, and Model Selection to answer questions and make changes from local and remote codebases. Cody works in VS Code, JetBrains, Visual Studio, and the Sourcegraph web app, and supports self-hosted Sourcegraph instances plus Sourcegraph Enterprise.
Last verifiedHow we evaluate
At a glance
- Sourcegraph Cody is best for engineering teams who need codebase-aware chat, edits, and debugging inside their IDE.
- Yes — Cody uses Sourcegraph's advanced Search API to pull context from local and remote codebases.
What does Sourcegraph Cody do?
Cody pulls codebase context into chat, edits, and completions so developers can ask questions, generate changes, and fix issues with more relevant answers. It uses Sourcegraph's advanced Search API to retrieve snippets from local and remote codebases, then combines that context with LLMs to support tasks like chat, auto-edit, prompts, and debug code. In VS Code, JetBrains, and Visual Studio, it works alongside the editor so context can come from open files, repositories, symbols, and usage patterns instead of a blank prompt. At scale, Cody is built for enterprise codebases and supports self-hosted Sourcegraph instances as well as Sourcegraph Enterprise. The FAQ says it sends up to 28 KB per request to a third-party LLM service, with Anthropic by default and OpenAI also supported. Sourcegraph says it does not train on enterprise customers' code, and permissions are enforced during retrieval so only readable code is pulled. The product is also compatible with Sourcegraph Code Search and exposes GraphQL and REST APIs.
Why use Sourcegraph Cody?
- It uses Sourcegraph search to pull context from both local and remote codebases, so answers can reflect repository reality instead of isolated snippets.
- Permission checks happen during retrieval, which helps keep Cody aligned with what each user is allowed to read.
- Self-hosted Sourcegraph support gives teams a path for tighter infrastructure control while still using cloud LLM providers.
- The same assistant works across VS Code, JetBrains, Visual Studio, the web app, and the command line, reducing tool switching.
- Sourcegraph says enterprise customers' code is not used for model training, which matters for teams with stricter data policies.
Who is Sourcegraph Cody for?
- Backend engineers who need answers grounded in repository context.
- Platform teams who want code search and AI assistance in one workflow.
- Developers in VS Code, JetBrains, or Visual Studio who prefer in-editor help.
- Enterprise admins who need self-hosted deployment and permission-aware retrieval.
- Teams using Sourcegraph Code Search who want chat on top of existing code intelligence.
What are Sourcegraph Cody's key features?
Chat
Ask questions about code in VS Code, JetBrains, Visual Studio, or the Sourcegraph web app, with context pulled from GitHub and GitLab repositories.
Auto-edit
Apply inline code edits and fixes directly in the editor, using Smart Apply and keyboard shortcuts to turn prompts into changes faster.
Context
Add files, symbols, and search results to prompts so Cody can use Sourcegraph Search and context retrieval instead of guessing from a single file.
Debug code
Use Cody to analyze errors and trace issues across local and remote codebases, backed by Sourcegraph's advanced Search API and up to 28 KB per request.
Context Filters
Limit what Cody sees with Cody Context Filters and context selection, helping teams control which repositories and files are included in responses.
Model Selection
Choose among supported LLM providers such as Anthropic, OpenAI, Google Gemini, Amazon Bedrock, and GCP Vertex for different coding tasks.
BYOK
Bring your own model keys and configure Cody for LLM providers, giving teams control over model access and deployment preferences.
Code Search
Use Sourcegraph Code Search to retrieve relevant code before prompting, improving answers with repository-aware context from connected codebases.
What does Sourcegraph Cody integrate with?
- GitHub
- GitLab
- VS Code
- JetBrains
- Visual Studio
- Code Search
- Anthropic
- OpenAI
- GitHub Codespaces
- vscode.dev
- Gitpod
- Coder
- code-server
- DeepSeek-Coder-V2
- Fireworks.ai
- Cursor
- IDX
- Amazon Bedrock
- GCP Vertex
- Google Gemini
- Android Studio
- AppCode
- CLion
- DataGrip
- GoLand
- IntelliJ IDEA
- PhpStorm
- PyCharm
- Rider
- RubyMine
What are Sourcegraph Cody's use cases?
Backend engineers debug with context
Backend engineers who need answers grounded in repository context use Cody to trace bugs, explain unfamiliar code, and draft fixes faster. They lean on Chat and Debug code to inspect the right files, then use Auto-edit to apply changes without losing the surrounding logic.
Platform teams search and chat
Platform teams who want code search and AI assistance in one workflow use Cody to jump from Sourcegraph Code Search into guided investigation. With Context Filters and Code Search, they narrow retrieval to the right services, then use Chat to answer architecture questions and unblock reviews.
In-editor help for IDE users
Developers in VS Code, JetBrains, or Visual Studio who prefer in-editor help use Cody while staying inside their editor. They combine context-aware autocomplete with Inline code edits and Smart Apply code suggestions to move from prompt to working code with fewer context switches.
Enterprise retrieval with controls
Enterprise admins who need self-hosted deployment and permission-aware retrieval use Cody to roll out AI safely across internal codebases. They rely on BYOK and Context Management to control model access and data flow, while Context Filters keep responses scoped to what each user can see.
How does Sourcegraph Cody work?
- Install Cody's extension for VS Code, JetBrains, or Visual Studio, then open Chat in your editor to start asking questions against repository context.
- Connect Cody to Sourcegraph Code Search so Context and Code retrieval can pull relevant files, symbols, and history from local and remote codebases.
- Refine what Cody sees with Context Filters and Context Management, then use Prompt Library or Prompts to standardize common engineering tasks.
- Choose a model with Model Selection or configure BYOK for your preferred provider, balancing quality, response time, and internal policy needs.
- Use Auto-edit, Debug code, and Smart Apply to turn answers into changes, then rerun prompts or add context as the codebase evolves.
Frequently asked questions
What is Sourcegraph Cody?
Sourcegraph Cody is an AI coding assistant for engineering teams that pulls repository context into chat, edits, and completions. It combines Sourcegraph Search, Chat, Auto-edit, Context Filters, and Model Selection to answer questions and make changes from local and remote codebases. Cody works in VS Code, JetBrains, Visual Studio, and the Sourcegraph web app, and supports self-hosted Sourcegraph instances plus Sourcegraph Enterprise.
What is Sourcegraph Cody used for? Who is it for?
Sourcegraph Cody is used for Chat, Auto-edit, and Context. It's built for Backend engineers, Platform teams, and Developers in VS Code, JetBrains, or Visual Studio.
Does Sourcegraph Cody have an API and what does it integrate with?
Cody uses Sourcegraph's advanced Search API to pull context from local and remote codebases. It integrates with GitHub, GitLab, VS Code, JetBrains, Visual Studio, and 25 more.
