How to Set Up Claude Code in IntelliJ IDEA (Step by Step)
Claude Code works in JetBrains IDEs through a Marketplace plugin plus the Claude CLI. IntelliJ shows diffs, shares your selection, and can pass inspection diagnostics to Claude.
In short: install the Claude Code CLI, install the Claude Code [Beta] plugin from the JetBrains Marketplace, restart IntelliJ, then run claude in the IDE terminal (or use Ctrl+Esc / Cmd+Esc). The same plugin family works in PyCharm, WebStorm, Android Studio, PhpStorm and GoLand.
Why Claude Code in IntelliJ
Many Java and Kotlin teams live in IntelliJ. The plugin keeps Claude next to your project, so you review changes in the IDE diff viewer instead of guessing from terminal text alone.
What you need
- Claude Code CLI: install first. The plugin does not bundle its own CLI; it runs the
claudecommand. - JetBrains plugin: Marketplace listing name: Claude Code [Beta]. Label may change; search “Claude Code” by Anthropic.
- Paid Claude access: any paid Claude plan (Pro, Max, Team, Enterprise) or a Claude Console account. Sign-in is prompted the first time you run
claude. - Supported IDEs: IntelliJ IDEA, PyCharm, WebStorm, Android Studio, PhpStorm, GoLand — same plugin family.
How setup flows
Install steps
- Install the CLI from the official Claude Code quickstart (same steps as the terminal guide). Check:
claude --version. - Open IntelliJ. Go to Settings → Plugins → Marketplace. Search Claude Code. Install Claude Code [Beta].
- Restart the IDE completely (not just the plugin).
- Open your project. Open the integrated terminal at the project root.
- Run
claude. Sign in when asked. - Or press Ctrl+Esc (Mac: Cmd+Esc) / use the Claude Code button if shown.
- External terminal? run
claude, then/ide, to connect. Success looks like “Connected to IntelliJ IDEA.”
Settings
- Plugin settings: Settings → Tools → Claude Code [Beta].
- Claude command: if the IDE cannot find the CLI, set the full path (examples from docs:
claude,/usr/local/bin/claude, ornpx @anthropic-ai/claude-code). - WSL (Windows): docs suggest a wrapper like
wsl -d Ubuntu -- bash -lic "claude"as the Claude command (adjust distro name). - Diff tool: with the IDE connected, in Claude run
/configand set Diff tool to auto (IDE) or terminal. - File refs: Alt+Ctrl+K (Mac: Cmd+Option+K) inserts a file reference such as
@src/Auth.java#L1-99. - PyCharm / WebStorm / others: install the same Marketplace plugin in that IDE and repeat the restart + terminal steps.
Configuration
- Put short project rules in
CLAUDE.mdat the project root (or run/initin Claude). - Shared deny rules live in
~/.claude/settings.json(same file as the CLI). - Start Claude from the same root as the IDE project so file paths match.
# Project rules - Language: Java 21 (or Kotlin if this module is Kotlin) - Build: Maven or Gradle — run tests before you finish - Style: short methods, clear names - Never read or edit .env, secrets/, or deploy scripts~/.claude/settings.json (snippet)
{
"permissions": {
"deny": ["Read(./.env)", "Read(./secrets/**)"]
}
}First task (5 minutes)
- Open a small Java or Kotlin class.
- Select a method. Ask: “Add input checks and a unit test for this method. Show the plan first.”
- Use Plan / approval so you see the plan before edits.
- Review the IDE diff. Accept only the lines you understand.
- Approve the test command when asked. Run the tests yourself once more.
In this selection only: add null/empty checks and a unit test. Do not touch other packages. Do not read .env.
| Feature | What you get |
|---|---|
| Selection context | Current selection/tab shared with Claude (Read deny rules can block paths) |
| Diff viewing | Changes open in the IDE diff viewer when Diff tool is auto |
| Diagnostics | Claude can call getDiagnostics for inspections (lint/syntax) |
| Devcontainers | Some IntelliJ 2026 remote/devcontainer setups may not connect — check Anthropic docs/issues if /ide fails |
- Do not enable bypass-permissions on a machine with real secrets.
- Company policy may ban cloud AI — ask before connecting work repos.
Quick quiz
1. What must you install before the IntelliJ plugin works?
The Claude Code CLI (claude on PATH, or a full path in plugin settings).
2. What is the Marketplace plugin called?
Claude Code [Beta] (search Claude Code; label may change).
3. Same plugin in PyCharm?
Yes — same JetBrains plugin family (PyCharm, WebStorm, Android Studio, and others listed in Anthropic docs).
4. External terminal: how do you connect?
Run claude, then /ide.
Save tokens and money
Select one method, not the whole module. Keep CLAUDE.md short. Prefer Plan for multi-file work. New chat per task.