JetBrains IDE Integration Guide

Comprehensive guide for integrating Claude Code with the JetBrains family of IDEs including IntelliJ IDEA, WebStorm, PyCharm, and others.

🎯 Integration Options

1. Claude Code Plugin (Official Beta)

  • Direct integration with Claude Code CLI
  • Supports all JetBrains IDEs
  • Real-time code suggestions

2. JetBrains AI Assistant

  • Built-in IDE feature
  • Supports Claude models via Amazon Bedrock
  • Requires separate subscription

πŸ”§ Installation

Method 1: Claude Code Plugin

Via Plugin Marketplace

  1. Open IDE β†’ Settings/Preferences (Cmd+, / Ctrl+Alt+S)
  2. Navigate to Plugins β†’ Marketplace
  3. Search for β€œClaude Code [Beta]”
  4. Click Install β†’ Restart IDE

Via Disk Installation

# Download the plugin
curl -L https://releases.anthropic.com/claude-code/jetbrains/latest.zip -o claude-code-plugin.zip
 
# Install via IDE
# Settings β†’ Plugins β†’ βš™οΈ β†’ Install Plugin from Disk

CLI Installation

# Ensure Claude Code is installed
claude --version
 
# Install JetBrains plugin
claude install-extension jetbrains

Method 2: JetBrains AI Assistant with Claude

Requirements

  • JetBrains IDE version 24.3.2 or later
  • AI Assistant subscription
  • Amazon Bedrock account (for Claude models)

Setup

  1. Install AI Assistant plugin
  2. Configure Amazon Bedrock credentials
  3. Select Claude model in AI Assistant settings

βš™οΈ Configuration

Claude Code Plugin Settings

<!-- .idea/claude-code.xml -->
<component name="ClaudeCodeSettings">
  <option name="apiKey" value="${ANTHROPIC_API_KEY}" />
  <option name="model" value="claude-4-opus" />
  <option name="contextScope" value="PROJECT" />
  <option name="enableInlineHints" value="true" />
  <option name="maxContextSize" value="100000" />
</component>

IDE-Specific Settings

IntelliJ IDEA

<!-- .idea/workspace.xml -->
<component name="ClaudeCodeWorkspace">
  <option name="javaVersion" value="17" />
  <option name="framework" value="spring-boot" />
  <option name="buildTool" value="gradle" />
</component>

WebStorm

// .idea/claude-code-webstorm.json
{
  "projectType": "react-typescript",
  "lintingRules": "eslint",
  "testFramework": "jest",
  "enableTypeScriptStrictMode": true
}

PyCharm

// .idea/claude-code-pycharm.json
{
  "pythonVersion": "3.11",
  "framework": "django",
  "linting": ["flake8", "black"],
  "testFramework": "pytest"
}

πŸš€ Key Features

1. Intelligent Code Completion

// Type and wait for suggestions
public class UserService {
    // Claude suggests implementation based on class name
    @Autowired
    private UserRepository repository;
    
    // Press Ctrl+Space for Claude suggestions
    public User findById(Long id) {
        // Claude completes with error handling
    }
}

2. Refactoring Assistant

// Select code β†’ Right-click β†’ Claude Code β†’ Refactor
class LegacyHandler {
    // Claude suggests modern Kotlin patterns
    fun processData(data: List<Any>): String {
        // Selected for refactoring
    }
}

3. Test Generation

# Right-click on function β†’ Claude Code β†’ Generate Tests
def calculate_fibonacci(n: int) -> int:
    """Calculate nth Fibonacci number"""
    # Claude generates comprehensive pytest suite

4. Documentation Generation

// Cursor on class/method β†’ Alt+Enter β†’ Generate Documentation
export class AuthenticationService {
    // Claude generates JSDoc with examples
    async validateToken(token: string): Promise<boolean> {
        // Implementation
    }
}

πŸ› οΈ Advanced Features

Custom Intentions

<!-- .idea/claude-intentions.xml -->
<component name="ClaudeCodeIntentions">
  <intention>
    <name>Convert to Functional Style</name>
    <pattern>for\s*\(.*\)</pattern>
    <prompt>Convert this loop to functional style using map/filter/reduce</prompt>
  </intention>
  <intention>
    <name>Add Error Handling</name>
    <pattern>async\s+\w+</pattern>
    <prompt>Add comprehensive error handling to this async function</prompt>
  </intention>
</component>

Live Templates Integration

<!-- .idea/templates/claude.xml -->
<templateSet group="Claude Code">
  <template name="cltest" value="// @claude generate tests for $SELECTION$" />
  <template name="clrefactor" value="// @claude refactor for $PATTERN$" />
  <template name="cldoc" value="// @claude document this $TYPE$" />
</templateSet>

Build Tool Integration

Gradle

// build.gradle
task claudeReview(type: Exec) {
    commandLine 'claude', 'review', 'src/main/java'
    doLast {
        println "Claude Code review completed"
    }
}

Maven

<!-- pom.xml -->
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>claude-review</id>
            <phase>verify</phase>
            <goals><goal>exec</goal></goals>
            <configuration>
                <executable>claude</executable>
                <arguments>
                    <argument>review</argument>
                    <argument>src/main/java</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

🎨 UI Customization

Tool Windows

<!-- Configure Claude Code tool window -->
<component name="ClaudeCodeToolWindow">
  <option name="position" value="RIGHT" />
  <option name="width" value="400" />
  <option name="autoHide" value="false" />
</component>

Keyboard Shortcuts

<!-- keymap.xml -->
<keymap version="1" name="Claude Code">
  <action id="ClaudeCode.AskQuestion">
    <keyboard-shortcut first-keystroke="ctrl shift A" />
  </action>
  <action id="ClaudeCode.RefactorSelection">
    <keyboard-shortcut first-keystroke="ctrl alt shift R" />
  </action>
  <action id="ClaudeCode.GenerateTests">
    <keyboard-shortcut first-keystroke="ctrl shift T" />
  </action>
</keymap>

πŸ“Š Performance Optimization

Memory Settings

# idea.properties
claude.code.max.memory=2048m
claude.code.context.cache=true
claude.code.cache.size=500m

Indexing Optimization

<!-- .idea/claude-code-index.xml -->
<component name="ClaudeCodeIndexing">
  <excludeFromIndex>
    <directory>node_modules</directory>
    <directory>build</directory>
    <directory>.gradle</directory>
    <pattern>*.min.js</pattern>
  </excludeFromIndex>
</component>

πŸ” Troubleshooting

Plugin Not Loading

# Check IDE logs
tail -f ~/Library/Logs/JetBrains/IntelliJIdea/idea.log
 
# Verify plugin installation
ls ~/Library/Application\ Support/JetBrains/IntelliJIdea*/plugins/

API Connection Issues

  1. Verify API key in Settings β†’ Tools β†’ Claude Code
  2. Check proxy settings if behind corporate firewall
  3. Test connection: Help β†’ Claude Code β†’ Test Connection

Performance Issues

# Increase IDE memory
-Xmx4096m
-XX:ReservedCodeCacheSize=512m

πŸ’‘ Pro Tips

1. Context Scoping

// Use @claude-context to limit scope
// @claude-context: UserService, UserRepository
public class UserController {
    // Claude only considers specified classes
}

2. Project-Specific Prompts

# .idea/claude-prompts.properties
refactor.prompt=Refactor following our team's style guide and SOLID principles
test.prompt=Generate tests with 90% coverage including edge cases
review.prompt=Review for security vulnerabilities and performance issues

3. Integration with Version Control

<!-- .idea/vcs.xml -->
<component name="ClaudeCodeVCS">
  <option name="reviewOnCommit" value="true" />
  <option name="generateCommitMessage" value="true" />
</component>

πŸ”— Resources

πŸ—ΊοΈ Navigation

← Cursor Guide | IDE Integration | Advanced Patterns β†’