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.
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
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:
Open a project in VS Code
Open the project directory you want to work with. The extension activates per workspace.
Start Claude Code in the integrated terminal
Open the VS Code integrated terminal and start Claude Code:The extension detects the running Claude Code process and connects automatically via the local bridge.
Setting up JetBrains integration
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.Open your project
Open the project directory in your JetBrains IDE. The plugin activates per project.
Start Claude Code in the built-in terminal
Open the built-in terminal (View → Tool Windows → Terminal) and run:The plugin connects to the running CLI process automatically.
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 internalsse-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:
- 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:
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
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
The /ide command shows 'not connected'
The /ide command shows 'not connected'
- 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 (
/exitandclaudeagain) while the IDE is open. - Check the extension’s output panel for connection errors.
File context is not appearing
File context is not appearing
- Make sure a file is open and focused in the editor.
- Some IDE configurations require the extension to have workspace trust enabled.
- Run
/ideto confirm the bridge reports the current file path correctly.
Diffs are not appearing in the IDE
Diffs are not appearing in the IDE
- 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.
Related pages
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.