Cody
What it does
Cody is Sourcegraph’s enterprise AI code assistant, tightly integrated with the Sourcegraph code intelligence platform. Unlike most AI coding tools that rely on the current open file or a sliding window of recent edits, Cody retrieves context from your entire codebase using the Sourcegraph graph—a structured index of repository relationships, cross-references, definitions, and usage patterns. It provides both chat-based Q&A and inline autocomplete, but the core differentiator is its ability to answer questions like “How does this function get called?” or “What does this API endpoint depend on?” by walking the actual call graph, not just guessing from tokens.
Cody achieves this by embedding code snippets and using Sourcegraph’s static analysis (lexical + deep reference indexing) to ground responses in real symbols and their connections across files, repos, and even service boundaries (when configured with multiple repositories). The autocomplete attempts to leverage the same context, but its latency tradeoff is tuned for accuracy over speed—making it a weaker pure autocomplete tool but a strong teammate for complex, multi-file reasoning.
Who it’s for
Cody is designed for engineering organizations that already manage a non‑trivial code footprint and have a Sourcegraph instance (self‑hosted or cloud) in place. Typical adopters are teams with monorepos spanning hundreds of thousands of files, microservice architectures where a single feature touches multiple services, or legacy systems with little documentation where onboarding requires reading cross‑module dependencies.
It is not for solo developers who only need instant completions. It is for teams that value “how does this work” over “what should I type next.” Engineering leads, platform teams, and SREs often use Cody as a documentation explorer. New hires in large codebases find it useful for directed learning. Security teams sometimes repurpose it to trace data flows across repos.
What works
- Context depth. When Sourcegraph indexing is up to date and covers the relevant repositories, Cody can retrieve references across package boundaries, jump through dependency graphs, and even resolve transitive imports. Answers to architectural questions (e.g., “How does the payment service handle idempotency?”) are often accurate enough to replace digging through five files manually.
- Custom commands. Teams can define site‑specific “Cody commands” that prompt with a predefined retrieval scope or output format (e.g., “summarize this commit’s impact across services”). This reduces boilerplate for recurring tasks like code review preparation.
- Language support. Go, TypeScript, Python, Java, and Rust are first‑class citizens; C++, Ruby, and Kotlin are well‑supported. Less common languages see degraded context because Sourcegraph’s static analyzers are thinner.
- Security stance. Because queries are executed against your Sourcegraph instance (private by default), sensitive code never leaves your network in self‑hosted mode. For regulated industries this is a hard requirement.
What breaks
- Latency. Context retrieval is not free. A chat query that triggers a full graph walk can take 3–10 seconds before the first token appears. Autocomplete is similarly delayed—often 800–1500 ms before suggestions appear. This makes Cody frustrating for rapid inline editing where Copilot would have already finished the line.
- Setup overhead. Cody is worthless without a healthy Sourcegraph instance. Indexing a large monorepo demands significant compute and memory; misconfigured analyzers produce stale or partial context, leading to hallucinations disguised as specific references.
- Context window limitations. Even with deep retrieval, Cody’s prompt is constrained by the underlying LLM’s context window (typically 32K–128K tokens in 2026). Very long dependency chains can exceed this, causing the model to truncate or lose the thread.
- Fine‑tuning friction. Cody does not allow per‑team fine‑tuning of the base model. If your codebase uses a highly custom DSL or extremely unconventional patterns, the model may generate plausible‑looking code that doesn’t compile.
- Autocomplete quality in dynamic languages. For Python and JavaScript, the autocomplete often suggests boilerplate that ignores recent runtime changes because the static index lags behind the actual state. It is noticeably weaker than purpose‑built autocomplete engines for these languages.
Pricing reality
Cody is not sold standalone. As of 2026, it is a feature of Sourcegraph Enterprise. Pricing varies significantly based on deployment model (self‑hosted vs. managed cloud), number of active users, and total code volume indexed.
- Free tier. Sourcegraph offers a limited single‑user Cody experience with a capped context index (usually one small repository) and rate‑limited LLM calls. Suitable for evaluation, not production.
- Enterprise license. Typical published starting points are around $19/user/month for the basic “Code Search + Cody” bundle, but larger organizations with multi‑repo indexing, custom embeddings, or dedicated compute quickly move to custom pricing. Expect to negotiate a contract—public price lists do not exist.
- Infrastructure costs. If self‑hosting, you must budget for servers (GPU recommended for low‑latency LLM inference) and ongoing maintenance for the Sourcegraph instance. These costs can exceed the per‑seat fee.
Honest comparison
- vs. GitHub Copilot. Copilot’s autocomplete wins handily: faster, less intrusive, better at single‑line completions. Cody wins only when a question requires repository‑wide context. If your team does not use Sourcegraph, Copilot is simpler.
- vs. Cursor. Cursor (with Claude 4 or GPT‑5) offers multi‑file editing and agent‑like workflows that sometimes rival Cody’s context depth, but it lacks the structured graph queries. Cursor’s “composer” is better for rewriting a function; Cody is better for understanding why that function exists.
- vs. Tabnine Enterprise. Tabnine offers strong privacy and local models, but its context is shallow—it rarely spans more than a few open files. Cody’s graph is strictly superior for cross‑repo analysis.
- vs. JetBrains AI Assistant. JetBrains’ assistant is improving rapidly and integrates deeply with IDE symbols, but it does not have Sourcegraph’s external index. Cody is preferred when the codebase spans multiple languages or repos.
When to use
Use Cody when your team already relies on Sourcegraph for code search and you need AI responses that are grounded in actual code structure rather than token probability. It shines in discovery tasks: asking “What does this module depend on?” or “Show me all callers of function X across services.” For rapid autocomplete‑driven development, choose a faster tool. For understanding and navigating a large, multi‑language codebase, Cody is one of the best enterprise options available in 2026—provided you can stomach the setup cost and latency.
Last verified: 2026-06-08 by kernel.