Skip to content

How to Configure Multiple AI Agents in JetBrains: Claude, Copilot, Gemini, and Cursor

JetBrains’ original AI Assistant left me frustrated. The responses felt generic, the completions were mediocre, and I found myself constantly switching to other tools for better AI assistance. I wanted to use Claude for complex reasoning, Copilot for code completion, and Gemini for specific tasks—all within my JetBrains IDE. Turns out, JetBrains finally addressed this pain point.

The Problem: One AI to Rule Them All (Poorly)

I’ve been using JetBrains IDEs for years—IntelliJ IDEA for Java, PyCharm for Python, WebStorm for JavaScript. When JetBrains introduced their AI Assistant, I was excited. Finally, native AI support! But the reality disappointed:

  • Responses felt shallow compared to Claude
  • Code completions weren’t as good as GitHub Copilot
  • No way to switch between different AI models
  • The quality gap between JetBrains AI and specialized tools was obvious

I kept a browser tab open with Claude, another with ChatGPT, and GitHub Copilot installed separately. My workflow was fragmented. Why couldn’t I just use my preferred AI model inside my IDE?

The Solution: Multi-Agent Support

JetBrains listened. They’ve now added support for multiple AI agents, allowing developers to integrate and switch between different AI providers. This is a game-changer for developers like me who prefer specific models for specific tasks.

Configuring AI Agents in JetBrains

Here’s how I set up multiple AI agents in my JetBrains IDE.

Step 1: Access AI Assistant Settings

Navigate to the AI Assistant configuration:

Settings Path
Settings → Tools → AI Assistant → Agents

In IntelliJ IDEA on macOS, I use:

macOS Shortcut
Cmd + , → Tools → AI Assistant → Agents

Step 2: Configure Claude Agent

For Claude integration, you’ll need an Anthropic API key. I got mine from the Anthropic console:

Claude Agent Configuration
Agent Type: Claude Agent
API Key: sk-ant-api-xxxxxxxx
Model: Claude-3.5-Sonnet
Base URL: https://api.anthropic.com (default)

The configuration dialog asks for:

  1. Your Anthropic API key
  2. Model selection (I prefer Claude-3.5-Sonnet for coding)
  3. Optional custom base URL

Step 3: Configure GitHub Copilot

GitHub Copilot has been my go-to for code completion. JetBrains supports it via plugin:

Copilot Plugin Installation
Settings → Plugins → Marketplace → Search "GitHub Copilot"

After installation, authenticate with GitHub:

Copilot Authentication
1. Click "Sign in with GitHub"
2. Authorize the application
3. Enter the one-time code displayed

Step 4: Configure Gemini CLI

Google’s Gemini integration requires setup through Google Cloud:

Gemini Configuration
Agent Type: Gemini CLI
API Key: AIza-xxxxxxxxxxxxx
Model: Gemini-1.5-Pro

I found the API key in Google AI Studio. The setup was straightforward—just paste the key and select your preferred model.

Step 5: Configure Cursor

Cursor integration is the newest addition. I configured it through:

Cursor Agent Setup
Agent Type: Cursor
API Endpoint: https://api.cursor.sh
Authentication: Cursor Account credentials

Note: Cursor integration might require additional setup depending on your subscription tier.

Switching Between Agents

Here’s the part that matters—the actual switching. JetBrains made this easy but the UI element is subtle.

The agent switcher is located at the bottom-left corner of the AI Assistant panel. I missed it multiple times before realizing it was there.

Switching Agents
1. Open AI Assistant panel (Cmd + \ on macOS)
2. Look for dropdown in bottom-left corner
3. Click to see all configured agents
4. Select your preferred agent

I typically use:

  • Claude for architecture decisions and complex refactoring
  • Copilot for quick code completion
  • Gemini for documentation generation

Why This Matters

Different AI models excel at different tasks. Claude 3.5 Sonnet has become my favorite for reasoning through complex problems. GitHub Copilot still dominates for inline code completion. Gemini sometimes surprises me with creative suggestions.

Before multi-agent support, I was forced into a one-size-fits-all approach. Now I can choose the right tool for each job, all within my JetBrains IDE.

Common Mistakes to Avoid

I made several mistakes during setup:

  1. Not exploring all agent options: I initially thought only Codex was available. Check the full list of supported agents.

  2. Missing the dropdown: The agent switcher is subtle. It’s in the bottom-left of the AI panel, not the top.

  3. Forgetting to save settings: After configuring agents, I closed settings without applying. Remember to hit “Apply” or “OK”.

  4. Using wrong API keys: I mixed up my Anthropic and OpenAI keys once. Double-check which key goes where.

  5. Not updating agents: JetBrains updates agent support regularly. Check for plugin updates to get the latest integrations.

The multi-agent architecture follows a provider pattern. JetBrains defines an agent interface that providers implement:

Conceptual Agent Interface
interface AIAgent:
- configure(credentials)
- complete(prompt)
- stream(prompt)
- getModels()

Each provider (Anthropic, GitHub, Google) implements this interface, allowing JetBrains to switch between them seamlessly.

Performance Considerations

I noticed response times vary between agents:

AgentTypical Response TimeBest For
Claude2-5 secondsReasoning, refactoring
Copilot< 1 secondCode completion
Gemini3-7 secondsDocumentation

The latency difference is noticeable. For quick completions, Copilot remains my choice. For deeper analysis, the extra seconds with Claude are worth it.

Troubleshooting

When an agent fails to connect, I check:

Troubleshooting Steps
1. Verify API key hasn't expired
2. Check network connectivity
3. Confirm API quota isn't exhausted
4. Review JetBrains logs: Help → Show Log in Finder

Most issues stem from expired or invalid API keys. I now set calendar reminders to rotate keys quarterly.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

JetBrains’ multi-agent support transforms it from an IDE with mediocre AI into a flexible, AI-powered development environment. I can now use Claude for complex reasoning, Copilot for completions, and Gemini for specialized tasks—all without leaving my IDE. This strategic shift addresses the main criticism of JetBrains’ native AI quality and gives developers choice. If you’ve avoided JetBrains AI Assistant because of quality concerns, give it another look with your preferred AI model configured.

Comments