How to Use Claude Code in VS Code (or Other IDEs)?
There are two approaches to using Claude Code in VS Code (or other IDEs):
- Terminal approach — Works with any IDE, no UI dependency
- Extension approach — Exclusive to VS Code and its derivatives (Cursor, Trae, Codium, etc.)
Approach 1: Command-Line Terminal (Universal)
This is the most flexible method, compatible with all IDEs including VS Code, IntelliJ, Eclipse, Vim, and more.
Install the Claude Code CLI
Follow the installation guide for your operating system:
Open a Terminal in Your IDE
- VS Code:
Ctrl+`or menuView → Terminal - IntelliJ/WebStorm:
Alt+F12or theTerminaltab at the bottom - Other IDEs: Find the built-in terminal feature
Launch Claude Code
In the terminal, type:
claudeStart a Conversation
Type your request directly. Claude Code will:
- Automatically analyze project files
- Show diffs and file changes in real time
- Support
ESC ESCto create a checkpoint so you can roll back accidental changes
Connect to Your IDE with /ide (Optional but Highly Recommended)
Type /ide in the terminal to attach the current session to the VS Code / Cursor / JetBrains extension, enabling:
- Real-time reading of the file currently open in the IDE and the cursor selection
- Code changes highlighted directly in the IDE’s Diff view, instead of plain text in the terminal
- Shared IDE linter errors so Claude can fix them in one step
| Scenario | Action |
|---|---|
| First connection | Type /ide in the terminal claude session |
| Check status | /ide status |
| Reconnect | If you switch to a different IDE window, just type /ide again |
| Shortcut | After connecting, press Cmd+Esc / Ctrl+Esc in the IDE to quickly open the Claude side panel |
One-liner to remember: /ide = instantly give the “black terminal” a “graphical upgrade” — visual diffs, selection-as-context, and instant error fixes.
Pros:
- No UI dependency — works with monorepos, CI, and remote servers
- Universal across all IDEs — learn once, use everywhere
Cons:
- Pure command-line interface; requires typing commands
Approach 2: VS Code Extension (GUI)
Compatible with VS Code and its derivatives (Cursor, Trae, Windsurf, Codium, etc.).
Install the Claude Code Extension
- Open the VS Code Extensions panel (
Ctrl+Shift+X) - Search for “Claude Code”
- Select the official extension published by Anthropic
- Click Install
Configure the API (Required for CC Club Users)
If you are using CC Club’s service, this configuration step is mandatory!
You need to set primaryApiKey in the config file:
Config file location: ~/.claude/config.json
{
"primaryApiKey": "crs"
}Verify the config:
cat ~/.claude/config.jsonIf this file does not exist, create it manually.
Use the Claude Code Extension
There are multiple ways to interact:
| Method | Action |
|---|---|
| Command Palette | Ctrl+Shift+P → type “Claude Code: Start Chat” |
| Sidebar | Click the Claude icon in the sidebar and start chatting |
| Drag and drop files | Drag files into the chat window to use them as context |
Pros:
- Graphical interface with intuitive controls
- Sidebar chat — no need to switch windows
- Supports dragging files as context
Cons:
- Only available for VS Code-based IDEs
Quick Decision Guide
| You are… | Recommended approach |
|---|---|
| Terminal user / remote dev / CI integration | CLI approach (Approach 1) |
| GUI user / prefer sidebar chat | VS Code extension (Approach 2) |
| Want both | Install the extension, use the CLI as backup |
Both approaches share the same login session and config files, so you can switch between them seamlessly at any time.