ScriptsApr 7, 2026·3 min read

Cody — AI Coding Assistant by Sourcegraph

AI coding assistant with full codebase context. Cody searches your entire repo, reads relevant files, and answers questions or generates code with deep understanding.

SC
Script Depot · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

  1. Install the VS Code extension: Search "Cody" in Extensions
  2. Sign in with Sourcegraph account (free tier available)
  3. Start chatting about your codebase or use inline completions

What is Cody?

Cody is an AI coding assistant by Sourcegraph that has deep understanding of your entire codebase. Unlike simple autocomplete tools, Cody uses Sourcegraph's code intelligence to search across your whole repository, read relevant files, and provide answers grounded in your actual code — not generic patterns.

Answer-Ready: Cody is Sourcegraph's AI coding assistant with full codebase context. It searches your entire repository using code intelligence, reads relevant files, and provides accurate answers and code generation grounded in your actual codebase. Works with Claude, GPT, and Gemini.

Best for: Developers working on large codebases who need context-aware AI assistance. Works with: VS Code, JetBrains, Neovim, web. Setup time: Under 3 minutes.

Core Features

1. Full Codebase Context

Cody searches your entire repository to answer questions:

You: "How does authentication work in this project?"
Cody: Searches repo → finds auth middleware, JWT config, user model
      → explains the full auth flow with file references

2. Code Search Integration

Powered by Sourcegraph's code intelligence:

You: "Where is the payment processing logic?"
Cody: Found in 3 files:
  - src/services/payment.ts (main logic)
  - src/api/routes/checkout.ts (API endpoint)
  - src/workers/payment-processor.ts (async processing)

3. Inline Completions

Context-aware autocomplete as you type:

// Cody knows your project's patterns
function createUser(data: CreateUserInput) {
  // Cody suggests based on your existing code patterns,
  // not generic boilerplate
}

4. Multi-Model Support

Model Provider
Claude Sonnet/Opus Anthropic
GPT-4o OpenAI
Gemini 2.5 Google
Mixtral Mistral

5. Commands

Built-in commands for common tasks:

Command Action
/explain Explain selected code
/edit Edit code with instructions
/test Generate unit tests
/doc Add documentation
/smell Find code smells

6. Context Sources

Cody pulls context from:
├── Current file
├── Open files in editor
├── Repository-wide search
├── @-mentions (specific files/symbols)
└── Sourcegraph code graph (enterprise)

7. @-Mentions for Precise Context

You: @src/auth/middleware.ts explain the rate limiting logic
You: @UserService how does user deletion cascade?

Cody Free vs Pro vs Enterprise

Feature Free Pro Enterprise
Chat Unlimited Unlimited Unlimited
Autocomplete 500/mo Unlimited Unlimited
Models Claude Sonnet All models All + custom
Context Local repo Local repo Multi-repo

FAQ

Q: How does Cody compare to GitHub Copilot? A: Copilot focuses on inline completions. Cody adds full codebase search and chat with deep repo understanding. Cody also supports multiple LLM providers.

Q: Does my code leave my machine? A: Chat queries are sent to LLM providers. Enterprise plan supports self-hosted deployment with no data leaving your network.

Q: Can it work with monorepos? A: Yes, Sourcegraph's code intelligence is designed for large monorepos and multi-repo setups.

🙏

Source & Thanks

Created by Sourcegraph. Licensed under Apache 2.0.

sourcegraph/cody — 5k+ stars

Discussion

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

Related Assets