How to Use Claude Code in VS Code — Complete Setup Guide

You use VS Code for most of your development work, and you want Claude Code right there alongside your editor — not in a separate terminal window you keep alt-tabbing to. The Claude Code VS Code extension makes that possible.

This guide walks you through installation, connection, and the workflow tips that make VS Code + Claude Code genuinely better than either tool alone.

This is part of our complete Claude Code Beginner’s Guide.


TL;DR

  • Claude Code has an official VS Code extension that embeds it inside your editor
  • You still need Claude Code installed on your system first — the extension connects to it, not replaces it
  • Installation takes under two minutes from the VS Code Extensions marketplace
  • You get a Claude Code panel, inline code actions, and terminal integration all in one place
  • The best workflow combines the extension panel for conversation with the terminal for longer sessions

Before You Start

The VS Code extension is a connector — it links VS Code to Claude Code, which must already be installed on your computer. If you haven’t installed Claude Code yet, do that first:

You’ll also need:

  • VS Code** version 1.90 or later (Help → About to check)
  • A paid Anthropic account (Pro plan at $20/month minimum) — same account you use for the CLI

Step 1: Install the Extension

Open VS Code and click the Extensions icon in the left sidebar — it looks like four squares with one pulled away. Or press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac).

In the search bar at the top of the Extensions panel, type:


Claude Code

Look for the extension published by Anthropic. The publisher name appears below the extension title. Click Install.

VS Code Extensions panel showing the Claude Code extension by Anthropic with the Install button visible

The extension installs in a few seconds. VS Code may ask you to reload the window — click Reload if prompted.

⚠️ Warning: There are third-party extensions with similar names. Make sure you install the one published by Anthropic specifically. Check the publisher name before clicking Install.


Step 2: Open the Claude Code Panel

After installing, a new Claude Code icon appears in your left sidebar (Activity Bar). Click it to open the Claude Code panel.

VS Code left sidebar showing the Claude Code icon between the Explorer and Search icons

The first time you open it, the panel will show a login prompt or a status indicator. If Claude Code is already authenticated on your system (because you’ve used the CLI before), the extension will detect this automatically and connect without requiring you to log in again.

If you see a “Not authenticated” message:

  1. Click Sign In in the panel
  2. A browser window opens — log in with your Anthropic account
  3. Return to VS Code — the panel will refresh and show the Claude Code interface

Step 3: Verify the Connection

Once connected, the Claude Code panel shows a text input at the bottom and your project context at the top. You’ll see the name of the folder you have open in VS Code.

Type a simple test message:


What files are in this project?

Claude Code should respond with a summary of your project files — the same response you’d get in the CLI. If it does, the extension is connected and working.

VS Code with the Claude Code panel open on the right showing a conversation with a file summary response


Step 4: Use Inline Code Actions

One of the extension’s most useful features is inline code actions — the ability to select code in your editor and ask Claude Code about it directly.

To use it:

  1. Highlight any block of code in your editor
  2. Right-click to open the context menu
  3. Look for Claude Code options — you’ll see choices like “Explain this code”, “Fix this code”, and “Add tests”

VS Code editor with code selected and the right-click context menu open showing Claude Code options

Clicking any of these sends the selected code plus your chosen action to Claude Code and opens the panel with the response. You don’t have to copy, paste, or switch windows.

💡 Pro Tip: You can also trigger Claude Code actions with a keyboard shortcut. Open the VS Code Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and type “Claude Code” to see all available commands and their shortcuts.


Step 5: Use the Integrated Terminal Alongside the Extension

The extension panel is great for questions, explanations, and targeted edits. For longer sessions — where Claude Code is running a complex task across many files — the integrated terminal often gives you a clearer view of what’s happening.

VS Code has a built-in terminal. Open it with Ctrl+\` (backtick) or via View → Terminal.

In the terminal, navigate to your project and run:


# Start a full Claude Code CLI session inside VS Code's terminal
claude

Now you have both running at the same time:

  • The extension panel for quick questions and inline actions
  • The terminal session for full agentic tasks with complete output visibility

They both connect to the same Claude Code installation and the same Anthropic account. You can use whichever fits the task.

VS Code with the Claude Code extension panel on the right side and the integrated terminal open at the bottom, both active simultaneously


Step 6: Configure the Extension (Optional)

The extension has a small set of settings you can adjust. Open VS Code Settings with Ctrl+, (Cmd+, on Mac) and search for “Claude Code”.

Useful settings to know:

Claude Code: Auto Open Panel — When enabled, the Claude Code panel opens automatically when you open a project. Helpful if you use Claude Code constantly; annoying if you only use it occasionally.

Claude Code: Show Inline Suggestions — Toggles whether Claude Code shows inline hints in your editor. Some developers prefer a clean editor and keep all interaction in the panel.

Claude Code: Terminal Path — If you have Claude Code installed in a non-standard location, point the extension to the right binary here.


The Best VS Code + Claude Code Workflow

After using both tools together, here’s the workflow pattern that works best:

For understanding code: Use the extension panel. Select code, right-click, choose “Explain this code.” Fast and doesn’t interrupt your flow.

For targeted fixes: Select the problematic code, right-click, choose “Fix this code.” Claude Code proposes the fix directly in the panel; you accept or reject.

For writing new features or refactoring: Switch to the terminal. Run claude and have a full conversation. You get better visibility into what Claude Code is doing across multiple files, and you can approve each change step by step.

For reviewing Claude Code’s changes: Use VS Code’s built-in Source Control panel (Ctrl+Shift+G). Claude Code’s file edits show up as git diffs here, so you can review them the same way you’d review any code change before committing.

💡 Pro Tip: Create a VS Code workspace that includes your project folder and open it before starting Claude Code sessions. Claude Code indexes the workspace and has better awareness of your project structure than if you open individual files.


Common Problems and Fixes

“Claude Code not found” in the extension panel

The extension can’t find the claude binary. This usually means Claude Code isn’t installed, or it’s installed in a location the extension can’t find.

First, verify Claude Code is installed by running claude --version in your terminal. If that works, the issue is the extension’s binary path. Go to VS Code Settings → search “Claude Code” → set Claude Code: Terminal Path to the full path of your claude binary.

To find the full path:


# Find the exact location of the claude binary
which claude

Copy the output (e.g., /home/yourname/.local/bin/claude) and paste it into the extension setting.

Extension panel is blank after install

Close VS Code completely and reopen it. If still blank, try uninstalling and reinstalling the extension, then reloading the window.

Inline code actions don’t appear in the right-click menu

Make sure you have code selected (not just a cursor position) before right-clicking. Also check that the extension is enabled for the current workspace — click the Extensions icon, find Claude Code, and confirm it shows “Enabled” rather than “Disabled (Workspace)”.

The extension panel works but file edits don’t apply

This can happen when VS Code and the Claude Code session are pointing at different versions of a file. Save all open files (Ctrl+S / Cmd+S) before starting a Claude Code session, and make sure auto-save is enabled in VS Code settings.

Extension shows “outdated version” warning

Update Claude Code using the appropriate method for your install. See How to Update Claude Code for the right command.


Key Takeaways

  • The Claude Code VS Code extension embeds Claude Code inside your editor — you still need Claude Code installed on your system first
  • Install it from the VS Code Extensions marketplace — search “Claude Code” and pick the Anthropic publisher
  • The extension panel is best for quick questions and inline code actions
  • The integrated terminal (claude command) is best for longer, multi-file agentic sessions
  • Use both at the same time for the best workflow — they connect to the same installation
  • Review Claude Code’s changes via VS Code’s Source Control panel before committing

Next Steps

Return to the Claude Code Beginner’s Guide for the full learning path.