Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Using Claude Code in JetBrains IDEs

Using Claude Code in JetBrains IDEs

Claude Code deeply integrates with JetBrains IDEs through a dedicated plugin, offering powerful features such as interactive diff viewing and code selection context sharing, seamlessly weaving AI-assisted programming into your development workflow.

Supported IDEs

The Claude Code plugin supports the vast majority of JetBrains IDEs, including:

Core Features

Function Description
Quick start On Mac, use Cmd+Esc, on Windows/Linux use Ctrl+Esc, to open Claude Code directly from the editor
Diff viewing Code changes are displayed directly in the IDE's diff viewer rather than in the terminal
Selection context sharing The currently selected code or tab content in the IDE is automatically shared with Claude Code
File reference shortcuts On Mac, use Cmd+Option+K, on Linux/Windows use Alt+Ctrl+K, to quickly insert a file reference in the form of @src/auth.ts#L1-99 a reference in this form
Diagnostic information sharing Diagnostic information such as lint errors and syntax errors in the IDE is automatically shared with Claude as you work

Installation and Configuration

Step 1: Install prerequisites

Before installing the JetBrains plugin, you need to install the Claude Code CLI first.

# macOS、Linux、WSL 安装

curl -fsSL https://claude.ai/install.sh | bash

# Windows PowerShell Installation

irm https://claude.ai/install.ps1 | iex



# Verify installation

claude --version

For detailed installation steps, please refer to the Claude Code installation guide。

Step 2: Install the JetBrains plugin

  1. Open your JetBrains IDE
  2. Enter Settings -> Plugins
  3. Switch to Marketplace tag
  4. Search Claude Code
  5. Click Install
  6. After installation is completeRestart the IDE

Step 3: Launch and connect Claude Code

Launch from the IDE's integrated terminal (recommended)

Run the following command in the IDE's built-in terminal, and all integration features will activate automatically:

claude

This is a welcome screen; after pressing Enter, you can start working:

Connect from an external terminal

If you are using an external terminal, you can use the /ide command to connect Claude Code to your JetBrains IDE:

# 先启动 Claude Code

claude



# Then execute the /ide command to connect to the IDE

/ide

💡 Tip: To ensure Claude can access the same files as the IDE, launch Claude Code from the IDE project root directory.

Step 4: Configure Claude Code

Configure the diff tool

After running Claude Code, set the diff display mode with the following steps:

# 启动 Claude Code

claude



# Enter configuration

/config

Set the diff tool to auto, and code changes will be displayed directly in the IDE diff viewer; set it to terminal to keep displaying in the terminal.

Configure plugin settings

Enter Settings → Tools → Claude Code [Beta], you can configure the following options:

💡 WSL users: Set the Claude command to wsl -d Ubuntu -- bash -lic "claude"(replace Ubuntu with your WSL distribution name).

Configure the ESC key (optional)

If both the ESC key cannot interrupt Claude Code operations; fix it with these steps:

  1. Enter Settings → Tools → Terminal
  2. Uncheck "Move focus to the editor with Escape", or click "Configure terminal keybindings" and delete "Switch focus to Editor" Keyboard shortcut
  3. Apply changes


Special scenario configuration

Remote Development

When using JetBrains Remote Development, the plugin must be installed on theremote host, not the local client machine.

Operation path:Settings → Plugin (Host)

WSL2 configuration

If you use Claude Code in a WSL2 environment and encounter a "No available IDEs detected" error, it is usually because WSL2's NAT networking or the Windows firewall is blocking the connection.

Solution 1: Add a Windows firewall rule (recommended)

# 第一步:在 WSL 中查看 IP 地址

hostname -I

# Example output 172.21.123.45, subnet is 172.21.0.0/16

# 第二步:以管理员身份打开 PowerShell,创建防火墙规则(根据你的子网调整 IP 范围)

New-NetFirewallRule -DisplayName "Allow WSL2 Internal Traffic" -Direction Inbound -Protocol TCP -Action Allow -RemoteAddress 172.21.0.0/16 -LocalAddress 172.21.0.0/16

Then restart the IDE and Claude Code for it to take effect.

Solution 2: Switch WSL2 to mirrored networking mode(requires Windows 11 22H2 or later)

In the .wslconfig file in your Windows user directory, add:

[wsl2]

networkingMode=mirrored

Then run in PowerShell: wsl --shutdown Restart WSL.


Troubleshooting common problems

Plugin features do not appear after installation

Prompt: "No available IDEs detected"

Clicking the Claude icon prompts "command not found"

  1. Run in the terminal: claude --version, to verify Claude Code is installed correctly
  2. Manually configure the Claude command path in the plugin settings
  3. WSL users, please use the WSL command format described above