Sourcegraph Cody is an AI coding assistant that
helps developers understand, write, edit, debug
and maintain software using context from their
codebase. Cody combines large language models
with Sourcegraph's code search and code
intelligence capabilities to provide more
context-aware coding assistance.
Cody is Sourcegraph's AI coding assistant.
It uses codebase context together with
language models to help developers understand,
write, fix and maintain software.
Instead of relying only on the text currently
visible in an editor, Cody can retrieve relevant
information from repositories, files, symbols
and other context sources. Sourcegraph says
this context-aware approach is a central part
of Cody's design.
Who Can Use Cody?
π» Software developers
π§βπ» Engineering teams
π’ Enterprise development organizations
π Developers working with large codebases
π Teams performing refactoring and migrations
π§ͺ Developers writing and maintaining tests
Key Features
Sourcegraph Cody Features
Cody combines AI assistance with Sourcegraph's
code intelligence and context retrieval to
support everyday software development tasks.
π¬
AI Chat
Ask questions about your code, generate
code, explain files and solve development
problems with contextual answers.
β¨οΈ
Code Autocomplete
Get real-time single-line and multi-line
code completion suggestions while coding.
βοΈ
Inline Editing
Select code and describe a change.
Cody generates a diff that you can review.
π
Debugging
Ask Cody to investigate errors and
suggest fixes for problematic code.
β»οΈ
Refactoring
Use natural language instructions to
refactor existing functions and code.
π§ͺ
Test Generation
Generate unit tests and work with
existing code to improve test coverage.
π
Documentation
Create documentation and explanations
based on the code being analyzed.
π§
Codebase Context
Retrieve relevant code and repository
context to make AI answers more useful.
π
MCP Support
Connect Cody to external context and
tools through Model Context Protocol.
π
Prompt Library
Create reusable prompts for common
development tasks and team workflows.
π
Sourcegraph Search
Use Sourcegraph's search capabilities
to retrieve relevant codebase context.
π
Multi-Repository Context
Use context from multiple repositories
when working with larger systems.
How Cody Works
From Prompt To Context-Aware Code
1
Ask
Ask Cody a coding question,
request an edit or describe a problem.
2
Retrieve Context
Cody searches relevant code and
other selected context.
3
Generate
The selected language model uses
the retrieved context to generate
a response.
4
Review
The developer reviews the answer,
code suggestion or generated diff.
Sourcegraph documentation describes Cody's
context retrieval as a core part of its ability
to provide codebase-aware responses.
Context
Why Cody's Codebase Context Matters
A general-purpose AI model may know programming
concepts but not the details of your specific
application. Cody is designed to retrieve
relevant information from the codebase before
generating its response.
π
Keyword Search
Traditional search can identify code
matching important terms in a request.
Find relevant text
Locate files
Search project content
Improve retrieval
π§
Sourcegraph Search
Cody can use Sourcegraph's native search
capabilities to retrieve repository context.
Repository search
Code intelligence
Remote repositories
Large codebase support
πΈοΈ
Code Graph
Code Graph can provide structural information
about relationships between code elements.
Symbols
Definitions
References
Code relationships
Context Sources
What Context Can Cody Use?
π
Files
Mention specific files to help Cody
focus its response on relevant code.
π£
Symbols
Use symbols such as functions and
classes as targeted context.
π
Repositories
Add repository context for broader
codebase-aware responses.
π
Web URLs
Supported Cody clients can use
web URLs as additional context.
π
Directories
Enterprise workflows can reference
remote files and directories.
π
OpenCtx / MCP
Use supported external context
providers and MCP-based workflows.
Chat
Ask Cody About Your Code
Questions You Can Ask
What does this code do?
Where is this component defined?
How does data move through this application?
Why is this function failing?
How can I improve this code?
How can I make this code faster?
Where is this API being used?
Can you explain this repository?
Context-Aware Answers
Cody can search relevant code and use
retrieved context to answer questions
about a project rather than relying only
on general programming knowledge.
Ask questions using your actual repository.
This is particularly useful when working
with unfamiliar or large codebases.
Autocomplete
AI Code Completion
Cody provides real-time single-line and
multi-line code completion suggestions.
The suggestions use surrounding code and
available context to predict what a developer
may want to write next.
// Example
function calculateTotal(items) {
// Cody may suggest the function body
// based on surrounding code and context
}
Autocomplete suggestions should always be
reviewed before being committed, especially
for security-sensitive or production code.
Edit
Refactor Code With Natural Language
1
Select Code
Highlight the function or code
you want to change.
2
Describe
Explain the desired change in
natural language.
3
Generate Diff
Cody creates a proposed code
change for review.
4
Accept Or Reject
Review the diff and choose
whether to apply it.
Debugging
Debug Problems With Cody
Debugging Workflow
π Identify the error
π Provide relevant code context
π¬ Ask Cody to explain the problem
π Analyze possible causes
π Generate a fix
π§ͺ Test the change
Why Context Helps
A bug may involve several files or
components. Cody can retrieve relevant
code and relationships to help developers
understand the broader problem.
AI-generated fixes should be tested and
reviewed by a developer before deployment.
Testing
Generate Unit Tests
π§ͺ
Generate Tests
Ask Cody to create unit tests
for existing functions.
π
Understand Existing Tests
Ask Cody to explain how an existing
test suite works.
Cody provides AI coding assistance
for supported JetBrains environments.
Chat
Code completion
Editing
Debugging
Context
π£
Visual Studio
Cody is also available through the
Visual Studio extension.
AI assistance
Code context
Editing
Debugging
Development workflows
Sourcegraph's current documentation also
lists Cody for the web application and
Cody CLI.
Cody Web
Use Cody From The Sourcegraph Web App
Web Workflow
π Search your code
π¬ Open Cody chat
π Add repository context
π Mention files
π£ Mention symbols
π Add web URLs where supported
Repository-Aware Chat
Cody can be opened from Sourcegraph search
results so developers can ask questions
using the code they are currently exploring
as context.
Search first. Ask Cody second.
This workflow is useful when investigating
unfamiliar repositories or large projects.
CLI
Cody From The Command Line
Sourcegraph documentation lists Cody CLI
as one of the ways developers can use Cody.
CLI workflows can be useful for developers
who prefer terminal-based development.
# Cody CLI
cody
# Check the current Cody CLI documentation
# for installation and command syntax.
Command names and installation instructions
can change. Always use Sourcegraph's current
documentation when installing Cody CLI.
Enterprise
Sourcegraph Cody Enterprise
π’
Enterprise Code Context
Use context from large organizational
codebases and multiple repositories.
π
Permissions
Sourcegraph's retrieval process respects
the user's code access permissions.
π
Multi-Repository Context
Enterprise Cody can use multiple repositories
as context in supported clients.
π
Analytics
Enterprise administrators can access
Cody-related usage analytics.
βοΈ
Administration
Configure enterprise settings and
manage the Cody deployment.
π
Self-Hosted Sourcegraph
Cody can work with supported self-hosted
Sourcegraph environments.
Multi-Repository Context
Understand Large Software Systems
Why Multiple Repositories Matter
Modern software systems often contain
multiple repositories. A frontend may
depend on backend services, shared libraries,
APIs and infrastructure projects.
Cody can use multi-repository context in
supported Enterprise workflows, helping
developers ask questions that span more
than one repository.
Example
Repository A
β
Frontend
Repository B
β
API Service
Repository C
β
Shared Library
Repository D
β
Infrastructure
Cody
β
Cross-repository context
Languages
Programming Languages Supported
JavaScript
Web and application development.
TypeScript
Modern JavaScript applications.
Python
Automation, backend and AI development.
Java
Enterprise and application development.
C / C++
Systems and performance-focused software.
C#
Microsoft and .NET development.
Go
Cloud and backend development.
Rust
Systems and performance-focused software.
Kotlin
Android and JVM development.
Swift
Apple platform development.
PHP
Web application development.
Ruby
Web and application development.
Sourcegraph documentation lists many additional
languages, including SQL, Scala, Groovy, R,
MATLAB, Dart, Lua, Julia, COBOL and shell
scripting languages.
Pricing
Sourcegraph Cody Pricing
Cody's current availability is tied to
Sourcegraph Enterprise. Sourcegraph's
documentation states that Cody is supported
on Sourcegraph Enterprise.
Sourcegraph's current documentation says Cody
is supported on Sourcegraph Enterprise. Pricing
and contract terms should be confirmed directly
with Sourcegraph because enterprise agreements
can vary.
Billing
How Cody Enterprise Users Are Counted
Active Users
Sourcegraph's pricing documentation states
that Cody Enterprise billing counts users
based on active interaction with the product.
Autocomplete interaction
Cody commands
Chat activity
Starting discussions
Changing settings
Other qualifying product interactions
Installation Alone
Installing Cody alone does not make a user billable.
Sourcegraph's documentation distinguishes
installation from active product usage when
counting billable Cody Enterprise users.
Privacy
Does Cody Train On Your Code?
Enterprise Data
Sourcegraph states that for Enterprise
customers it does not train on company data.
Its documentation also states that third-party
LLM providers do not train on the customer's
specific codebase.
π Permission-aware retrieval
π’ Enterprise controls
π« No model training on company data
π§ Context retrieval through Sourcegraph
How A Request Works
Developer
β
Cody request
β
Sourcegraph code retrieval
β
Relevant code snippets
β
Language Model
β
Cody response
For sensitive production repositories, review
Sourcegraph's current privacy, security and
data-processing documentation before deployment.
Security
Permission-Aware Code Context
Sourcegraph's Cody FAQ describes a retrieval
process in which Sourcegraph enforces the
user's existing read permissions when retrieving
code relevant to a request.
1
User Asks
A developer asks Cody a question
about their software.
2
Search
Sourcegraph searches for relevant
code and context.
3
Permission Check
Only code the user is allowed
to access is retrieved.
4
AI Response
The retrieved context is used
to generate Cody's answer.
Use Cases
What Can You Use Cody For?
π¬ Code Questions
Ask questions about unfamiliar
code and repositories.
β¨οΈ Autocomplete
Generate code suggestions while
writing software.
β»οΈ Refactoring
Modernize and restructure existing
code using natural language.
π Debugging
Investigate errors and generate
potential fixes.
π§ͺ Testing
Generate tests and analyze existing
test implementations.
π Documentation
Create documentation and explain
complex code.
π Code Search
Locate implementations, symbols
and related code.
ποΈ Large Codebases
Understand applications that span
many files and repositories.
π Migrations
Assist developers with large-scale
code changes and modernization.
Example
Ask Cody To Explain A Codebase
Prompt:
"Explain how authentication works
in this application.
Show me:
1. Where authentication starts
2. Which files handle login
3. How tokens are created
4. Where tokens are validated
5. Which APIs require authentication
6. Potential security concerns"
Cody:
β Searches relevant code
β Retrieves context
β Connects related files
β Generates an explanation
The quality of the answer depends on the
available code context, selected model,
repository structure and the accuracy of
the retrieved information.
Pros & Considerations
Sourcegraph Cody Advantages & Limitations
β Advantages
Strong codebase-aware context
Sourcegraph Search integration
Repository-aware chat
Code autocomplete
Inline editing
Debugging assistance
Refactoring support
Test generation
Prompt Library
MCP support
Multi-repository context
Enterprise deployment options
! Things To Consider
Current documentation positions Cody on Sourcegraph Enterprise
Self-hosted deployments still have model-provider considerations
Not intended as a general-purpose chatbot
Enterprise setup may require administrator configuration
Comparison
Cody vs Other AI Coding Tools
Tool
Main Focus
Chat
Autocomplete
Context
MCP
Enterprise
Sourcegraph Cody
Code Intelligence + AI
ββ
ββ
ββ
β
ββ
Qodo
AI Code Review
β
β
ββ
β
ββ
Cline
Agentic Coding
ββ
β
β
ββ
β
Continue
Open-Source Coding Agent
ββ
β
β
ββ
β
Aider
AI Pair Programming
β
β
β
β
β
Claude Code
Agentic Coding
ββ
β
ββ
ββ
ββ
Cody stands out most when the development
workflow benefits from Sourcegraph's code
search, code intelligence and repository
context.
Best For
Who Should Use Sourcegraph Cody?
Great Choice For
π’ Enterprise engineering teams
π Large codebases
π Multi-repository projects
π Developers who need deep code search
β»οΈ Refactoring and modernization
π§ͺ Testing and debugging
π» Teams already using Sourcegraph
π§ Developers who need codebase-aware AI
Consider Alternatives If
π¨ You want a visual no-code builder
π€ You primarily need autonomous coding agents
π° You specifically need a simple free consumer tool
π₯οΈ You do not need repository-level context
β‘ You only want basic autocomplete
Sourcegraph Platform
Cody Is Part Of A Larger Code Intelligence Platform
π
Code Search
Search repositories, branches and
code hosts through Sourcegraph.
π§
Code Intelligence
Navigate definitions, references,
ownership and code relationships.
π€
Cody
Use AI to read, write, explain,
debug and maintain code.
π¬
Deep Search
Ask natural-language questions
about complex codebases.
π
Batch Changes
Apply large-scale changes across
multiple repositories.
π
Code Insights
Track high-level information about
codebases and engineering trends.
FAQ
Sourcegraph Cody FAQ
Cody is Sourcegraph's AI coding assistant.
It helps developers understand, write, edit,
debug and maintain code using language models
and context retrieved from their codebases.
Cody can provide AI chat, code autocomplete,
inline edits, debugging help, refactoring,
testing assistance, documentation and
context-aware coding suggestions.
Yes. Sourcegraph officially describes Cody
as an AI coding assistant designed to help
developers write, fix and maintain code.
Sourcegraph's current documentation positions
Cody as supported on Sourcegraph Enterprise.
Enterprise pricing is handled through
Sourcegraph rather than a simple consumer
free-tier pricing model.
Cody Enterprise pricing is contract-based.
Sourcegraph's pricing documentation explains
that Enterprise Cody users are counted based
on active product usage.
Yes. Cody provides real-time single-line and
multi-line code completion suggestions.
Yes. Cody can generate code through chat,
autocomplete, prompts and editing workflows.
Yes. Cody supports inline editing and can
generate diffs based on natural-language
instructions.
Yes. Developers can select code and ask
Cody to refactor it, then review the
generated diff before applying it.
Yes. Cody can help identify errors,
explain potential causes and generate
possible fixes.
Yes. Cody can generate unit tests and
assist with testing-related development
tasks.
Yes. Explaining code and answering questions
about repositories are core Cody use cases.
Cody is designed to retrieve relevant
context from codebases. It can use repository,
file, symbol and other context sources.
It does not mean every prompt automatically
uses every file in a project.
Cody context is additional information
retrieved from your codebase or selected
sources so that the language model can
generate more relevant answers.
Yes. Sourcegraph's documentation describes
Sourcegraph Search as one of the important
methods Cody uses to retrieve code context.
Sourcegraph documentation describes Code
Graph as a mechanism Cody can use to understand
relationships between code elements.
Yes. Cody supports multi-repository context
in supported clients and Enterprise workflows.
Yes. Cody is available through a VS Code
extension.
Yes. Cody has a JetBrains extension.
Yes. Sourcegraph documentation lists
Cody for Visual Studio.
Yes. Cody is available through the
Sourcegraph web application.
Yes. Sourcegraph documentation lists
Cody CLI as one of the available Cody
interfaces.
Yes. Cody supports Model Context Protocol
for connecting external context and tools.
Yes. Cody supports pre-built and
customizable prompts through its
Prompt Library.
Cody can assist developers with debugging,
analysis and fixing errors.
Yes. Cody can assist with generating
documentation and explaining software.
Yes. Sourcegraph documents support for
many languages including JavaScript,
TypeScript, Python, Java, C, C++, C#,
Go, Rust, Kotlin, Swift, PHP, Ruby and
many others.
Sourcegraph states that for Enterprise
customers it does not train on company
data. Third-party language-model providers
do not train on the customer's specific
codebase according to Sourcegraph's FAQ.
Sourcegraph's documentation describes
permission-aware retrieval so that only
code the user has permission to read is
retrieved for the request.
Yes. Cody can work with supported
self-hosted Sourcegraph instances, although
model-provider and network requirements
apply.
Cody is particularly useful for large
codebases because its design emphasizes
retrieving relevant repository context
and using Sourcegraph code intelligence.
They focus on different problems. Cody is
primarily an AI coding assistant integrated
with Sourcegraph code intelligence, while
Qodo has a stronger emphasis on AI code review,
quality and governance.
It depends on the workflow. Cody is especially
strong for codebase-aware development and
Sourcegraph environments, while Cline is
oriented toward agentic coding workflows.
No. Cody is an AI development assistant.
Generated code and explanations should be
reviewed, tested and validated by developers.
Cody is a strong fit for developers and
engineering organizations that need AI
assistance combined with deep repository
context, code search and code intelligence.
Build Faster With Sourcegraph Cody
Use AI coding assistance together with
deep codebase context, autocomplete,
editing, debugging, testing and
Sourcegraph code intelligence.