Skip to main content
reopt Handbook
reopt Handbook
Claude Code Complete Guide

Setup

Plan and Environment SetupMastering CLAUDE.md

Multi-session & Agents

Multi-session WorkflowSubagents

Automation & Extension

HooksMCP IntegrationSkills and Slash Commands

Workflow

Plan ModeContext ManagementIDE IntegrationHeadless and CI/CD

Practice

Vibe Coding PatternsPrompting Best Practices

Verification

Verification ReportUpdate Log
Handbook›Claude Code Complete Guide›IDE Integration
한국어English

IDE Integration

Combine Claude Code terminal sessions with editor context and review workflows.

Key takeaways

  • Claude Code ships as a VS Code extension (and forks like Cursor, Windsurf, Kiro) and a JetBrains plugin, both sharing conversation history and ~/.claude/settings.json.
  • Integrated terminals auto-connect; from an external terminal run claude then /ide to attach to the editor — and start from the same project root so files line up.
  • While connected, Claude automatically sees your selection and active file; insert explicit @-mentions with Option+K/Alt+K (VS Code) or Cmd+Option+K (JetBrains), and add a Read deny rule to keep .env out of context.
  • The built-in ide MCP server exposes only two tools to Claude — mcp__ide__getDiagnostics (read) and mcp__ide__executeCode (Jupyter, always asks via a native Quick Pick).
  • On macOS Tahoe the system Game Overlay shortcut intercepts Cmd+Esc, so rebind the focus command or clear the conflict in System Settings.

The terminal session is strongest for autonomous work. The IDE is strongest for inspection, local navigation, and human review. Use both deliberately.

Claude Code ships in two surfaces that share the same conversation history and ~/.claude/settings.json:

  • A VS Code extension (and forks like Cursor, Windsurf, and Kiro) that provides a native graphical panel. This is the recommended way to use Claude Code in VS Code.
  • A JetBrains plugin for IntelliJ IDEA, PyCharm, WebStorm, PhpStorm, GoLand, Android Studio, and most other JetBrains IDEs.

Either way, the underlying integration is the same: when Claude Code runs in (or is connected to) an IDE, it can open diffs in the editor's native diff viewer, read your current selection for @-mentions, and pull live diagnostics from the language server.

Effective Split

  • Let Claude Code inspect, edit, run commands, and report verification.
  • Use the IDE for reading dense diffs, checking UI copy, and resolving subtle merge conflicts.
  • Keep terminal prompts focused on behavior, not on editor mechanics.

Connecting the IDE

There are two connection paths, and they behave differently.

Where you run Claude CodeHow it connectsWhat you do
The IDE's integrated terminalAuto-connectsJust run claude. Diff viewing and diagnostic sharing turn on automatically.
An external terminalManualRun claude, then /ide inside the session to attach it to your editor.
The VS Code extension panelBuilt-inThe graphical panel is the integration; no command needed.

For the JetBrains plugin, install it from the JetBrains Marketplace and restart the IDE, then run claude from the integrated terminal (or /ide from an external one). For VS Code, install the Claude Code extension (anthropic.claude-code) from the Extensions view or the Open VSX registry. The extension requires VS Code 1.98.0 or higher and includes the CLI, which you can reach from the integrated terminal.

Same project root

If your IDE and an external Claude Code session disagree about which files exist, start Claude Code from the same directory as your IDE project root before running /ide. The integration shares the editor's open files and selection, so the working directories must line up.

Editor Context

When using an editor integration, make the selected context intentional. Passing too many open files can distract the agent from the actual task.

While connected, the CLI automatically includes your current editor selection and the path of the active file as context on each prompt. The transcript shows a ⧉ Selected N lines from <file> line when this happens. To insert an explicit @-mention reference instead, use the file-reference shortcut:

  • VS Code: Option+K (Mac) / Alt+K (Windows/Linux) inserts something like @app.ts#5-10.
  • JetBrains: Cmd+Option+K (Mac) / Alt+Ctrl+K (Windows/Linux) inserts something like @src/auth.ts#L1-99.

Useful context:

  • The component being edited.
  • The test that describes expected behavior.
  • The route or API boundary affected by the change.

Noisy context:

  • Large generated files.
  • Unrelated tabs.
  • Old scratch buffers.

Keep secrets out of context

Selection and open-file context can leak sensitive files such as .env. Add a Read deny rule for the path: a matching deny rule blocks both the selected text and the open-file notice from ever reaching Claude. In the VS Code panel you can also click the selection indicator (the eye-slash icon) to hide the current selection.

Review Loop

After implementation, ask for a narrow review:

Review only the route and locale changes in this diff.
Prioritize bugs, unsupported fallbacks, and missing tests.
Return findings with file references.

When Claude proposes an edit, the integration shows a side-by-side diff in the editor's native viewer and asks for permission before writing. You can accept, reject, or edit the proposed content directly in the diff before accepting — if you do, Claude is told you modified it so it does not assume the file matches its original proposal. Use Plan mode when you want Claude to describe the change and wait for approval before touching anything; in the VS Code panel the plan opens as a markdown document you can comment on inline.

Set whether diffs open in the IDE or stay in the terminal with the diff tool setting: run /config and set the diff tool to auto (show in the IDE) or terminal (keep in the terminal).

The built-in IDE MCP server

When the VS Code extension is active, it runs a local MCP server named ide that the CLI connects to automatically. This is what lets the CLI open diffs in the native diff viewer, read your selection for @-mentions, and — in a Jupyter notebook — execute cells. The server binds to 127.0.0.1 on a random high port (so it is not reachable from other machines), and each activation generates a fresh auth token written to a lock file under ~/.claude/ide/ with 0600 permissions inside a 0700 directory.

The server is hidden from /mcp because there is nothing to configure, but it matters if your organization uses a PreToolUse hook to allowlist MCP tools. Most of its handlers are internal RPC the CLI uses for its own UI and are filtered out before the tool list reaches the model. Only two tools are visible to Claude:

Tool (as seen by hooks)What it doesWrites?
mcp__ide__getDiagnosticsReturns language-server diagnostics — the errors and warnings from VS Code's Problems panel, optionally scoped to one file.No
mcp__ide__executeCodeRuns Python code in the active Jupyter notebook's kernel.Yes

Jupyter execution always asks first

mcp__ide__executeCode cannot run anything silently. Each call inserts the code as a new cell and shows a native Quick Pick asking you to Execute or Cancel. This confirmation is separate from PreToolUse hooks — an allowlist entry only lets Claude propose a cell; the Quick Pick is what lets it actually run. The tool also refuses when there is no active notebook, when the Jupyter extension (ms-toolsai.jupyter) is not installed, or when the kernel is not Python.

Practical Tips

  • Keep one terminal session per repository or worktree. Use claude --worktree <branch> (-w) to start Claude in an isolated git worktree with its own files and branch.
  • Name branches by intent.
  • Use editor search for local symbol navigation and Claude Code search for cross-repo discovery.
  • Use Cmd+Esc / Ctrl+Esc to toggle focus between the editor and the Claude panel (VS Code), or to launch Claude Code from the editor (JetBrains).

Cmd+Esc does nothing on macOS Tahoe

On macOS Tahoe and later, the system Game Overlay shortcut is bound to Cmd+Esc and intercepts the keypress. Clear it under System Settings → Keyboard → Keyboard Shortcuts → Game Controllers, or rebind the Claude Code: Focus input command to a different key.

  • Reference terminal output in the VS Code extension with @terminal:name, where name is the terminal's title, so Claude can see logs and errors without copy-pasting.
  • Let browser verification capture UI regressions rather than relying on visual guesses. The VS Code extension can drive Chrome via @browser when the Claude in Chrome extension is installed.

Version History

DateChange
2026-05VS Code extension and JetBrains plugin documented as the two supported IDE surfaces; both share conversation history and ~/.claude/settings.json.
—/ide connects an external terminal session to the editor; integrated terminals auto-connect.
—Diff tool selection (auto vs terminal) configured via /config.
—Built-in ide MCP server exposes mcp__ide__getDiagnostics and mcp__ide__executeCode; Jupyter execution always prompts via a native Quick Pick.

Sources

Use Claude Code in VS Code · JetBrains IDEs

Related docs

Cmd. /ide

Codex Command Master · Include open files, selections, and IDE context in the next prompt.

Cmd. /ide

Claude Code Command Master · Shows the current session's IDE connection and integration target. File edits occur through subsequent requests and tool calls.

Codex App and IDE

Advanced Codex Usage · Use Codex across the app, terminal, and IDE without losing context discipline.

Cmd. /vim

Claude Code Command Master · Removed in v2.1.92; use /config Editor mode.

Cmd. /diff

Claude Code Command Master · Open the interactive uncommitted and per-turn diff viewer.

Context Management

Keep Claude Code sessions accurate through memory, compaction, and concise handoffs.

Headless and CI/CD

Run Claude Code in non-interactive workflows with clear inputs, outputs, and guardrails.

On this page

Effective SplitConnecting the IDEEditor ContextReview LoopThe built-in IDE MCP serverPractical TipsVersion History