Sourcegraph Cody
AI Assistant That Knows Your Entire Codebase
What is Sourcegraph Cody?
Sourcegraph Cody is an AI coding assistant that leverages Sourcegraph's code intelligence platform to understand your entire codebase at scale. Sourcegraph Cody fetches context from across your repositories, dependencies, and documentation before answering questions or generating code. Sourcegraph Cody supports Claude, GPT, Gemini, and open models, and runs in VS Code, JetBrains, and Neovim. Sourcegraph Cody excels where other tools lose context: sprawling monorepos with millions of lines, multi-repo microservice architectures, and large teams where tribal knowledge lives across many projects. Sourcegraph Cody's @-mention syntax lets you attach files, symbols, or entire repos to a prompt, giving it the precise context needed for accurate answers.
Key Features of Sourcegraph Cody
Codebase-Wide Context
Sourcegraph Cody uses Sourcegraph's search and index to pull context from any repo in your organization. It answers questions about code you haven't opened, unlike editor-only tools.
@-Mention Syntax
Prefix your prompts with @file, @symbol, or @repo to attach exactly the context Sourcegraph Cody needs. This eliminates copy-paste and ensures precise, grounded answers.
Multi-Model Support
Sourcegraph Cody lets you pick between Claude, GPT, Gemini, and local models per request. Use a powerful model for architecture questions and a cheap one for quick completions.
Inline Edits
Select code, describe a change, and Sourcegraph Cody rewrites it in place with a diff you can accept or reject. This works across multiple selections in the same file.
Commands and Recipes
Sourcegraph Cody ships built-in commands like /explain, /test, /doc, and /smell. Create custom recipes your team shares so everyone runs the same AI workflows.
Enterprise Graph Context
With Sourcegraph Enterprise, Sourcegraph Cody reasons over precise code intelligence: type definitions, references, and dependency graphs across every indexed repository.
Sourcegraph Cody Pricing Plans
Free
Sourcegraph Cody for individuals with 500 autocompletes and 200 chat messages per month using default models. Good for evaluating Sourcegraph Cody.
Pro
Unlimited Sourcegraph Cody autocompletes, 1000 chat messages, and access to frontier models. Designed for professional developers on personal projects.
Enterprise
Sourcegraph Cody with full codebase context, SSO, unlimited chat, custom recipes, and admin controls. Ties into Sourcegraph Enterprise search.
Best Use Cases for Sourcegraph Cody
Debugging Across Microservices
- Target user:
- Engineer tracing a bug through five repos
- Pain point:
- Each repo needs a separate clone, search, and context switch, and the bug crosses boundaries
- Solution:
- Ask Sourcegraph Cody to search all five repos for the error string. It returns the exact files and trace path across services in seconds.
Writing Cross-Repo Refactors
- Target user:
- Staff engineer updating a shared API contract
- Pain point:
- You need to find every consumer and update call sites you didn't write
- Solution:
- Use @repo to give Sourcegraph Cody the API definition, then ask for all call sites. It generates patches for every consumer in one pass.
Answering Architecture Questions
- Target user:
- Tech lead evaluating a refactor proposal
- Pain point:
- You need to know how many services depend on Module X before you can approve the change
- Solution:
- Sourcegraph Cody queries the code graph and counts reverse dependencies instantly, citing the exact import paths for each dependent service.
Onboarding to a Large Monorepo
- Target user:
- New engineer at a company with a 2M-line repo
- Pain point:
- Standard AI tools timeout or hallucinate because the codebase exceeds their context window
- Solution:
- Sourcegraph Cody fetches only the relevant slices through Sourcegraph search, giving accurate answers without needing to load the entire repo.
How to Use Sourcegraph Cody — Step by Step
- 1
Install the Extension
Install Sourcegraph Cody from the VS Code or JetBrains marketplace. Create a free Sourcegraph account to activate the assistant.
- 2
Connect Your Repos
Point Sourcegraph Cody to your Sourcegraph instance or let it index local files. Enterprise users get organization-wide code intelligence automatically.
- 3
Ask a Codebase Question
Open the Sourcegraph Cody chat and type a question like 'how does user auth work?' Use @repo to include files outside your current editor.
- 4
Apply an Inline Edit
Select code, press the Sourcegraph Cody edit hotkey, and describe the change. Review the diff and accept or reject each hunk individually.
- 5
Use Built-In Commands
Run /explain on a complex function, /test on a module, or /doc to generate documentation. Customize commands in your Sourcegraph Cody settings.
Sourcegraph Cody vs Alternatives
Sourcegraph Cody FAQ
Related Code & Development Tools
Claude Code
Code & DevelopmentAnthropic's Agentic Coding Assistant for the Terminal
Cursor
Code & DevelopmentThe AI-First Code Editor Built for Pair Programming
GitHub Copilot
Code & DevelopmentAI Pair Programmer Built Into Your Editor
v0
Code & DevelopmentAI-Powered UI Generator from Vercel