Claude Code × VSCode: The Complete Guide to Installation, Setup, and the Extension

A thorough walkthrough of using Claude Code with VSCode — extension installation, initial configuration, differences from the desktop app, and practical project configuration examples.
代表 / エンジニア
If you've adopted Claude Code as your AI coding assistant, you've probably felt the friction of going back and forth between the terminal and your editor. Read code, modify, check the diff, give more instructions — after enough round trips, "I wish I could stay inside the IDE" becomes a natural thought. Claude Code's VSCode extension is designed to solve exactly that. This article walks through everything you need to get the most out of Claude Code in VSCode: installation, configuration, and practical usage. For an overview of Claude Code itself, see What Is Claude Code? The Complete Guide — worth reading first if you haven't.
The Big Picture of Using Claude Code with VSCode
There are two main ways to use Claude Code in VSCode. The first is running the claude CLI command in VSCode's integrated terminal; the second is installing the official VSCode extension from Anthropic. Both give you Claude Code's capabilities, but the extension delivers an experience more deeply integrated with VSCode's UI.
The extension's biggest feature is that Claude Code's proposed changes are displayed as inline diffs in the editor, which you can Accept or Reject per change. The CLI applies changes directly to files, carrying the risk of missed unintended changes; the extension lets you visually confirm every change before it lands. That alone is worth the adoption, in my view.
Under the hood, the VSCode extension spins up a local MCP server internally (named ide). That MCP server talks to VSCode's editor API to provide diff display, file diagnostics information, editor-context sharing, and so on. Users don't need to think about this, but knowing it helps explain why the extension delivers a richer UI experience than the CLI.
Another benefit of the extension is managing multiple conversations as tabs simultaneously. You could discuss refactoring in one tab while investigating a bug in another. The CLI only supports a single conversation per terminal session, so when running multiple pieces of work in parallel, the extension is overwhelmingly more convenient.
Prerequisites
To use the VSCode extension, you need:
| Item | Requirement |
|---|---|
| VSCode version | 1.98.0 or higher |
| Anthropic account | Claude Pro / Max / Team / Enterprise |
| OS | macOS, Windows, Linux |
| Node.js | Node.js 18+ if you use the CLI separately |
Note that Claude Code is not available on the free plan. You'll need a Pro or Max subscription. Team and Enterprise plans support organization-wide usage and administrator-managed configuration.
VSCode-compatible editors like Cursor and Windsurf may work too, but only Microsoft's VSCode is officially supported. Issues on compatible editors fall outside support, so if you want stability, use the canonical VSCode.
Installing and Configuring the VSCode Extension
Installation Steps
Installation is very simple — a few minutes at most:
- Open VSCode and press
Cmd+Shift+X(macOS) orCtrl+Shift+X(Windows/Linux) to open the Extensions panel - Search for "Claude Code"
- Select the official Anthropic "Claude Code" extension and click Install
Or install directly via this URL:
vscode:extension/anthropic.claude-code
Paste it into your browser's address bar and VSCode will launch and show the install screen.
After installation, a Claude Code icon appears in the sidebar. On first launch, you'll be asked to sign in with your Anthropic account — complete authentication in the browser.
One notable point: installing the VSCode extension also enables the claude command in the integrated terminal. So with one installation, you have both the GUI and the CLI — no separate npm install needed.
Authentication and Login
A little more detail on the first-time auth flow. Clicking the Claude Code icon in the sidebar opens a panel with a login prompt. Pressing "Sign In" launches your default browser at the Anthropic auth page. After entering your Claude Pro/Max/Team/Enterprise account credentials, you're redirected back to VSCode and authentication completes.
For Team and Enterprise plans, authentication may require SSO. The flow is basically the same but with an extra step for your organization's identity provider. If authentication fails, check with your org admin that Claude Code usage is permitted.
Credentials are stored securely locally, so you don't need to re-authenticate every time. But when a token expires, you'll be prompted to sign in again.
Initial Settings to Verify
There are a few settings worth checking right after installation. Open VSCode settings (Cmd+,) and search for "Claude Code" to see extension-specific options.
The first to check is initialPermissionMode — the permission mode used when Claude Code performs file operations or runs commands.
| Mode | Description | Recommended for |
|---|---|---|
| default | Requests approval for every file write or command | First-time users, situations requiring caution |
| plan | Proposes change plans only; execution requires manual approval | Code-review-style usage |
| auto | Auto-executes operations judged safe | Trusted projects where efficiency is the priority |
My experience: start with default, then switch to auto once you're comfortable with Claude Code's behavior. Even in auto mode, destructive operations (like git push --force) still require approval, so you never totally lose control.
Another important setting is useTerminal. Enabling it makes Claude Code use VSCode's integrated terminal when running shell commands. You can watch execution status directly in the terminal panel, which adds transparency to what's being run.
autosave is worth checking too. Enabling it auto-saves files Claude Code modifies. After reviewing and accepting a diff, you no longer need Cmd+S — but on the flip side, files are saved the instant you accept a change, which can trigger unintended hot-reloads in dev environments.
CLI vs VSCode Extension
There are differences in what each mode can do. Here's a summary of the main ones:
| Feature | CLI | VSCode Extension |
|---|---|---|
| Interactive code generation/edit | Yes | Yes |
| Inline diff (Accept/Reject) | No | Yes |
| Multi-conversation tab management | No | Yes |
| Plan Mode | Yes (Shift+Tab) | Yes (Ctrl+G) |
| Checkpoint/rewind | Yes | Yes |
| MCP configuration | Via CLI | Via CLI (not from the extension) |
| Slash commands | All supported | Subset supported |
| File @mentions | Yes | Yes (with line number support) |
| Browser integration (@browser) | Yes | Yes |
| Plugin management (/plugins) | Yes | Yes |
| Headless execution (-p flag) | Yes | No |
| CI/CD pipeline integration | Yes | No |
| Custom system prompts | Yes | Yes |
A few points to note. First, MCP (Model Context Protocol) configuration can only be done via the CLI. You cannot add or edit MCP servers from the VSCode extension UI. To add an MCP server, run claude mcp add from the integrated terminal. Since the extension embeds the CLI, you don't need to open a separate terminal.
Next, slash commands. The CLI supports all commands — /init, /config, /mcp, etc. — while the VSCode extension supports only a subset. That said, commands frequently used in daily work (/clear, /compact, and so on) are available in the extension, so it's rarely a practical problem.
Another important difference is headless execution. The CLI lets you call Claude Code non-interactively like claude -p "run the tests", so it can be embedded in CI/CD pipelines or shell scripts. The VSCode extension is designed for interactive use, so automation scenarios need the CLI.
Which Should You Use?
My recommendation: VSCode extension by default, CLI for automation and scripting. For day-to-day development, the benefit of inline diff display is huge, and confirming code changes is dramatically more efficient. For automating routine work and CI/CD integration, the CLI is in its element.
Happily, installing the extension also makes the CLI available — so the most rational approach is to switch between them based on the situation.
Consider a real development flow: daytime coding uses the VSCode extension, confirming changes with inline diffs as you go. At end of day, a script runs the test suite via the CLI in headless mode. Or: responding to PR review comments in the VSCode extension, while CI pipeline code quality checks use the CLI. Within the same project, the best interface shifts by situation — that's a strength of Claude Code's architecture.
Practical Usage in VSCode
Here are concrete workflows for using the VSCode extension. For basic Claude Code operations, also see Claude Code Usage Guide.
Learning the Keyboard Shortcuts
Working efficiently in the VSCode extension requires learning the main keyboard shortcuts. You'll use these every day, so get them into your muscle memory early:
| Shortcut | Action |
|---|---|
Cmd+Esc | Toggle focus between editor and Claude Code panel |
Cmd+Shift+Esc | Open a new conversation tab |
Option+K | Insert an @mention (file or line reference) |
Shift+Enter | New line in the input box (multi-line input) |
Ctrl+G | Toggle Plan Mode |
I use Cmd+Esc constantly. When I want to ask Claude Code a question mid-edit, there's no need to click the panel with the mouse — just move focus with the keyboard. After reading the answer, Cmd+Esc again returns focus to the editor, so the thought process isn't interrupted.
Multi-line input with Shift+Enter is important too. The more complex the instruction, the more accurate results tend to be with structured input using line breaks. For example:
Please implement an API endpoint with the following requirements.
- Path: /api/users/:id
- Method: GET
- Response: User information as JSON
- Return appropriate HTTP status codes on errors
- Use zod for validationSharing Context with @Mentions
An @mention for files and line numbers is a powerful VSCode-extension-specific feature. Press Option+K to enter @mention mode, then type a filename to add it to context.
Beyond simple file references, line-level references work too. Typing @src/utils/auth.ts#42 shares the code around line 42 of that file with Claude Code. Instead of a vague "fix the bug in this function," something specific like "in @src/utils/auth.ts#42's validation, fix the error that occurs when the input is null" yields more accurate fixes.
A pattern I frequently use in practice:
Using @src/components/UserProfile.tsx and @src/hooks/useUser.ts as references,
create a new @src/components/TeamProfile.tsx.
Include team name display and member list features.Referencing multiple files by @mention lets Claude Code understand existing coding style and patterns, and generates more consistent code than starting from scratch.
Another practical pattern: referencing test files standardizes how tests are written.
Following the test style in @tests/unit/auth.test.ts,
create unit tests for @src/utils/payment.ts.
Only mock external API calls.By explicitly referencing an existing test file, the generated tests follow the same pattern for assertions, describe/it structure, and mocking. It's extremely effective for preventing the "test style drift" problem across a project.
Using Inline Diffs
When Claude Code proposes code changes, inline diffs appear in VSCode's editor. Changes are highlighted in red (deletions) and green (additions), with Accept/Reject buttons per change.
What's useful here is the ability to partially accept changes. If Claude Code proposes five changes, you might accept three and reject two. The CLI writes changes directly to files, so this kind of selective acceptance is hard.
In real development, it often happens that most of Claude Code's proposal is right but one part needs tweaking. For example, a function refactor where the logic change is correct but you want to adjust just the error message wording. With inline diffs, you accept the logic part, reject the error-message part, then fix it manually — the flow is smooth.
Using Plan Mode to Verify Change Plans
Plan Mode (toggle with Ctrl+G) makes Claude Code present a change plan before actually making any modifications. It's valuable before large refactors or changes with wide blast radius.
With Plan Mode enabled and an instruction like "convert this module to function components," Claude Code doesn't change code — instead it presents which files would be modified and how. If the plan looks good, switch back to normal mode to execute; if not, revise the approach at the planning stage.
Typical scenarios where I use Plan Mode:
- Refactoring that affects 10+ files
- Work involving database schema changes
- Changes that may break existing tests
- Introducing new architectural patterns
In all of these, confirming the plan up front dramatically reduces rework. In team development, sharing the Plan Mode output with teammates to get alignment before executing is also effective.
Checkpoints and Rewind
Claude Code records checkpoints of your work automatically and lets you rewind if something goes wrong. The VSCode extension lets you rewind to any point in a conversation.
This operates on a different layer than Git commits — you can rewind uncommitted work in progress. If you asked Claude Code for a large change and the result wasn't what you expected, you can roll back to a checkpoint and try again.
What I find especially handy is when, during trial and error, I realize "two steps ago was actually best." With Git I'd need to juggle stashes and resets manually; with checkpoints, I just click the target point on the conversation timeline to restore.
Leveraging Auto-Accept Mode
Once you trust Claude Code's output to a degree, consider using auto-accept mode. When enabled, Claude Code's proposed changes are automatically accepted — no need to click an approval button each time.
Good situations for auto-accept mode:
- Bulk generation of test code
- Generating routine CRUD boilerplate
- Adding comments to existing code
- Unifying code formatting
Conversely, for business logic changes or security-critical modifications, keep auto-accept off and review each diff carefully.
My team has rules for auto-accept mode usage: enable it for low-risk work like test code and documentation generation; always disable it for production code changes. Documenting this in CLAUDE.md ensures consistent practice across the team.
Browser Integration (@browser)
Claude Code supports @browser, which lets you share the contents of your browser display as context. For example, share a screenshot of a page on your dev server and ask "fix the styling of this part of the UI" — visual instructions.
Integration with a Chrome extension lets you share DevTools console errors and network tab info with Claude Code too, dramatically improving debug productivity. Instead of describing "this error appears on the screen" in text, you share the actual error screen directly.
A concrete example: fixing a CSS layout bug. Traditionally you'd describe "the header navigation is overflowing to the right" in text, then have to investigate at which screen widths it occurs and what element is the cause. With @browser, just share a screenshot of the broken page and say "fix this." Claude Code understands the issue visually from the image and proposes the CSS fix.
This feature is especially powerful for frontend work, and pairs nicely with workflows where a designer shares a screenshot and you need to request fixes for the diff against the current UI.
Plugin Management (/plugins)
Claude Code supports feature extension via plugins. In the VSCode extension's conversation panel, the /plugins command lets you list, install, enable, and disable available plugins.
Plugins extend Claude Code's core capabilities — integration with project-specific linters, code generation templates for specific frameworks, and so on. Configuring the right plugins for your project further improves Claude Code's output quality.
A Practical Workflow: Adding a Feature
I've described individual features, but in practice you combine them. Here's one typical feature-addition flow:
-
Verify the design in Plan Mode: Switch to Plan Mode with
Ctrl+Gand say "I want to add a user-profile editing feature." Claude Code lists which files would be modified and how — share with the team for alignment. -
Proceed in normal mode: Toggle Plan Mode off and instruct implementation per the plan. Reference related files via @mention and generate code step by step.
-
Confirm changes via inline diff: Go through each file's changes one at a time. Reject and re-instruct for anything problematic.
-
Generate tests: After implementation, enable auto-accept mode and bulk-generate test code. Reference existing tests via @mention to maintain style consistency.
-
Rewind to a checkpoint on issues: If test runs surface problems, use checkpoints to roll back to an appropriate point and try a different approach.
This whole flow staying within a single VSCode window is the real value of the extension. Terminal, editor, diff viewer, test runner — no separate tools to juggle. Development centered on conversation with Claude Code becomes efficient.
Recommended Settings and Customization
Optimizing VSCode Settings
The extension's settings can be edited directly in settings.json. Here's an excerpt of the settings I actually use:
{
"claude-code.initialPermissionMode": "auto",
"claude-code.useTerminal": true,
"claude-code.autosave": true,
"claude-code.preferredLocation": "editor"
}Details on each setting:
initialPermissionMode: As described above, controls permission mode for file operations and command execution. For team consistency, add it to .vscode/settings.json and commit it to the repo.
useTerminal: Whether Claude Code uses the integrated terminal to run shell commands. Set to true to see test execution and build command output in the terminal panel in real time.
autosave: Whether Claude Code's changes are auto-saved. Toggle based on your dev server's hot-reload behavior. If frequent build errors are bothersome, disabling can help.
preferredLocation: Where to place the Claude Code panel. "editor" shows it as an editor tab; "sidebar" places it in the sidebar. I use "editor" to leverage the wide screen — splitting the editor horizontally and putting the Claude Code conversation on one side.
useCtrlEnterToSend: By default, Enter sends a message. Setting this to true makes Ctrl+Enter (or Cmd+Enter on macOS) send instead. If you frequently enter multi-line instructions, enabling this helps prevent accidental sends. If you're used to Shift+Enter for new lines, the default is fine — but if you often write long instructions, it's worth considering.
Integration with CLAUDE.md
Even with the VSCode extension, CLAUDE.md files are loaded as normal. Instructions placed in a project-root CLAUDE.md are reflected in conversations via the extension too.
For VSCode extension usage, a particularly useful pattern is putting VSCode-specific instructions in CLAUDE.md:
## Rules when working in the VSCode extension
- Always verify changes via inline diffs
- Run tests in the integrated terminal and confirm results
- Use Plan Mode before large-scale changesThis gives Claude Code automatic awareness of how to leverage extension-specific features.
Going further, documenting project-specific coding conventions and architectural policies in CLAUDE.md causes Claude Code's output to align with project conventions naturally. For example: "Write all components as function components," "Use Zustand for state management," "Use fetch instead of axios for API clients." Document these once and you don't have to keep saying them.
CLAUDE.md applies equally whether using the CLI or the VSCode extension, so team dev environments stay consistent — and output stays coherent even across a team of mixed CLI and VSCode extension users.
Per-Workspace Settings
If you want different settings per project, workspace-level settings are effective. Write Claude Code-specific settings in each project's .vscode/settings.json, and they apply automatically when you open that project.
For example, cautious mode for projects close to production; efficiency-first mode for personal experiments:
// For production projects
{
"claude-code.initialPermissionMode": "default"
}// For experimental projects
{
"claude-code.initialPermissionMode": "auto",
"claude-code.autosave": true
}Comparison with the Claude Code Desktop App
Claude Code also offers a standalone desktop application in addition to the VSCode extension. Here's how the two differ:
| Aspect | VSCode extension | Desktop app |
|---|---|---|
| IDE integration | Deeply integrated with VSCode | Standalone application |
| Inline diff | Directly in the editor | Inside the app |
| Editor capabilities | Full VSCode feature set available | Limited |
| Extension interop | Works with other VSCode extensions | Not possible |
| Terminal integration | Works with VSCode's integrated terminal | Built-in terminal |
| Startup | Available after VSCode launches | Launches as a standalone app |
| Multi-project | Managed via workspaces | Switch projects |
| Target user | Developers using VSCode regularly | Those preferring IDE-independent use |
Personally, if you use VSCode daily, I think the VSCode extension is the clear choice. The reason is simple: the productivity boost from editor integration is overwhelming. Editing, diff review, and running terminal commands all happen within one window — context-switching cost approaches zero.
On the other hand, the Desktop app suits these cases:
- You primarily use an editor other than VSCode — JetBrains IDEs, Vim/Neovim, etc.
- Your main use is conversation with Claude Code (design discussions, technical research) rather than writing code
- You use different IDEs across projects and want a unified Claude Code environment
VSCode extension and Desktop app can also be used simultaneously. For instance, coding in the VSCode extension and technical research or documentation in the Desktop app is a realistic split. But running both in the same project directory simultaneously may cause conflicts — watch out for that.
For JetBrains IDE Users
If you use a JetBrains IDE (IntelliJ IDEA, WebStorm, etc.), the CLI or Desktop app are the main options at the moment. The JetBrains-specific Claude Code extension, as of this writing, doesn't offer the feature parity that the VSCode version does, so either moving to VSCode or running CLI-based is pragmatic.
That said, JetBrains IDEs have capable terminal features, so using Claude Code via the CLI from the integrated terminal delivers a meaningful productivity lift.
Which Environment Should You Choose? A Decision Flowchart
For those unsure of the best setup, here's the decision flow.
First, is your main editor VSCode? If you use VSCode daily, the VSCode extension is the best choice. You get the full benefits of IDE integration — inline diffs, tab management, and so on.
Next, for editors other than VSCode. JetBrains IDEs are practical with CLI usage from the integrated terminal. Vim/Neovim users will find terminal-based CLI workflows aligned with their editor's philosophy.
If you want environment-independent usage, or your primary use is non-coding (technical research, documentation, design discussions), the Desktop app fits.
Finally, for CI/CD pipeline integration or batch processing, the CLI's headless mode is the only option. The GUI is unnecessary for these use cases, and the CLI's flexibility shines.
Summary
This article covered everything you need for using Claude Code with VSCode — from installation to customization. A recap of the key points:
Getting started
- Install the VSCode extension from
Cmd+Shift+Xby searching "Claude Code" - Requires VS Code 1.98.0+ and a Claude Pro/Max/Team/Enterprise account
- Installing the extension also enables the CLI
Features to use daily
- Visual change confirmation via inline diffs
- @mentions for file and line-number references
Cmd+Escfor fast toggling between editor and Claude Code panel- Plan Mode for verifying large changes in advance
- Checkpoints for safe experimentation
Optimizing settings
- Set
initialPermissionModeto match project-appropriate permission level - Use
useTerminalfor transparency on command execution - Per-workspace settings for project-specific optimization
Claude Code's VSCode extension is currently one of the most refined solutions for using an AI coding assistant seamlessly within the IDE. It preserves the CLI's flexibility while adding GUI-only benefits like visual diff review and tab management, folding naturally into daily development workflow.
The adoption bar is low — just install it from the extensions panel and start. Try with small tasks first (generating tests, adding doc comments), then gradually expand to larger work like refactoring and feature implementation — that's a smooth adoption path.
At aduce, we've standardized on Claude Code's VSCode extension team-wide, using it to streamline code review and automate routine work. For questions about adoption or AI usage, please feel free to reach out via our Contact page.