sourcegraph cody
**Sourcegraph Cody** is an **AI coding assistant that differentiates itself through deep codebase context awareness, powered by Sourcegraph's code search and intelligence platform** — unlike assistants that only see the currently open file, Cody connects to Sourcegraph's code graph to search, read, and understand your entire codebase (including dependencies) before generating answers, making it uniquely capable of answering architectural questions and making contextually accurate suggestions across large codebases.
**What Is Sourcegraph Cody?**
- **Definition**: An AI coding assistant (VS Code extension and web interface) built on top of Sourcegraph's code intelligence platform — combining LLM capabilities with Sourcegraph's deep code search, navigation, and understanding to provide context-rich AI assistance grounded in your actual codebase.
- **The Code Graph**: Sourcegraph indexes your entire codebase (including repositories, dependencies, and documentation) into a searchable code graph — Cody queries this graph to find relevant code before generating responses, ensuring answers are grounded in your actual implementation rather than generic suggestions.
- **Context Window Optimization**: Cody uses intelligent context retrieval to fill the LLM's context window with the most relevant code snippets — not just the open file, but related functions, type definitions, test examples, and documentation from across the repository.
**Key Features**
- **Codebase-Aware Chat**: "Where is the authentication middleware defined?" — Cody searches the entire repository, finds `src/middleware/auth.ts`, reads it, and provides an informed answer with code references.
- **Autocomplete**: Inline code suggestions powered by codebase context — suggestions reference actual function signatures, types, and patterns from your project rather than generic patterns.
- **Commands**: Built-in commands — `/doc` (generate documentation), `/test` (generate unit tests), `/fix` (fix errors), `/explain` (explain selected code) — all leveraging full codebase context.
- **Multi-Repo Understanding**: For organizations with microservices or monorepos, Cody understands cross-repository dependencies and API contracts.
**Cody vs. Other AI Assistants**
| Feature | Cody | GitHub Copilot | Cursor | Continue |
|---------|------|---------------|--------|----------|
| Codebase context | Deep (Sourcegraph code graph) | File-level + neighbors | Codebase-indexed | Configurable |
| Code search | Sourcegraph search (best-in-class) | GitHub search | Local indexing | Basic |
| Cross-repo understanding | Yes (multi-repo) | Limited | Single repo | Single repo |
| Architectural questions | Excellent (searches codebase) | Basic | Good | Basic |
| Enterprise code intelligence | Sourcegraph platform | GitHub | None | None |
| Model choice | Multiple (Claude, GPT, Gemini) | GPT-4o | Multiple | Any (BYO) |
**Why Context Matters**: The difference between a code assistant that sees 1 file and one that sees 1,000 files is the difference between "here's a generic function" and "here's a function that matches your existing patterns, uses your actual types, and follows your team's conventions."
**Sourcegraph Cody is the context-richest AI coding assistant available** — leveraging Sourcegraph's industry-leading code search and intelligence platform to provide AI assistance that truly understands your entire codebase, making it the strongest choice for large organizations with complex, multi-repository codebases where contextual accuracy matters most.