IPcost

How to use Claude Code with VS Code?

Nicolas Nicolas,


Claude Code is Anthropic's AI assistant designed for developers. Available directly in VS Code via an official extension, it allows you to generate, modify, analyse and debug code without leaving your editor. Since 2025, the native extension is the recommended way to use Claude Code in VS Code — here is how to install it and get the most out of it.

Prerequisites before installation

Before installing the Claude Code extension, check the following:

  • VS Code 1.98.0 or higher — earlier versions are not compatible with the extension
  • An Anthropic account — you will sign in when you first open the extension. Claude Code requires a Claude Pro, Max, Team or Enterprise subscription
  • If you use Amazon Bedrock or Google Vertex AI as a provider, specific configuration in settings.json is required

Install the Claude Code extension

Installation takes just a few seconds directly from VS Code:

  • Open VS Code and press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac) to open the Extensions panel
  • Search for "Claude Code" in the search bar
  • Install the extension published by Anthropic — check the publisher carefully to avoid unofficial third-party extensions
  • If the Spark icon does not appear after installation, restart VS Code or run "Developer: Reload Window" from the Command Palette
Good to know: the extension automatically includes the Claude Code CLI (command-line interface). You do not need to install the CLI separately — it is accessible directly from VS Code's integrated terminal for advanced features.

Opening Claude Code in VS Code

Once the extension is installed, the Spark icon (⚡) identifies Claude Code throughout the VS Code interface. Several ways to access it:

  • Editor Toolbar: click the Spark icon in the top-right corner of the editor — only visible when a file is open
  • Activity Bar: click the Spark icon in the left sidebar to open the sessions list. Always visible even without a file open
  • Command Palette: Cmd+Shift+P / Ctrl+Shift+P, type "Claude Code" and choose "Open in New Tab"
  • Status Bar: click ✱ Claude Code in the bottom-right corner of the window

When you first open the panel, a guided onboarding checklist appears. Work through each item by clicking "Show me" or dismiss it with the X.

Sending your first prompt

Claude Code automatically sees the file currently open in your editor. To interact:

  • Select code in your file — Claude Code automatically includes this selection in the context of your request
  • Press Option+K (Mac) / Alt+K (Windows/Linux) to insert a @file.ts#5-10 reference to your selection in the prompt
  • Type your request in natural language: "Explain this function", "Fix this bug", "Add unit tests for this class"…

When Claude Code proposes modifying a file, it displays a side-by-side diff comparison of the proposed changes before applying them. You can accept, reject or ask for adjustments.

Permission modes

Claude Code offers three permission modes accessible from the bottom of the prompt box:

ModeBehaviourRecommended use
NormalClaude asks for confirmation before each actionDaily use, precise control
PlanClaude describes what it will do and waits for your approval before making any changesComplex tasks, major refactoring
Auto-acceptClaude makes edits without askingRepetitive tasks, rapid prototyping

Plan mode is particularly useful for significant changes: Claude opens the plan as a Markdown document where you can add inline comments before it starts modifying your code.

Referencing files with @-mentions

To give Claude Code additional context, use @-mentions in the prompt:

  • Type @ followed by the filename to mention it: @auth.ts
  • Add a line range to target a specific section: @auth.ts#10-25
  • Mention an entire folder: @src/components/
  • Use Option+K / Alt+K from a selection to automatically insert the reference

Managing multiple conversations

VS Code allows you to open multiple Claude Code sessions simultaneously — useful for working in parallel on multiple features or workspace folders:

  • Each session maintains its own independent context
  • Open a new conversation with Cmd+N (Mac) / Ctrl+N (Windows/Linux) from the Claude panel
  • Access conversation history from the Spark icon in the Activity Bar
  • Sessions can be opened as separate tabs or windows according to your preferences
Good to know: if you work on a monorepo or microservices project, each workspace folder can have its own Claude Code session with its own context. To customise Claude's behaviour for your project, create a CLAUDE.md file at the root of your repository — Claude Code will read it automatically to adapt its responses to your project, conventions and specific instructions.

Using the CLI from the integrated terminal

The VS Code extension includes the Claude Code CLI, accessible from VS Code's integrated terminal. The CLI offers advanced features not available in the graphical interface:

  • Run claude in the integrated terminal to launch a CLI session
  • Use claude -p "your prompt" for non-interactive requests (print mode)
  • The /terminal-setup command in a session automatically configures the Shift+Enter shortcut for multi-line prompts
  • Switch between the graphical interface and CLI via the extension settings menu

Essential keyboard shortcuts

ActionMacWindows / Linux
Open Extensions panelCmd+Shift+XCtrl+Shift+X
Command PaletteCmd+Shift+PCtrl+Shift+P
Insert @-mention from selectionOption+KAlt+K
Toggle focus editor / ClaudeCmd+EscCtrl+Esc
New conversationCmd+NCtrl+N
Good to know: Claude Code for VS Code also works with Cursor, Windsurf and VSCodium — the installation procedure is identical. For teams using Amazon Bedrock or Google Vertex AI, add the corresponding environment variables in the VS Code settings.json file to configure the alternative provider.