using VS Code and JetBrains without switching editors
Claude Code runs at its core in the terminal, but the official extensions for VS Code and JetBrains IDEs like PhpStorm bring diff views, context menus, and debugger integration directly into your familiar editor. Anyone who only knows Claude Code through the plain command line is missing out on noticeable convenience in daily development work.
Table of Contents
- 1. Why an IDE extension makes sense alongside the terminal
- 2. Setting up Claude Code in VS Code
- 3. Setting up Claude Code in JetBrains IDEs like PhpStorm
- 4. Diff view and change review inside the editor
- 5. Context menus: passing selections directly to Claude
- 6. Debugger integration and error context
- 7. Terminal mode and IDE extension working together
- 8. Limitations and known constraints
- 9. VS Code vs. JetBrains extension compared
- 10. Summary
- 11. FAQ
1. Why an IDE extension makes sense alongside the terminal
Claude Code is at its core a command line tool and works entirely without a graphical interface. Still, Anthropic has released official extensions for VS Code and JetBrains IDEs, because many developers find constantly switching between a terminal window and the editor to be friction. The extension embeds Claude Code into the familiar interface without replacing the underlying terminal logic.
The core idea: Claude Code keeps running as a process in the IDE's integrated terminal, while the extension adds visual components such as diff views, context menus, and automatic synchronization of the currently open file with the Claude session. That means you no longer have to manually copy file paths into the chat, since Claude Code automatically knows which file is currently active in the editor.
For teams that mandate PhpStorm or VS Code as their standard IDE, this integration is often the decisive factor for Claude Code adoption within the team. A pure terminal workflow can feel unfamiliar to many developers at first, while the IDE extension significantly lowers the barrier to entry, since familiar interaction patterns like right-click menus and side panels keep working as expected.
2. Setting up Claude Code in VS Code
Setup in VS Code happens through the official extension from the marketplace, which after installation automatically detects whether Claude Code is already available as a CLI tool on the system. If not, the extension offers to trigger installation directly, without requiring a manual switch to the terminal. After setup, a new panel appears in the sidebar showing chat history and the current session status.
A key detail of the VS Code integration is automatic context synchronization: open a file in the editor, and Claude Code immediately knows which file a following request most likely refers to, without the path having to be stated explicitly. Selecting a code section additionally lets you pass it directly as context to the running Claude session via a keyboard shortcut.
# Install the Claude Code CLI first (required by the VS Code extension)
npm install -g @anthropic-ai/claude-code
# Then install the extension from the VS Code marketplace
code --install-extension anthropic.claude-code
# Open a project and start a session from the integrated terminal
code ~/projects/my-app
# Claude Code panel appears in the sidebar automatically
3. Setting up Claude Code in JetBrains IDEs like PhpStorm
For JetBrains products, including PhpStorm, IntelliJ IDEA, and WebStorm, there is a dedicated plugin installed through the JetBrains Marketplace. Here too, the underlying Claude Code CLI remains the technical foundation; the plugin merely adds a native interface for PhpStorm. After installation, a tool window appears that can be docked, moved, and controlled with keyboard shortcuts just like any other PhpStorm panel.
A practical advantage of the PhpStorm integration is its interplay with existing code inspections: when Claude Code suggests a change, PhpStorm can simultaneously check whether the change violates existing type annotations, PHPDoc blocks, or coding standards before it gets accepted. That combines the strengths of both tools, static analysis from PhpStorm and generative understanding from Claude, instead of pitting them against each other.
# JetBrains plugin installation via command line (Toolbox App path may vary)
# 1. Open PhpStorm > Settings > Plugins > Marketplace
# 2. Search for "Claude Code" and install
# 3. Restart the IDE
# Verify the underlying CLI is reachable from the IDE's terminal
which claude
claude --version
4. Diff view and change review inside the editor
One of the most noticeable improvements over plain terminal use is the graphical diff view. Instead of reading changes as a raw text patch in the terminal, both the VS Code and JetBrains extensions display before-and-after comparisons in the respective IDE's familiar diff presentation, including syntax highlighting and line numbers.
This diff view lets you accept or reject individual hunks selectively instead of only accepting or discarding a suggested change as a whole. On a multi-step refactoring task touching several files at once, this granular control makes the difference between a trustworthy and a risky-feeling agent workflow.
5. Context menus: passing selections directly to Claude
Both extensions add entries to the editor's right-click context menu such as Explain with Claude, Refactor with Claude, or Generate tests for this function. Select a function, a class, or a code block and choose one of these entries, and the selected code gets automatically passed as context to a new or existing Claude session, without manually copying it.
These context menus lower the entry barrier especially for team members not yet familiar with Claude Code's plain chat syntax. Instead of formulating a precise text request, a right-click on the relevant code section is enough, which democratizes Claude Code usage within the team instead of reserving it for experienced CLI users.
{
"_comment": "Example VS Code keybinding to send the current selection to Claude Code",
"key": "ctrl+alt+c",
"command": "claude-code.sendSelectionToChat",
"when": "editorHasSelection"
}
6. Debugger integration and error context
An often overlooked feature of both extensions is passing along debugger context. If an Xdebug breakpoint in PhpStorm stops at an exception, the current stack trace along with local variables can be forwarded directly to Claude Code, without manually copying the trace from the console. Claude then gets the same level of information as a developer live debugging the issue.
This integration is especially valuable for hard-to-reproduce bugs where the state at the moment of failure is decisive. Instead of reconstructing the error afterward from log files, the debugger integration delivers the exact state, significantly increasing the hit rate for root cause analysis.
{
"_comment": "Debugger context automatically forwarded to Claude Code on breakpoint",
"exception": "TypeError: Cannot read properties of undefined",
"stack_trace": [
"at calculateTotal (checkout.js:42)",
"at processOrder (checkout.js:18)"
],
"local_variables": {
"cart": { "items": [], "discount": null },
"customer": { "id": 1042, "tier": "gold" }
}
}
7. Terminal mode and IDE extension working together
Important to understand: the IDE extension does not replace terminal mode, it complements it. For long, autonomous refactoring sessions across many files, the terminal often remains the more efficient choice, since Claude Code works there without UI overhead and can easily be embedded into scripts. For targeted requests during everyday coding, the IDE extension is usually the faster option.
Many experienced users deliberately switch between both modes depending on the task: short explanation questions and small refactors go through the IDE extension, while larger, multi-step tasks get started in a separate terminal window and continue running while you keep working on other files in the IDE.
8. Limitations and known constraints
The IDE extensions are not a full replacement for every terminal capability of Claude Code. Some advanced configuration options, such as detailed permission rules or custom slash commands, are managed more reliably from the command line than through the graphical interface, even though the extensions continuously catch up on feature parity.
The extension's stability also depends on the respective IDE version: after major PhpStorm or VS Code updates, brief compatibility issues can occur until the extension catches up. Anyone relying on the integration productively should avoid installing IDE updates on release day and instead wait briefly to confirm the Claude Code extension is already compatible.
# Fallback: advanced configuration always works via the CLI directly,
# even if the graphical extension is temporarily incompatible after an update
cat ~/.claude/settings.json
# Custom slash commands are managed as plain files, independent of the IDE
ls ~/.claude/commands/
claude --version
9. VS Code vs. JetBrains extension compared
Both extensions build on the same Claude Code CLI but differ in details that depend on the respective IDE platform. The table below highlights the key differences.
| Feature | VS Code extension | JetBrains plugin |
|---|---|---|
| Install source | VS Code Marketplace | JetBrains Marketplace |
| Diff view | VS Code native diff panel | JetBrains native diff window |
| Debugger context | Via Debug Adapter Protocol | Via Xdebug and JetBrains debugger |
| Code inspections | Depends on installed extensions | Deeply integrated, available instantly |
| Maturity | Very broad user base, fast updates | Somewhat smaller user base, solid integration |
For PHP and Magento teams that already use PhpStorm as their standard IDE, the JetBrains plugin is the obvious choice, since it interlocks seamlessly with existing code inspections and PHPDoc checks. For polyglot teams with VS Code as the common denominator, the VS Code extension offers a broader extension landscape and usually the fastest updates for new Claude Code features.
Mironsoft
Claude Code setup for PhpStorm and VS Code teams
Want Claude Code cleanly integrated into your IDE landscape?
We set up Claude Code including the IDE extension, CLAUDE.md conventions, and permission model for PhpStorm and VS Code teams, and train your team on diff review and debugger integration.
IDE setup
Setting up the Claude Code extension in PhpStorm and VS Code
Workflow training
Establishing diff review, context menus, and debugger handoff in the team
Conventions
CLAUDE.md and permission rules for consistent team-wide behavior
10. Summary
The official Claude Code extensions for VS Code and JetBrains IDEs like PhpStorm bring the core Claude Code capabilities directly into the familiar editor, without replacing the underlying terminal logic. Diff views with granular hunk control, context menus for quick requests, and debugger integration for precise error context make the entry point far easier for teams than pure command line operation.
Terminal mode and IDE extension are not mutually exclusive; they complement each other depending on the task: long, autonomous sessions in the terminal, targeted requests through the extension. Teams introducing Claude Code should deliberately communicate both access paths instead of committing to a single mode.
Claude Code IDE extensions — the essentials at a glance
Core principle
The CLI stays the technical foundation, the extension adds diff view, context menus, and active-file synchronization.
JetBrains advantage
Deep integration with existing code inspections, ideal for PhpStorm and PHP teams.
Debugger context
Stack traces and local variables can be forwarded directly to Claude Code without manual copying.
Recommendation
Terminal for long autonomous sessions, IDE extension for targeted everyday requests.