Claude Code in JetBrains IDEs — IntelliJ, PyCharm, WebStorm
Claude Code has no JetBrains plugin, but it integrates naturally through the built-in terminal. You get full agentic editing, multi-file tasks, and automated builds — JetBrains shows the file changes live as Claude makes them. This guide covers every JetBrains IDE: IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, and CLion.
Terminal Setup
Open the terminal tab with Alt+F12 (Windows/Linux) or Opt+F12 (macOS). Make sure you are in your project root (JetBrains opens the terminal there by default). Then:
# Install Claude Code if not installed
npm install -g @anthropic-ai/claude-code
# Start a session
claude
# Or give a one-shot task
claude "add input validation to all REST endpoints"
JetBrains detects file changes made externally and reloads them automatically. You will see Claude's edits appear in the editor in real time without manual refresh.
CLAUDE.md for JetBrains Projects
Create CLAUDE.md at the project root. The key is describing your build system so Claude runs the right commands:
IntelliJ IDEA / Java / Kotlin (Maven)
# Project: [App Name]
## Stack
- Java 21 / Kotlin 1.9
- Spring Boot 3.x
- Maven, pom.xml at root
- JUnit 5 + Mockito
## Commands
```bash
mvn compile # compile only
mvn test # run all tests
mvn test -Dtest=UserServiceTest # single test class
mvn spring-boot:run # start dev server
mvn package -DskipTests # build JAR
```
## Architecture
- src/main/java/com/example/
- controller/ — REST endpoints (@RestController)
- service/ — business logic (@Service)
- repository/ — JPA repos (@Repository)
- model/ — JPA entities + DTOs
- src/test/java/ — mirrors main/
## Conventions
- All new services need unit + integration tests
- Use @Transactional on service methods that modify state
- DTOs for all API request/response bodies (never expose entities directly)
IntelliJ IDEA / Java / Kotlin (Gradle)
## Commands
```bash
./gradlew compileJava
./gradlew test
./gradlew test --tests "com.example.UserServiceTest"
./gradlew bootRun
./gradlew build -x test
```
PyCharm / Python
# Project: [App Name]
## Stack
- Python 3.12, venv at .venv/
- FastAPI 0.115 / Django 5.x
- pytest for testing
## Commands
```bash
source .venv/bin/activate && pytest --tb=short -q
source .venv/bin/activate && uvicorn app.main:app --reload
source .venv/bin/activate && python manage.py runserver
```
## PyCharm note
Always prefix Python commands with: source .venv/bin/activate &&
WebStorm / TypeScript / Node.js
# Project: [App Name]
## Stack
- Node.js 20, TypeScript 5.x
- Next.js 15 App Router
- pnpm (lockfile: pnpm-lock.yaml)
- Vitest for unit tests, Playwright for e2e
## Commands
```bash
pnpm dev # start dev server
pnpm test # run vitest
pnpm test:e2e # run playwright
pnpm build # production build
pnpm type-check # tsc --noEmit
```
Automated Build Hooks
Add .claude/settings.json at your project root to run tests automatically after every file edit:
Gradle auto-test hook
// .claude/settings.json
{
"allowedTools": ["Edit", "Write", "Bash", "Read"],
"hooks": [
{
"event": "PostToolUse",
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "cd $PROJECT_ROOT && ./gradlew test --continue 2>&1 | tail -30"
}]
}
]
}
Maven auto-test hook
{
"hooks": [
{
"event": "PostToolUse",
"matcher": "Edit|Write",
"hooks": [{
"type": "command",
"command": "cd $PROJECT_ROOT && mvn test -q 2>&1 | tail -30"
}]
}
]
}
Use
--continue (Gradle) or -q (Maven) to keep output concise. Claude sees test failures and fixes them in the same turn.Claude Code vs JetBrains AI Assistant
| Capability | Claude Code | JetBrains AI Assistant |
|---|---|---|
| Inline code completion | No (terminal-based) | Yes (grey ghost text) |
| Multi-file autonomous edits | Yes — primary strength | Limited (single file) |
| Run tests & fix failures | Yes — iterates automatically | No |
| Understand full codebase | Yes — reads all files | Partial (context window) |
| Agentic task completion | Yes — "add pagination to all endpoints" | No |
| IDE UI integration | No (terminal only) | Deep (editor, refactor menus) |
| Price | $20–$100/mo Claude plan | Included in JetBrains subscription |
Common JetBrains + Claude Code Workflows
Refactor a large class
claude "the UserService class in src/main/java/com/example/service/UserService.java
is 800 lines. Split it into UserAuthService (auth methods) and UserProfileService
(profile/settings methods). Update all callers. Run mvn test to verify nothing breaks."
Add tests for untested service
claude "write comprehensive JUnit 5 tests for OrderService.
Cover: createOrder, cancelOrder, getOrdersByUser.
Use Mockito to mock the OrderRepository.
Target 90% line coverage. Run mvn test to verify."
Spring Boot 2 → 3 migration
claude "migrate this project from Spring Boot 2.7 to Spring Boot 3.2.
Update pom.xml dependencies. Replace javax.* imports with jakarta.*.
Fix any deprecated API usages. Run mvn test after each batch of changes."
Database migration (Flyway)
claude "create a Flyway migration to add a 'status' column (VARCHAR 20, NOT NULL,
DEFAULT 'active') to the orders table. Add the corresponding JPA entity field
and update any queries that need the new column."
GoLand / Go Projects
# CLAUDE.md for Go projects
## Stack
- Go 1.22
- Module: github.com/yourorg/yourproject
- Testing: go test ./...
- Linter: golangci-lint
## Commands
```bash
go build ./...
go test ./... -v
go test ./... -run TestUserService
golangci-lint run
```
## Conventions
- All exported functions have doc comments
- Errors wrapped with fmt.Errorf("...: %w", err)
- Context is always the first parameter
- Interfaces defined at usage site, not definition site
See also: Claude Code for Go — complete guide
5 Tips for JetBrains + Claude Code
- Split-view the terminal and editor. JetBrains supports dragging the terminal tab to a split — watch Claude's edits appear live.
- Use the "Local History" feature (right-click → Local History) to see every change Claude made to a file. Better than git diff for granular review.
- Add
.claude/to your.gitignoreif your settings.json contains API keys or local paths. - For Kotlin projects, tell Claude in CLAUDE.md: "Prefer Kotlin idioms: data classes, extension functions, coroutines. Never generate Java-style verbosity."
- Large Spring projects: add a
ARCHITECTURE.mdthat Claude reads via CLAUDE.md. Describe your bounded contexts, shared kernel, and anti-corruption layers so Claude respects your DDD boundaries.