← Blog

Claude Integration with VS Code: Every Option in 2025

2026-09-08 · 5 min read · SubToAPI Team

Claude integration with VS Code comes in three practical flavors: Anthropic's official Claude extensions for VS Code, the Claude Code CLI running inside the integrated terminal, and custom integrations built on top of the Claude API for teams that need something the default tools don't offer. Which one you want depends on whether you need inline chat, agentic file editing, or a repeatable pipeline you can wire into your own scripts.

This guide walks through all three, how to set each one up, and where a lightweight API wrapper like SubToAPI fits if you're building custom tooling around Claude rather than just chatting with it.

Option 1: The official Claude extension

Anthropic publishes a Claude extension for VS Code that adds a chat sidebar, inline code suggestions, and the ability to reference open files directly in a conversation. Installation is standard:

  1. Open the Extensions panel (Cmd+Shift+X / Ctrl+Shift+X)
  2. Search "Claude"
  3. Install the official Anthropic extension
  4. Sign in with your Claude account when prompted

Once installed, you get a chat panel where you can ask questions about the current file, request refactors, or paste error messages and get context-aware fixes. It's the fastest path to "Claude inside my editor" for individual developers who don't need to script anything.

Option 2: Claude Code in the integrated terminal

Claude Code is Anthropic's agentic coding tool, and it runs fine inside VS Code's built-in terminal, which is how a lot of developers actually prefer to use it — full shell access, git awareness, and the ability to run tests or build commands as part of the same session.

npm install -g @anthropic-ai/claude-code
claude

Run it from your project root, and it operates on your actual files: editing multiple files across a change, running your test suite, and iterating based on failures. Because it lives in the terminal, it composes naturally with everything else in your VS Code workflow — you can flip between the chat extension for quick questions and Claude Code for multi-file tasks without leaving the editor.

Option 3: Building custom VS Code tooling on the Claude API

The official extension and Claude Code cover most day-to-day use, but some teams want more: a custom extension that calls Claude with a specific system prompt for code review, a snippet generator tied to your internal style guide, or a CI-adjacent tool that runs inside a VS Code task. For that, you're writing directly against Claude's API — and this is where the setup gets less standardized, because raw API access means managing API keys, handling streaming responses, and building your own usage tracking.

If you already have a Claude subscription and want to expose it as a normal HTTPS API for this kind of tooling, SubToAPI turns your existing access into an application API key (sub_live_...) with standard REST endpoints, so a custom VS Code extension or task runner can call Claude the same way it would call any other API:

const response = await fetch('https://api.subtoapi.app/v1/messages', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.SUBTOAPI_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'claude-sonnet-4-5',
    max_tokens: 1024,
    messages: [
      { role: 'user', content: 'Review this diff for obvious bugs:\n' + diffText }
    ]
  })
});

This is a natural fit for a VS Code extension that runs on save, on commit, or as a custom command palette entry — you're not building auth flows, you're calling an endpoint. Streaming responses (useful for showing partial output as Claude writes a code review or explanation) work the same way any streaming API integration would; see /docs/streaming for the format. Tool use — letting Claude call functions you define, like "run linter" or "fetch file contents" — is documented at /docs/tools if your extension needs Claude to take actions rather than just return text.

Choosing the right setup

None of these are mutually exclusive. A common setup is the official extension for daily chat, Claude Code for larger refactors, and a small custom extension (backed by the API) for something specific to your team's workflow — a commit message generator, a test-case suggester, or a doc-comment writer that follows your house style.

Getting started with a custom integration

If you're going the custom route, the pattern is usually:

  1. Get API access — either directly from Anthropic or through SubToAPI if you want your Claude subscription turned into a key in a few minutes (see /signup)
  2. Send requests using the Messages format documented at /docs/messages
  3. Wire the response into a VS Code extension command, task, or keybinding
  4. Add streaming if you want partial output shown live, per /docs/streaming

Pricing for a wrapper layer matters if you're doing this for a team: SubToAPI's plans start at €9/month for solo use and scale to €19 or €49 per seat for Team and Scale tiers with shared usage visibility — worth checking against /pricing before you commit to a team-wide rollout.

Questions

Does the official Claude VS Code extension require a paid Claude subscription? Yes, it authenticates with your Claude account and uses the same access tier as your subscription — it doesn't work with a free-tier account with no message allowance.

Can I use Claude Code and the chat extension at the same time? Yes. They don't conflict — Claude Code runs in the terminal for file-editing tasks while the extension's sidebar handles quick chat, and many developers use both in the same session.

Do I need a full API integration if I just want autocomplete-style suggestions? No — the official extension already covers inline suggestions and chat. Custom API integrations make sense when you need a specific workflow (like automated code review on save) that the default extension doesn't support.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →