6.1 KiB
IDE Integration
Use Claude Code with Visual Studio Code and JetBrains IDEs.
Visual Studio Code
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "Claude Code"
- Click Install
- Authenticate with API key
Features
Inline Chat
- Press Ctrl+I (Cmd+I on Mac)
- Ask questions about code
- Get suggestions in context
- Apply changes directly
Code Actions
- Right-click on code
- Select "Ask Claude"
- Get refactoring suggestions
- Fix bugs and issues
Diff View
- See proposed changes
- Accept/reject modifications
- Review before applying
- Staged diff comparison
Terminal Integration
- Built-in Claude terminal
- Run commands via Claude
- Execute tools directly
- View real-time output
Configuration
.vscode/settings.json:
{
"claude.apiKey": "${ANTHROPIC_API_KEY}",
"claude.model": "claude-sonnet-4-5-20250929",
"claude.maxTokens": 8192,
"claude.autoSave": true,
"claude.inlineChat.enabled": true,
"claude.terminalIntegration": true
}
Keyboard Shortcuts
Default shortcuts:
Ctrl+I: Inline chatCtrl+Shift+C: Open Claude panelCtrl+Shift+Enter: Submit to ClaudeEscape: Close Claude chat
Custom shortcuts (.vscode/keybindings.json):
[
{
"key": "ctrl+alt+c",
"command": "claude.openChat"
},
{
"key": "ctrl+alt+r",
"command": "claude.refactor"
}
]
Workspace Integration
Project-specific Claude settings:
.vscode/claude.json:
{
"skills": [".claude/skills/project-skill"],
"commands": [".claude/commands"],
"mcpServers": ".claude/mcp.json",
"outputStyle": "technical-writer"
}
Common Workflows
Explain Code:
- Select code
- Right-click → "Ask Claude"
- Type: "Explain this code"
Refactor:
- Select function
- Press Ctrl+I
- Type: "Refactor for better performance"
Fix Bug:
- Click on error
- Press Ctrl+I
- Type: "Fix this error"
Generate Tests:
- Select function
- Right-click → "Ask Claude"
- Type: "Write tests for this"
JetBrains IDEs
Supported IDEs:
- IntelliJ IDEA
- PyCharm
- WebStorm
- PhpStorm
- GoLand
- RubyMine
- CLion
- Rider
Installation
- Open Settings (Ctrl+Alt+S)
- Go to Plugins
- Search "Claude Code"
- Click Install
- Restart IDE
- Authenticate with API key
Features
AI Assistant Panel
- Dedicated Claude panel
- Context-aware suggestions
- Multi-file awareness
- Project understanding
Inline Suggestions
- As-you-type completions
- Contextual code generation
- Smart refactoring hints
- Error fix suggestions
Code Reviews
- Automated code reviews
- Security vulnerability detection
- Best practice recommendations
- Performance optimization tips
Refactoring Support
- Smart rename
- Extract method
- Inline variable
- Move class
Configuration
Settings → Tools → Claude Code:
API Key: [Your API Key]
Model: claude-sonnet-4-5-20250929
Max Tokens: 8192
Auto-complete: Enabled
Code Review: Enabled
Project Settings (.idea/claude.xml):
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClaudeSettings">
<option name="model" value="claude-sonnet-4-5-20250929" />
<option name="skillsPath" value=".claude/skills" />
<option name="autoReview" value="true" />
</component>
</project>
Keyboard Shortcuts
Default shortcuts:
Ctrl+Shift+A: Ask ClaudeAlt+Enter: Quick fixes with ClaudeCtrl+Alt+L: Format with Claude suggestions
Custom shortcuts (Settings → Keymap → Claude Code):
Ask Claude: Ctrl+Shift+C
Refactor with Claude: Ctrl+Alt+R
Generate Tests: Ctrl+Alt+T
Code Review: Ctrl+Alt+V
Integration with IDE Features
Version Control:
- Review commit diffs with Claude
- Generate commit messages
- Suggest PR improvements
- Analyze merge conflicts
Debugger:
- Explain stack traces
- Suggest fixes for errors
- Debug complex issues
- Analyze variable states
Database Tools:
- Generate SQL queries
- Optimize database schema
- Write migration scripts
- Explain query plans
Common Workflows
Generate Boilerplate:
- Right-click in editor
- Select "Generate" → "Claude Code"
- Choose template type
Review Changes:
- Open Version Control panel
- Right-click on changeset
- Select "Review with Claude"
Debug Error:
- Hit breakpoint
- Right-click in debugger
- Select "Ask Claude about this"
CLI Integration
Use Claude Code from IDE terminal:
# In VS Code terminal
claude "explain this project structure"
# In JetBrains terminal
claude "add error handling to current file"
Best Practices
VS Code
Workspace Organization:
- Use workspace settings for team consistency
- Share .vscode/claude.json in version control
- Document custom shortcuts
- Configure output styles per project
Performance:
- Limit inline suggestions in large files
- Disable auto-save for better control
- Use specific prompts
- Close unused editor tabs
JetBrains
Project Configuration:
- Enable Claude for specific file types only
- Configure inspection severity
- Set up custom code review templates
- Use project-specific skills
Performance:
- Adjust auto-complete delay
- Limit scope of code analysis
- Disable for binary files
- Configure memory settings
Troubleshooting
VS Code
Extension Not Loading:
# Check extension status
code --list-extensions | grep claude
# Reinstall
code --uninstall-extension anthropic.claude-code
code --install-extension anthropic.claude-code
Authentication Issues:
- Verify API key in settings
- Check environment variable
- Re-authenticate in extension
- Review proxy settings
JetBrains
Plugin Not Responding:
File → Invalidate Caches / Restart
Settings → Plugins → Claude Code → Reinstall
Performance Issues:
- Increase IDE memory (Help → Edit Custom VM Options)
- Disable unused features
- Clear caches
- Update plugin version
See Also
- VS Code extension: https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code
- JetBrains plugin: https://plugins.jetbrains.com/plugin/claude-code
- Configuration:
references/configuration.md - Troubleshooting:
references/troubleshooting.md