Skills2026年4月2日·1 分钟阅读

Cody by Sourcegraph — AI with Full Codebase Context

AI code assistant that understands your entire codebase. Chat, completions, edits, and deep search across repos. Enterprise-grade.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 66/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Community
入口
sourcegraph-cody.md
先审查命令
npx -y tokrepo@latest install c00d464a-5aa1-44be-a473-e96b0a3cd992 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
Cody uses Sourcegraph's code graph to give AI full codebase context for chat, completions, and cross-repo search.
§01

What it is

Cody is Sourcegraph's AI code assistant that differentiates itself by understanding your entire codebase, not just the open file. It uses Sourcegraph's code intelligence platform to build a semantic understanding of cross-file dependencies, function call chains, and project structure.

Cody is available as an extension for VS Code, JetBrains, Visual Studio, Neovim, and Emacs. It targets teams working on large codebases where generic AI assistants produce incomplete or incorrect answers because they lack project-wide context.

§02

How it saves time or tokens

Most AI coding assistants only see the current file plus a few open tabs. When you ask about cross-file behavior (how a function is used across the codebase, what calls a specific API), they guess. Cody pulls relevant code from across your entire repository using Sourcegraph's indexing, giving the LLM the right context before it responds.

The token estimate for this workflow is approximately 1,453 tokens. By providing precise context rather than dumping entire files, Cody reduces both token usage and hallucination rates.

§03

How to use

  1. Install the Cody extension:
# VS Code
code --install-extension sourcegraph.cody-ai

# Or search 'Cody' in the Extensions panel (Ctrl+Shift+X)
  1. Sign in with your Sourcegraph or GitHub account.
  1. Open any project. Cody automatically indexes your codebase and is ready for chat, completions, and inline edits.
§04

Example

# In Cody chat within VS Code:

You: How is the `processPayment` function called across the codebase?

Cody: `processPayment` is called in 3 places:
1. `src/api/orders.ts:142` -- after order validation
2. `src/webhooks/stripe.ts:89` -- on payment intent confirmation
3. `tests/integration/payment.test.ts:45` -- test suite

The function accepts a PaymentIntent object and returns
a TransactionResult. The Stripe webhook path handles
retries via idempotency keys.

Cody also supports inline edits:

# Select code, press Ctrl+Shift+E, type instruction:
'Add error handling for the case where payment provider is unreachable'
§05

Related on TokRepo

§06

Common pitfalls

  • Cody's full codebase context feature requires a Sourcegraph instance or Sourcegraph Cloud account. Without it, Cody falls back to local file context only.
  • Enterprise self-hosted deployments need Sourcegraph running alongside Cody. The setup is more involved than a simple extension install.
  • Free tier has usage limits on chat and completions. Check Sourcegraph's pricing page for current quota details.

常见问题

How does Cody differ from GitHub Copilot?+

Copilot focuses on inline code completions using the current file and open tabs as context. Cody uses Sourcegraph's code graph to pull context from across your entire codebase, making it stronger for cross-file questions and large monorepos.

Does Cody work with private repositories?+

Yes. Cody works with any repository you have access to. For full codebase context, connect Cody to a Sourcegraph instance (cloud or self-hosted) that indexes your private repos.

What LLMs does Cody use?+

Cody supports multiple LLM providers including Claude, GPT-4, and Gemini. Enterprise users can configure which models are available. The LLM handles generation while Sourcegraph handles context retrieval.

Is Cody free?+

Cody has a free tier with limited chat and completion usage. Paid plans (Pro and Enterprise) increase quotas and add features like admin controls and SSO. Check sourcegraph.com for current pricing.

Can I use Cody in Neovim?+

Yes. Cody has official support for VS Code, JetBrains IDEs, Visual Studio, Neovim, and Emacs. The Neovim plugin provides chat and completions with the same codebase context features.

引用来源 (3)
🙏

来源与感谢

Created by Sourcegraph. Licensed under Apache-2.0.

Cody — Available on VS Code, JetBrains, Visual Studio, Neovim, Emacs

Thanks to Sourcegraph for building an AI assistant that truly understands codebases at scale.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产