Installing Cody in VS Code


In this guide, you will:

  • Install the VS Code extension
  • Connect the extension to your Sourcegraph Enterprise instance or account


  • A Sourcegraph instance with Cody enabled on it OR a account.

If you haven't yet done this, see Step 1 on the following pages:

Install the VS Code extension

You can install Cody in VS Code in 2 ways:

  • Click the Extensions icon on the VS Code activity bar
  • Search for "Sourcegraph Cody"
  • Install the extension directly to VS Code


Connect the extension to Sourcegraph

Next, you'll open the VS Code extension and configure it to connect to a Sourcegraph instance (either an enterprise instance or

For Sourcegraph Enterprise users:

Log in to your Sourcegraph instance and go to settings / access token (https://<your-instance><your-instance>/settings/tokens). From here, generate a new access token.

Then, you will paste your access token and instance address in to the Cody extension.

For users:

Click Continue with in the Cody extension. From there, you'll be taken to, which will authenticate your extension.

(Optional) Enable code graph context for context-aware answers

You can optional configure code graph content, which gives Cody the ability to provide context-aware answers. For example, Cody can write example API calls if has context of a codebase's API schema.

Get started with Cody

You're now ready to use Cody! See our recommendations for getting started with using Cody.


You're now up-and-running with your very own AI code asisstant! 🎉