ConfigsApr 2, 2026·3 min read

Cody by Sourcegraph — AI with Full Codebase Context

AI code assistant that understands your entire codebase. Chat, completions, edits, and deep search across repos. Enterprise-grade.

TL;DR
Cody uses Sourcegraph's code graph to give AI full codebase context for chat, completions, and cross-repo search.
§01

What it is

Cody is Sourcegraph's AI code assistant that differentiates itself by understanding your entire codebase, not just the open file. It uses Sourcegraph's code intelligence platform to build a semantic understanding of cross-file dependencies, function call chains, and project structure.

Cody is available as an extension for VS Code, JetBrains, Visual Studio, Neovim, and Emacs. It targets teams working on large codebases where generic AI assistants produce incomplete or incorrect answers because they lack project-wide context.

§02

How it saves time or tokens

Most AI coding assistants only see the current file plus a few open tabs. When you ask about cross-file behavior (how a function is used across the codebase, what calls a specific API), they guess. Cody pulls relevant code from across your entire repository using Sourcegraph's indexing, giving the LLM the right context before it responds.

The token estimate for this workflow is approximately 1,453 tokens. By providing precise context rather than dumping entire files, Cody reduces both token usage and hallucination rates.

§03

How to use

  1. Install the Cody extension:
# VS Code
code --install-extension sourcegraph.cody-ai

# Or search 'Cody' in the Extensions panel (Ctrl+Shift+X)
  1. Sign in with your Sourcegraph or GitHub account.
  1. Open any project. Cody automatically indexes your codebase and is ready for chat, completions, and inline edits.
§04

Example

# In Cody chat within VS Code:

You: How is the `processPayment` function called across the codebase?

Cody: `processPayment` is called in 3 places:
1. `src/api/orders.ts:142` -- after order validation
2. `src/webhooks/stripe.ts:89` -- on payment intent confirmation
3. `tests/integration/payment.test.ts:45` -- test suite

The function accepts a PaymentIntent object and returns
a TransactionResult. The Stripe webhook path handles
retries via idempotency keys.

Cody also supports inline edits:

# Select code, press Ctrl+Shift+E, type instruction:
'Add error handling for the case where payment provider is unreachable'
§05

Related on TokRepo

§06

Common pitfalls

  • Cody's full codebase context feature requires a Sourcegraph instance or Sourcegraph Cloud account. Without it, Cody falls back to local file context only.
  • Enterprise self-hosted deployments need Sourcegraph running alongside Cody. The setup is more involved than a simple extension install.
  • Free tier has usage limits on chat and completions. Check Sourcegraph's pricing page for current quota details.

Frequently Asked Questions

How does Cody differ from GitHub Copilot?+

Copilot focuses on inline code completions using the current file and open tabs as context. Cody uses Sourcegraph's code graph to pull context from across your entire codebase, making it stronger for cross-file questions and large monorepos.

Does Cody work with private repositories?+

Yes. Cody works with any repository you have access to. For full codebase context, connect Cody to a Sourcegraph instance (cloud or self-hosted) that indexes your private repos.

What LLMs does Cody use?+

Cody supports multiple LLM providers including Claude, GPT-4, and Gemini. Enterprise users can configure which models are available. The LLM handles generation while Sourcegraph handles context retrieval.

Is Cody free?+

Cody has a free tier with limited chat and completion usage. Paid plans (Pro and Enterprise) increase quotas and add features like admin controls and SSO. Check sourcegraph.com for current pricing.

Can I use Cody in Neovim?+

Yes. Cody has official support for VS Code, JetBrains IDEs, Visual Studio, Neovim, and Emacs. The Neovim plugin provides chat and completions with the same codebase context features.

Citations (3)
🙏

Source & Thanks

Created by Sourcegraph. Licensed under Apache-2.0.

Cody — Available on VS Code, JetBrains, Visual Studio, Neovim, Emacs

Thanks to Sourcegraph for building an AI assistant that truly understands codebases at scale.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets