Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2 · SETUP

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

WHY

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

WHAT
  • Claude Code CLI: install first. The plugin does not bundle its own CLI; it runs the claude command.
  • 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

1 · Install CLI claude on PATH 2 · Install plugin Marketplace → Claude Code [Beta] 3 · Restart IDE full restart 4 · Run claude IDE terminal at project root 5 · Review diffs accept only what you understand

Install steps

HOW
  1. Install the CLI from the official Claude Code quickstart (same steps as the terminal guide). Check: claude --version.
  2. Open IntelliJ. Go to Settings → Plugins → Marketplace. Search Claude Code. Install Claude Code [Beta].
  3. Restart the IDE completely (not just the plugin).
  4. Open your project. Open the integrated terminal at the project root.
  5. Run claude. Sign in when asked.
  6. Or press Ctrl+Esc (Mac: Cmd+Esc) / use the Claude Code button if shown.
  7. External terminal? run claude, then /ide, to connect. Success looks like “Connected to IntelliJ IDEA.”

Settings

  1. Plugin settings: Settings → Tools → Claude Code [Beta].
  2. Claude command: if the IDE cannot find the CLI, set the full path (examples from docs: claude, /usr/local/bin/claude, or npx @anthropic-ai/claude-code).
  3. WSL (Windows): docs suggest a wrapper like wsl -d Ubuntu -- bash -lic "claude" as the Claude command (adjust distro name).
  4. Diff tool: with the IDE connected, in Claude run /config and set Diff tool to auto (IDE) or terminal.
  5. File refs: Alt+Ctrl+K (Mac: Cmd+Option+K) inserts a file reference such as @src/Auth.java#L1-99.
  6. PyCharm / WebStorm / others: install the same Marketplace plugin in that IDE and repeat the restart + terminal steps.

Configuration

  1. Put short project rules in CLAUDE.md at the project root (or run /init in Claude).
  2. Shared deny rules live in ~/.claude/settings.json (same file as the CLI).
  3. Start Claude from the same root as the IDE project so file paths match.
CLAUDE.md
# 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)

  1. Open a small Java or Kotlin class.
  2. Select a method. Ask: “Add input checks and a unit test for this method. Show the plan first.”
  3. Use Plan / approval so you see the plan before edits.
  4. Review the IDE diff. Accept only the lines you understand.
  5. Approve the test command when asked. Run the tests yourself once more.
SAFE FIRST PROMPT

In this selection only: add null/empty checks and a unit test. Do not touch other packages. Do not read .env.

FeatureWhat you get
Selection contextCurrent selection/tab shared with Claude (Read deny rules can block paths)
Diff viewingChanges open in the IDE diff viewer when Diff tool is auto
DiagnosticsClaude can call getDiagnostics for inspections (lint/syntax)
DevcontainersSome IntelliJ 2026 remote/devcontainer setups may not connect — check Anthropic docs/issues if /ide fails
Rule: the Marketplace name still includes [Beta]. Treat UI labels as changeable; follow the current Anthropic JetBrains docs if a menu moved.
  • 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

SMART AI USE

Select one method, not the whole module. Keep CLAUDE.md short. Prefer Plan for multi-file work. New chat per task.

Save these cards

INTERVIEW CARDAI Coding

Claude Code in IntelliJ?

JetBrains plugin + Claude CLI.
Diffs, selection context, diagnostics; paid Claude plan.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

IntelliJ Claude vs VS Code Claude

Both: agent + CLAUDE.md + approvals.
IntelliJ: Marketplace plugin drives CLI in the IDE terminal.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

IntelliJ Claude in 4

CLI → plugin → restart.
claude in IDE terminal (or /ide).
CLAUDE.md + deny .env.
Ravindra Bagale · ravindrabagale.com/ai-coding