AI Coding · Sourcegraph

Cody

Sourcegraph’s AI coding assistant — deep codebase understanding via code-search-grade context retrieval.

Visit https://sourcegraph.com/cody
CategoryPricingCompanyOfficial siteBest for
AI CodingFreemiumSourcegraphsourcegraph.com/codyLarge, gnarly codebases where the assistant must actually find things

What it is

Cody is Sourcegraph’s AI coding assistant — chat, inline completions and edit commands inside VS Code, JetBrains and Visual Studio — with one obsessed-over differentiator: context. Instead of stuffing whatever files are open into the prompt, Cody retrieves context from your whole codebase using Sourcegraph’s code search and code graph. Ask “how does auth work in this repo?” and it finds the actual middleware, the actual token logic, the actual tests — not the three files you happened to have open.

Who makes it and why it matters

Sourcegraph has been doing code search and code intelligence since 2013, long before LLMs made “understand your codebase” a marketing line. That pedigree is the whole story: Cody isn’t a chatbot with a code-shaped system prompt bolted on, it’s a retrieval system that happens to answer in natural language. For monorepos with millions of lines, where “just RAG over the files” produces confident nonsense, Cody’s context engine is the real product — the LLM is interchangeable plumbing.

What it actually does

Code-search-grade context retrieval. Cody builds a context from keyword search, semantic embeddings, symbol graphs and (optionally) your Sourcegraph instance indexing the entire org — every repo, every branch. When you ask a question, it assembles that context on the fly and stays inside token budgets by ranking, not by hoping. The free tier uses Sourcegraph’s hosted retrieval; enterprise tiers plug into your own Sourcegraph deployment, so proprietary code never leaves your perimeter.

The usual menu, done properly. Chat with repo awareness, inline autocomplete, “edit this selection” commands, and recipes like “explain this function”, “write a docstring” and “find the bug”. You pick the underlying model — Claude, GPT, Gemini or StarCoder — rather than being locked to one vendor.

# In VS Code / JetBrains:
# 1. Install "Cody AI" from the marketplace
# 2. Sign in (free account) or point at your Sourcegraph URL
# 3. Cmd/Ctrl+L and ask: "where is rate limiting enforced?"

The answers cite files and line numbers, which is how you know the retrieval worked rather than freestyled.

How it compares to Cursor and Copilot

vs Cursor. Cursor is the better editor-native experience and its agent is stronger at autonomous multi-file work. Cody is the better codebase librarian. If your question is “what does this repo do and where does X happen”, Cody wins; if your task is “go implement X across the app”, Cursor or Claude Code wins.

vs GitHub Copilot. Copilot’s workspace agent is closing the gap, but Cody’s retrieval quality on very large repos is still class-leading, and Cody lets you bring your own model and your own Sourcegraph index. Copilot is smoother for small projects; Cody earns its keep past ~500K LOC.

Pricing and free tier

Cody has a genuinely usable free tier: chat and completions with a monthly cap, on supported models, no credit card. Pro lifts the limits and adds more model choice for a per-user monthly fee (around $9–19 depending on plan and timing — check their page, it moves). Enterprise is custom pricing and unlocks your own Sourcegraph deployment, SSO, and full private-repo indexing. It’s freemium, not fake-free: the free tier is a real evaluation, not a two-day trial.

Where it shines / where it doesn’t

Shines: huge monorepos, polyglot legacy codebases nobody fully understands, onboarding onto an unfamiliar repo, security/compliance questions about “where is PII handled”, and teams already running Sourcegraph.

Doesn’t: greenfield toy projects (retrieval is overkill), offline/air-gapped use without a Sourcegraph deployment, and agentic “go build it” workflows — Cody advises more than it acts. Also expect a learning curve on context filters; feeding it the wrong repos produces charmingly wrong answers.

Getting started in 3 minutes

# 1. Install the Cody extension in VS Code or JetBrains
# 2. Sign in at sourcegraph.com/cody (free)
# 3. Open your repo, Cmd/Ctrl+L:
#    "Explain the request lifecycle from route to DB"
# 4. Click the cited files to verify the retrieval

Three minutes to your first grounded answer about your own code.

PeaBox fit

Cody pairs naturally with a PeaBox AI LLM Workbench loop — pick two models, ask each Cody the same ten repo questions, score which retrieval-plus-model combo actually cites the right files. Save the winning prompts in Prompt Library. And when Cody proposes a non-trivial edit, route it through CodeProof-AI — confident retrieval is still fallible retrieval.

Cody is the assistant for when your codebase is too big to fit in anyone’s head — it doesn’t guess, it goes and looks, and that’s worth paying attention to.