Claude Code: VS Code and JetBrains Integration
Last updated: 2026-08-31
Claude Code is fundamentally a CLI tool, but can run in VS Code and JetBrains terminals, and extensions provide better integration.
💡 Tip: Claude Code is not an IDE plugin — it runs in the terminal, but IDE extensions provide quick access, sidebar panels, and better interaction.
📋 Prerequisites: Chapter 4 - First Use
1. What You'll Learn
- Installing Claude Code extension in VS Code
- Using Claude Code in JetBrains IDEs
- IDE integration mode vs CLI mode comparison
- Terminal configuration optimization
- Multi-IDE workflows
2. VS Code Integration
(1) Install Extension
BASH
# Method 1: VS Code Extension Marketplace search
# Search "Claude Code" → Install
# Method 2: Command line install
code --install-extension anthropic.claude-code
# Method 3: In VS Code, Ctrl+Shift+X → Search Claude Code → Install
(2) Extension Configuration
JSON
// settings.json
{
"claude-code.apiKey": "sk-ant-api03-xxxxx",
"claude-code.model": "claude-sonnet-4-20250514",
"claude-code.autoApprove": "read-only",
"claude-code.terminalProfile": "claude"
}
(3) Usage Methods
| Method | Operation | Use Case |
|---|---|---|
| Sidebar panel | Click Claude icon | Visual interaction |
| Embedded terminal | Type claude in VS Code terminal |
Same as CLI |
| Keyboard shortcut | Ctrl+Shift+C |
Quick open panel |
| Context menu | Select code → Ask Claude | Targeted questions |
▶ Example 1: VS Code Workflow
TEXT
📖 Display only
# Alice uses Claude Code in VS Code
1. Open project
2. Press Ctrl+` to open terminal
3. Type claude to start
Or
1. Click sidebar Claude icon
2. Type instructions in the panel
3. Click file changes to view diff
4. One-click Accept/Reject changes
3. JetBrains Integration
(1) Install Plugin
TEXT
📖 Display only
# Supported IDEs: IntelliJ IDEA, WebStorm, PyCharm, GoLand, etc.
Install steps:
1. File → Settings → Plugins
2. Search "Claude Code"
3. Click Install
4. Restart IDE
(2) Using in JetBrains Terminal
BASH
# JetBrains built-in terminal can run Claude Code directly
# Bottom toolbar → Terminal → type claude
# Configure terminal
# Settings → Tools → Terminal → Shell path
# Ensure terminal can find the claude command
which claude # Confirm path
(3) JetBrains-Specific Features
| Feature | Description |
|---|---|
| Code selection Q&A | Select code → Right-click → Ask Claude |
| Intentions | Alt+Enter → Claude suggested actions |
| Diff preview | Built-in diff viewer for change preview |
| Run Configuration | Configure Claude Code launch item |
▶ Example 2: JetBrains Workflow
TEXT
📖 Display only
# Bob uses Claude Code in IntelliJ IDEA
1. Open Spring Boot project
2. Bottom Terminal panel → claude
3. Type: "Add paginated query endpoint to UserController"
Claude Code:
→ Reading UserController.java
→ Reading UserRepository.java
→ Modifying UserController.java (adding pageable endpoint)
→ Modifying UserRepository.java (adding query method)
→ Running: mvn test
✅ All tests passed
4. View diff in IDE:
Double-click changed file → Built-in diff view
Green highlights new code, red highlights deleted code
4. IDE Integration vs Pure CLI
(1) Feature Comparison
| Dimension | Pure CLI | VS Code Extension | JetBrains Plugin |
|---|---|---|---|
| Install method | npm global install | Extension marketplace | Plugin marketplace |
| Interface | Terminal text | Sidebar panel | Terminal + Intentions |
| Diff viewing | git diff | Built-in diff view | Built-in diff view |
| File operations | Auto-modify | One-click confirm | One-click confirm |
| Context awareness | Manual specification | Code selection | Code selection + Intentions |
| Remote dev | SSH direct | Remote SSH | Remote SSH |
| Config management | Environment variables | settings.json | IDE Settings |
(2) Selection Recommendations
| Scenario | Recommended | Reason |
|---|---|---|
| Remote server | Pure CLI | No GUI needed, SSH direct |
| Daily development | IDE extension | Better integrated experience |
| CI/CD | Pure CLI | Automation scripts |
| Multi-project switching | Pure CLI | Flexible directory switching |
| Team collaboration | IDE extension | Lower learning curve |
5. Terminal Configuration Optimization
▶ Example 3: Optimizing Claude Code Terminal Experience
BASH
# 1. Configure shell aliases
echo 'alias cc="claude"' >> ~/.zshrc
echo 'alias ccr="claude --resume"' >> ~/.zshrc
# 2. Configure terminal color support
export TERM=xterm-256color
# 3. VS Code terminal config (settings.json)
{
"terminal.integrated.shell.linux": "/bin/zsh",
"terminal.integrated.env.linux": {
"ANTHROPIC_API_KEY": "sk-ant-api03-xxxxx"
}
}
# 4. JetBrains terminal config
# Settings → Tools → Terminal → Add environment variable
# ANTHROPIC_API_KEY=sk-ant-api03-xxxxx
6. Comprehensive Example: Multi-IDE Collaboration
TEXT
📖 Display only
# Alice's team uses multi-IDE collaboration
Team member A (VS Code + frontend project):
→ Launch Claude Code from VS Code sidebar
→ Have Claude Code refactor React components
→ Use built-in diff to confirm changes
Team member B (IntelliJ + backend project):
→ Launch Claude Code from IDE terminal
→ Have Claude Code add REST API
→ Use Intentions for quick operations
CI/CD Pipeline:
→ Pure CLI mode
→ claude --headless "Run code review"
→ Automated checks and fixes
❓ FAQ
Q Can VS Code extension and CLI be used simultaneously?
A Yes, but not recommended to operate the same files concurrently. Both share the same API Key and model configuration.
Q Which JetBrains IDEs does the plugin support?
A All JetBrains IDEs: IntelliJ IDEA, WebStorm, PyCharm, GoLand, RubyMine, PhpStorm, etc.
Q What's the difference if I only use the terminal without the extension?
A Core functionality is identical. Extensions only provide better UI experience (diff view, one-click confirm, etc.), not affecting Claude Code's capabilities.
Q How to use for remote development?
A After VS Code Remote SSH connects to the server, install Claude Code in the remote terminal. Same for JetBrains.
Q Do extensions auto-update?
A Yes. Both VS Code and JetBrains have auto-update mechanisms. CLI requires manual
npm update -g.Q Which IDE integration is best?
A VS Code extension has the highest integration (sidebar panel, shortcuts, diff view), JetBrains second, pure CLI most flexible.
📖 Summary
- Both VS Code and JetBrains have Claude Code extensions/plugins
- Extensions provide better UI experience, but core functionality matches CLI
- Pure CLI suits server and CI/CD scenarios
- Code selection for direct Q&A is the biggest advantage of IDE integration
- Terminal configuration optimization improves daily experience
📝 Exercises
- Basic (⭐): Install Claude Code extension in your VS Code or JetBrains IDE, confirm it starts normally.
- Intermediate (⭐⭐): Complete the same task using both pure CLI and IDE extension, compare experience differences.
- Advanced (⭐⭐⭐): Configure VS Code Remote SSH + Claude Code for AI-assisted programming on a remote server.