Skip to main content
Claude Code’s IDE integration lets your editor and the CLI work together. When connected, Claude Code can see your open files and cursor position, and can send diffs back to your IDE for review — eliminating the context-switching between terminal and editor.

How the bridge works

The bridge is a bidirectional communication layer between the CLI and IDE extensions. Once connected:
  • The IDE extension sends the currently open file, cursor position, and selected text to Claude Code as additional context.
  • Claude Code can send file diffs to the IDE for inline review, rather than applying them directly.
  • The connection is authenticated with a short-lived JWT so only the local extension can communicate with the running CLI process.
The bridge runs as part of the claude process when the BRIDGE_MODE feature flag is active. It exposes a local HTTP/WebSocket endpoint that the IDE extension connects to.

Setting up VS Code integration

1

Install the VS Code extension

Search for Claude Code in the VS Code Extensions marketplace and install it, or install it from the command line:
code --install-extension anthropic.claude-code
2

Open a project in VS Code

Open the project directory you want to work with. The extension activates per workspace.
3

Start Claude Code in the integrated terminal

Open the VS Code integrated terminal and start Claude Code:
claude
The extension detects the running Claude Code process and connects automatically via the local bridge.
4

Verify the connection

Run the /ide command inside Claude Code:
/ide
This shows the current bridge connection status. When connected to VS Code, you should see the IDE name and the active file reported.

Setting up JetBrains integration

1

Install the JetBrains plugin

Open your JetBrains IDE (IntelliJ IDEA, PyCharm, WebStorm, etc.) and go to Settings → Plugins → Marketplace. Search for Claude Code and install it.Alternatively, install from the JetBrains Marketplace website and drag the .zip into the plugin manager.
2

Open your project

Open the project directory in your JetBrains IDE. The plugin activates per project.
3

Start Claude Code in the built-in terminal

Open the built-in terminal (View → Tool Windows → Terminal) and run:
claude
The plugin connects to the running CLI process automatically.
4

Verify the connection

Run /ide inside the CLI session to confirm the bridge is connected:
/ide
You should see the JetBrains IDE reported as the connected environment. The plugin adds a Claude Code panel in the IDE toolbar for quick access to the terminal session.

Bridge features

Once connected, the following features are available:

File and cursor context

The IDE sends the currently focused file path, cursor line/column, and any selected text with each message Claude Code processes. Claude uses this context automatically — you don’t need to copy-paste file names or tell Claude where you are in the codebase.

Diff viewing in the IDE

When Claude makes file changes, it can send diffs to the IDE’s built-in diff viewer instead of applying them inline. This lets you review changes before accepting them, using your editor’s familiar diff interface.

MCP integration

When connected to an IDE, Claude Code registers an internal sse-ide or ws-ide MCP transport that routes tool calls back through the IDE extension. This allows IDE-specific features (like opening files, navigating to symbols, or running tasks) to be exposed as MCP tools.

The /ide command

Run /ide at any time to check the connection status:
/ide
The output shows:
  • Whether a bridge is connected
  • The name of the connected IDE
  • The currently active file (if any)
  • Connection health

The /desktop and /mobile commands

/desktop and /mobile trigger a handoff to the corresponding Claude app. This is useful when you want to continue a conversation in the desktop GUI or on mobile after starting it in the CLI:
/desktop
This generates a session handoff link that opens the current conversation in the Claude desktop application.
/mobile
This generates a QR code or deep link to continue the session on the Claude mobile app.

JWT authentication

The bridge uses short-lived JWTs (JSON Web Tokens) to authenticate IDE connections. The JWT:
  • Is generated by the CLI when the bridge starts
  • Has a configurable expiry (default: ~4 hours, refreshed automatically 5 minutes before expiry)
  • Is delivered to the IDE extension via a local handshake over localhost
  • Is validated on each request to the bridge endpoint
The refresh cycle is managed automatically. If the JWT expires during an active session, the extension triggers a reconnect flow to obtain a fresh token. No manual action is required.
JWT-based auth ensures that only the IDE extension running on the same machine can connect to the bridge — not other processes or remote connections.

Troubleshooting

  • Confirm the IDE extension is installed and enabled for the current workspace.
  • Make sure Claude Code was started from the IDE’s built-in terminal, not an external terminal.
  • Try restarting the CLI session (/exit and claude again) while the IDE is open.
  • Check the extension’s output panel for connection errors.
  • Make sure a file is open and focused in the editor.
  • Some IDE configurations require the extension to have workspace trust enabled.
  • Run /ide to confirm the bridge reports the current file path correctly.
  • Diff viewing requires the IDE extension version 1.2.0 or later.
  • Ensure the extension’s diff viewer feature is enabled in extension settings.
  • If diffs are still applied directly, the extension may have fallen back to standard file writes.

MCP servers

MCP transports used internally by the IDE bridge.

Configuration

Configure session behavior and feature flags.

Headless mode

Run Claude Code non-interactively in CI and scripts.

Troubleshooting

Diagnose common issues with Claude Code.

Build docs developers (and LLMs) love