Claude Code for JetBrains: Plugin Setup, Diffs, and WSL
Claude Code's JetBrains integration is different from its VS Code extension. There is no chat panel: the plugin runs the claude CLI in the IDE's integrated terminal and connects it to the IDE, so Claude's edits open in the IDE's diff viewer, your current selection is shared as context, and Claude can read the IDE's inspection results. It works with IntelliJ IDEA, PyCharm, Android Studio, WebStorm, PhpStorm, GoLand, and most other JetBrains IDEs.
This guide follows Anthropic's JetBrains documentation: what to install, how to launch and connect, configuration, the security issue specific to JetBrains, remote development and WSL2, and troubleshooting. For the VS Code equivalent, see Claude Code in VS Code; for the CLI basics, see Getting Started with Claude Code.
Install the CLI and the plugin
The plugin does not bundle Claude Code. It runs the claude command in the IDE's terminal, so you need both pieces:
1. Install the Claude Code CLI (for example curl -fsSL https://claude.ai/install.sh | bash on macOS, Linux, or WSL) and check it with claude --version.
2. Install the Claude Code [Beta] plugin from the JetBrains Marketplace and restart the IDE.
If the plugin shows "Cannot launch Claude Code", the IDE cannot find claude on its PATH. Set the full path under Settings > Tools > Claude Code [Beta] > Claude command, for example /usr/local/bin/claude. On Windows with WSL, set the command to run inside your distribution:
1wsl -d Ubuntu -- bash -lic "claude"Any paid Claude plan (Pro, Max, Team, or Enterprise) or a Claude Console account works. You log in the first time you run claude.
Quick reference
- IDEs launched from a desktop icon often get a shorter
PATHthan your terminal, which is the usual cause of "command not found". - The plugin's Enable automatic updates setting applies plugin updates on restart; the CLI updates itself separately if you used the native installer.
- On macOS, Enable using Option+Enter for multi-line prompts controls whether Option+Enter inserts a new line; disable it if Option is captured unexpectedly.
Remember this
Install the CLI first, then the plugin; if the plugin cannot launch Claude, give it the full path to claude.
Launch, connect, and reference code
Run claude in the IDE's integrated terminal, or press Cmd+Esc (Mac) / Ctrl+Esc (Windows, Linux), or click the Claude Code button. Started that way, every integration feature is active. Start it from the project root so Claude sees the same files as the IDE.
From an external terminal, start claude in the project directory and run /ide. Claude Code confirms with a message such as Connected to IntelliJ IDEA. If it finds a running IDE without the plugin, /ide installs the plugin and asks you to restart.
Once connected:
- Diffs open in the IDE's diff viewer instead of the terminal. Run
/configand set Diff tool toauto(IDE) orterminal. The option appears only while connected. - Selection context: the current selection or tab is shared with Claude automatically.
- File references:
Cmd+Option+K(Mac) orAlt+Ctrl+K(Windows, Linux) inserts a reference such as@src/auth.ts#L1-99. - Diagnostics: Claude can call
getDiagnosticsto read inspection results such as lint and syntax errors for a file. It does this when it decides to, not automatically after every edit, so ask it to check the IDE's problems when that matters.
Quick reference
- If
Escmoves focus to the editor instead of interrupting Claude, go to Settings > Tools > Terminal and uncheck "Move focus to the editor with Escape", or delete the "Switch focus to Editor" terminal keybinding. - Ask explicitly: "after the change, check the IDE diagnostics for this file and fix any errors". That turns diagnostics into a check Claude runs.
- The plugin is labelled Beta in the Marketplace; expect settings names and behaviour to change between releases.
Remember this
Start claude from the IDE terminal (or /ide from outside), set the diff tool to auto, and ask for diagnostics when you want them.
Security: edit approval and the IDE server
Anthropic's docs call out one JetBrains-specific risk. In acceptEdits mode (and in auto mode, which also approves edits inside the working directory), Claude may be able to modify IDE configuration files that the IDE can execute automatically. That can effectively bypass Claude Code's permission prompts for Bash commands. The recommendations are to use Manual mode for edits in JetBrains IDEs, use Claude only with trusted prompts, and know which files it can modify.
The integration also runs a local MCP server named ide, which the CLI connects to automatically. It listens on an ephemeral port using unencrypted ws://. Each IDE start writes a fresh auth token to ~/.claude/ide/<port>.lock, and the CLI must present it to connect. Only one tool is visible to the model, mcp__ide__getDiagnostics, and unlike VS Code the JetBrains plugin exposes no code-execution tool.
By default the server listens on 127.0.0.1 only. Settings > Tools > Claude Code [Beta] > Networking (Advanced) > Accept connections from all network interfaces makes it reachable from your local network, and then both the session traffic and the token cross the network in cleartext. Turn it on only when loopback cannot work.
Quick reference
- Selected text and the open-file notice are shared automatically. A
Readdeny rule for a path, such asRead(./.env), blocks both for that file. - A message you queue while Claude works keeps the selection you had when you pressed Enter.
- If your organisation allowlists MCP tools with a PreToolUse hook, include
mcp__ide__getDiagnostics.
Remember this
Prefer Manual mode in JetBrains IDEs, deny reads of secret files, and keep the IDE server on loopback.
Remote development and WSL2
With JetBrains Remote Development, install the plugin on the remote host (Settings > Plugin (Host)), not on your local client. Claude Code runs where the code is.
On WSL2, a common failure is /ide reporting "No available IDEs detected". The IDE runs on Windows, Claude Code runs inside WSL2, and WSL2's default NAT networking or Windows Firewall blocks the connection between them. WSL1 uses the host network directly and is not affected. There are two fixes.
Allow WSL2 traffic through Windows Firewall (recommended, keeps your networking mode). Find the WSL address with hostname -I, take its first two segments plus .0.0/16 as the subnet, and in an administrator PowerShell run:
1New-NetFirewallRule -DisplayName "Allow WSL2 Internal Traffic" -Direction Inbound -Protocol TCP -Action Allow -RemoteAddress 172.21.0.0/16 -LocalAddress 172.21.0.0/16Or switch WSL2 to mirrored networking (Windows 11 22H2 or later) by adding this to .wslconfig in your Windows user directory, then running wsl --shutdown:
1[wsl2]2networkingMode=mirroredMirrored networking shares the Windows loopback interface with WSL, so the IDE server can stay on 127.0.0.1 and you do not need the all-interfaces setting.
Quick reference
- Restart both the IDE and Claude Code after adding the firewall rule.
- Adjust the subnet to your own
hostname -Ioutput;172.21.0.0/16is only the example. - Avoid fixing WSL2 by enabling Accept connections from all network interfaces; it exposes the token and traffic in cleartext.
Remember this
On WSL2, fix the network path with a firewall rule or mirrored networking, not by opening the IDE server to the network.
Troubleshooting
Most problems come down to two things: the plugin cannot find or launch claude, or the CLI cannot reach the IDE's local server. Work from the CLI side first: claude --version in a normal terminal, then /ide from inside Claude Code, which reports whether it found an IDE.
The docs also note that a JetBrains IDE sometimes needs a complete restart, occasionally more than once, before the plugin's features appear.
| Symptom | Likely cause | Fix |
|---|---|---|
| Clicking the Claude icon says command not found | IDE cannot find claude | Check claude --version, set the Claude command path, use the WSL command on Windows |
| /ide says No available IDEs detected | Plugin missing or disabled; WSL2 networking | Enable the plugin, restart the IDE fully, apply the WSL2 fix |
| Plugin installed but no integration | Not started from project root, or remote host lacks plugin | Run claude from the project root; install the plugin on the remote host |
| Esc does not interrupt Claude | Terminal Escape moves focus to the editor | Change the terminal Escape setting or keybinding |
| Diffs show in the terminal | Diff tool set to terminal, or not connected | Connect with /ide, then set Diff tool to auto in /config |
Quick reference
- If
/ideconnects but diffs still open in the terminal, the Diff tool setting is the cause. - If integration works in the IDE terminal but not an external one, run
/ideand start from the project root. - For install or login problems outside the IDE, the CLI's own installation troubleshooting applies.
Remember this
Check claude --version, then /ide; most failures are a missing path or a blocked connection.
Hands-on: connect and use diagnostics
Use a project that has at least one inspection warning in the IDE.
1. Install the CLI and the plugin, restart the IDE, and open the project.
2. Press Cmd+Esc / Ctrl+Esc. In the Claude session, run /config and set Diff tool to auto.
3. Switch to Manual mode with Shift+Tab.
4. Open a file with a warning, select a function, press Cmd+Option+K / Alt+Ctrl+K, and ask: "fix the IDE's warnings in this function, then check the diagnostics again".
5. Review the change in the IDE diff viewer and accept it.
6. Add "deny": ["Read(./.env)"] to .claude/settings.json, select text in .env, and ask Claude what it sees.
Pass criterion: the diff opened in the IDE, Claude reported the diagnostics before and after its fix, and it could not see the .env selection.
Quick reference
- If the diff opened in the terminal, Claude Code is not connected; run
/ide. - If Claude did not call diagnostics, say so explicitly in the prompt; it does not do it automatically after edits.
- On WSL2, complete the firewall or mirrored-networking step before step 2.
Remember this
Connected diffs, explicit diagnostics, and a deny rule are the three things to verify on day one.
Key takeaway
Claude Code in JetBrains IDEs is the CLI running in the IDE's terminal, connected through a local ide server that opens diffs in the IDE, shares your selection, and lets Claude read inspection diagnostics on request. Install the CLI and the plugin separately, start Claude from the project root or connect with /ide, and set the diff tool to auto.
Two JetBrains-specific cautions matter. Auto-approved edits can change IDE configuration that the IDE runs, so Manual mode is the safer default there. And on WSL2, fix connectivity with a firewall rule or mirrored networking rather than exposing the IDE server to the network. For the rules that keep secret files out of context, see Claude Code Permissions.
Practice (20 min): run the six steps above, then decide which permission mode you will use by default in your JetBrains projects.
References
- Claude Code docs: JetBrains IDEs — checked Oct 17, 2026
- Claude Code docs: Choose a permission mode — checked Oct 17, 2026
Shoaib Hossain
Lead Author & Systems ArchitectSoftware engineer and distributed systems architect specializing in backend scalability, cloud-native infrastructure, databases, and AI engineering workflows. Author and maintainer of Core Concept Learning.
Related Articles
Explore this topic