Context-aware code assistant for faster, safer development
Sourcegraph Cody is a code-assistant that answers code questions, generates and refactors code using repo-aware context. It’s best for engineers and teams who need on-codebase, up-to-date assistance rather than generic LLM completions, and pricing ranges from a free tier with limited queries to paid Team and Enterprise plans for private repo scale.
Sourcegraph Cody is a repo-aware code assistant that uses your codebase context to answer questions, generate code, and help with refactors. It connects to repositories, indexes code, and runs natural-language queries against that indexed context to return precise, source-grounded answers. Cody’s key differentiator is its repository and code-search integration, making it suited for engineering teams, senior developers, and code reviewers. Available as a freemium offering with paid Team and Enterprise options, Sourcegraph Cody’s pricing is accessible for small teams but scales for enterprise deployments in the code assistants category.
Sourcegraph Cody is an AI-powered code assistant built by Sourcegraph and positioned as a repo-aware complement to general-purpose LLM copilots. Launched as part of Sourcegraph’s push into AI-enhanced developer tooling, Cody leverages Sourcegraph’s global code index and code intelligence to ground answers in a customer’s actual repositories. The core value proposition is reducing context-lookup time and providing traceable, citation-backed responses about code, dependencies, and project architecture, rather than hallucinated free-form answers. Cody runs alongside Sourcegraph’s code search and code intelligence features to serve context-specific guidance inside code editors and the browser.
Cody’s feature set centers on repository grounding, conversational coding, and local/private model options. It supports context windows that reference your indexed files and returns answer snippets with file links and line references; it can search code, cite the precise file and lines it used, and open the referenced file in Sourcegraph. Cody integrates with VS Code and JetBrains IDEs to provide inline suggestions, code generation, and refactors inside the editor. It offers chat-style sessions that preserve conversational context and can run automated code transformations using saved prompts. Administrators can deploy Cody to use hosted Sourcegraph’s cloud models or connect to private models, and Enterprise customers can opt for self-hosted deployments for data controls.
Pricing includes a free tier that lets individuals and small teams experiment with Cody via Sourcegraph Cloud with limits on query volume and functionality. Sourcegraph’s published pricing lists paid Team plans at a per-seat monthly rate and Enterprise pricing by quote for large, self-hosted deployments with SSO and compliance features. The Team tier unlocks private repo context, more queries, and IDE integrations; Enterprise adds self-hosting, dedicated support, and high-volume indexing. Exact per-seat prices and enterprise quotes are provided on Sourcegraph’s site and via sales, with a free tier intended for evaluation and paid tiers for production use.
Software engineers, developer managers, and code reviewers use Cody for concrete workflows: a senior backend engineer uses Cody to answer complex dependency and call-graph questions across 50+ microservices, while a QA engineer uses it to generate targeted unit-test skeletons and reproduce steps with file citations. DevOps teams use self-hosted Cody to run security triage queries against internal repos. Compared with GitHub Copilot and other copilots, Cody’s main advantage is repository grounding and file-citation integration, while competitors may provide broader completion models but less repo-aware traceability.
Three capabilities that set Sourcegraph Cody apart from its nearest competitors.
Current tiers and what you get at each price point. Verified against the vendor's pricing page.
| Plan | Price | What you get | Best for |
|---|---|---|---|
| Free | Free | Limited queries and community Cloud access, no private repo indexing | Individuals evaluating Cody |
| Team | $10 per user/month | Per-user access, private repo context, IDE integrations enabled | Small engineering teams needing private context |
| Enterprise | Custom | Self-hosting, SSO, high-volume indexing, dedicated support | Large orgs with compliance needs |
Copy these into Sourcegraph Cody as-is. Each targets a different high-value workflow.
You are Sourcegraph Cody, a repo-aware code assistant. Role: locate the function named <FUNCTION_NAME> in the current repository and produce a concise, source-grounded summary. Constraints: 1) Use only information from the repository files and comments; do not invent behavior. 2) Keep the summary under 120 words. 3) Reference exact file path(s) and line ranges where the function is defined. Output format: bullet list with: - One-line purpose, - Inputs and types (from code), - Outputs/return types, - Side effects (I/O, DB, env), - Complexity or notable algorithms, - Example call with expected result. Example: file path: src/service/user.go:45-92.
You are Sourcegraph Cody, a repo-aware testing assistant. Role: locate the function <FUNCTION_NAME> and generate a ready-to-run unit test scaffold using the project's existing test framework. Constraints: 1) Use the repository's preferred testing library (detect from repo files). 2) Include 4 focused test cases (happy path, edge case, error case, boundary). 3) Provide minimal mocks/stubs using existing interfaces in repo. Output format: for each test case give: test name, short purpose, and full code snippet ready to paste into tests/<module>_test.<ext>. Example: show a Go test file using testify if repo uses testify.
You are Sourcegraph Cody, a senior refactorer with repo access. Role: scan the repository for up to <MAX_RESULTS=5> instances of duplicated or near-duplicate code related to the selected module/path <TARGET_PATH>. Constraints: 1) Report duplicates above a similarity threshold of <SIMILARITY=80%>. 2) For each group include file paths, line ranges, and a 1-line diff summary. 3) Recommend one concrete refactor with code sketch (function/extract/template) and migration steps. Output format: numbered list of duplicates with: {group id, similarity %, files and ranges, one-line diff, refactor proposal with 1–3 code snippets and a one-paragraph migration plan}.
You are Sourcegraph Cody, a CI-aware engineer with repository context. Role: propose and produce a new CI job that runs only fast unit tests for changed packages. Constraints: 1) Target the repository's CI system (detect .github/workflows, .gitlab-ci.yml, etc.). 2) Limit runtime to under <MAX_MINUTES=10> using caching and parallelism. 3) Provide a small YAML snippet to insert and specify paths, cache keys, and matrix if applicable. Output format: brief rationale (2–3 sentences), YAML job snippet ready to paste, and a 3-step rollout plan to enable and monitor the job.
You are Sourcegraph Cody acting as a Senior Security Engineer. Role: triage a reported vulnerability for package <VULN_PACKAGE>@<VULN_VERSION> across this monorepo. Multi-step instructions: 1) List all occurrences (file paths, import/usage locations, version ranges) and identify the most exposed services. 2) For each occurrence provide a one-line exploitability score (Low/Med/High) and justification. 3) Propose code changes or dependency updates with exact file edits or patch snippets, required tests, and rollback plan. 4) Produce a prioritized PR template including title, description, changelog entry, test plan, and risk note. Output format: CSV-style prioritized list plus one full PR template text. Example row: services/api/main.go, import: [email protected], High.
You are Sourcegraph Cody acting as a Lead Backend Engineer and release coordinator. Role: produce a step-by-step migration plan for upgrading shared client library <LIB_NAME> from vX to vY across all services in the repo. Multi-step requirements: 1) Discover all consumers and list exact call sites with file paths. 2) For each breaking change, provide one-line code transform examples and a suggested automated codemod (with pseudocode or regex). 3) Define test matrix, rollout strategy (canary %, order), monitoring checks, and rollback steps. 4) Provide example commit messages and 3 example PR titles/descriptions. Output format: ordered checklist with sections: discovery, code changes (with snippets), codemod outline, test matrix, rollout, monitoring, rollback, example commits/PRs.
Choose Sourcegraph Cody over GitHub Copilot if you need repository-grounded answers and file-citation traceability for enterprise codebases.
Head-to-head comparisons between Sourcegraph Cody and top alternatives: