JetBrains IDE
Use Claude Code through QCode in IntelliJ IDEA, WebStorm, PyCharm, GoLand, and other JetBrains IDEs
JetBrains IDE Integration¶
Claude Code offers an official JetBrains plugin that supports IntelliJ IDEA, PyCharm, WebStorm, GoLand, PhpStorm, RubyMine, CLion, Rider, DataGrip, Android Studio, and every other IntelliJ-platform IDE. This guide shows how to install the plugin and point it at the QCode gateway so you can call flagship models like Claude Opus 4.8 and Sonnet 4.6 at a lower cost.
The plugin shares the same configuration as the command-line version: as long as your claude CLI can reach QCode, the IDE plugin will work too.
Prerequisites¶
-
Claude Code CLI is installed and working (current version 2.1.187)
-
Follow the Installation Guide to complete installation
- Follow the Environment Variables guide to configure the QCode API
-
Run
claude --versionin a terminal to confirm it works -
JetBrains IDE 2024.1 or later (the plugin depends on a recent IntelliJ-platform API)
-
A QCode API Key (starts with
cr_) — the same key works for all endpoints
Installation Steps¶
Step 1: Install the Claude Code Plugin¶
-
Open your JetBrains IDE
-
Go to Settings / Preferences → Plugins → Marketplace
-
Search for "Claude Code" (publisher: Anthropic)
-
Click Install
-
Restart the IDE
Tip: If your network cannot reach the JetBrains Marketplace directly, download the
.zippackage from the plugin's homepage and install it offline via Plugins → gear icon → Install Plugin from Disk.... Refer to the JetBrains official docs for details.
Step 2: Configure QCode Access¶
The plugin reuses the Claude Code CLI configuration. The core is two environment variables:
export ANTHROPIC_BASE_URL="https://api.qcode.cc/api"
export ANTHROPIC_AUTH_TOKEN="cr_your_api_key"
Users in mainland China: replacing
api.qcode.ccwithasia.qcode.ccis usually faster and more stable:
bash export ANTHROPIC_BASE_URL="https://asia.qcode.cc/api"The four domains
api/asia/us/eushare the same API key, so pick whichever is best for your region. TheBASE_URLmust not have a trailing slash.Tip: JetBrains IDEs inherit system environment variables. If you've already configured them in
~/.zshrcor~/.bashrc, the IDE will pick them up on launch — provided the IDE is started from an environment where that config was loaded (see FAQ below).
If you'd rather not rely on global environment variables, you can set them per project instead (see the FAQ).
Step 3: Verify¶
-
In the IDE, press
Cmd+Esc(macOS) orCtrl+Esc(Windows/Linux) to open the Claude Code panel -
Type a simple message (e.g. "hello") to test the connection
-
If you get a normal reply, the plugin is connected successfully through QCode
You can also verify the gateway itself is reachable with curl (a 401 means the path is correct and only auth is missing, which is expected):
curl -i https://api.qcode.cc/api/v1/messages
# HTTP/2 401 ← path is correct, as expected
Usage¶
Keyboard Shortcuts¶
| Shortcut | Function |
|---|---|
Cmd+Esc / Ctrl+Esc |
Open / close the Claude Code panel |
Cmd+Option+K / Ctrl+Alt+K |
Insert a reference to the current file (@file) in the prompt |
Esc |
Interrupt the current generation |
Actual shortcuts depend on the plugin version and your keymap; search for "Claude" under Settings → Keymap to customize them.
Core Capabilities¶
-
Code explanation: Select code → Right-click → Ask Claude to have it explain the logic
-
Code generation: Describe your requirements in plain language in the Claude panel and let it generate or modify code
-
Error fixing: Send a stack trace or error message to Claude for analysis and a fix
-
Code refactoring: Select the target code and ask Claude to improve its structure, extract functions, or add tests
Native Diff View¶
The plugin is deeply integrated with JetBrains: when Claude proposes file changes, they are shown in the IDE's native side-by-side diff view, so you can review each change, accept or reject it, and then write it to disk. This is clearer and safer than a plain terminal diff.
Using with the Built-in Terminal¶
The built-in Terminal in JetBrains IDEs can also run the claude command directly, providing the full CLI experience. The plugin automatically passes the currently open file and selection as context to the CLI, so the two work best together.
Image Input (Vision)¶
Vision-capable models (Claude Opus 4.8 / Sonnet 4.6 and the GPT-5.x family) can read images as input:
- Paste a screenshot directly (
Ctrl+V) into the Claude panel - Drag and drop an image file into the chat box
- Reference an image file path in your prompt
Typical uses: rebuild a UI from a mockup/screenshot, debug from an error screenshot, interpret architecture diagrams and charts.
This is image input, not image generation. To have a model generate images, use the
gpt-image-2model — see gpt-image-2 Image Generation.
Model Selection¶
In the Claude panel you can switch models with the /model command; all models are called through the same QCode key. Common choices:
| Model | Input / Output (per 1M tokens) | Context | Best for |
|---|---|---|---|
claude-opus-4-8 |
$5 / $25 | 1M | Flagship, complex refactoring and architectural reasoning |
claude-opus-4-7 |
— | 1M | Flagship alternative |
claude-sonnet-4-6 |
$3 / $15 | 1M | Everyday coding, balanced value |
claude-haiku-4-5 |
$1 / $5 | 200K | Lightweight tasks, quick Q&A |
QCode also supports GPT-5.x and Gemini (billed at ×2 usage) models, but the Claude Code plugin for JetBrains targets the Anthropic protocol; GPT/Gemini are better used in their respective tools such as Codex / Antigravity. See full pricing in the CTA link below.
Advanced Usage¶
-
Dynamic Workflows: include the keyword
ultracodein your prompt (or simply ask to "run a workflow") to orchestrate tens to hundreds of background sub-agents in parallel for large tasks (repo-wide code review, bulk migration, cross-file research, etc.). Sub-agents run in the background while you keep working; check progress with the/workflowscommand. It runs on whatever model Claude Code is configured with — so it works when pointed at QCode. See Subagents. -
Headless / automation: in the IDE terminal you can also use
claude -p "<prompt>"with--output-format json|text|stream-jsonfor scripted calls.jsonreturns a structured object containingresult,total_cost_usd,usage, andsession_id, which is easy to parse withjq. See Automation & CI/CD.
FAQ¶
Claude Code panel not showing?¶
-
Confirm the plugin is installed and enabled (Settings → Plugins → Installed)
-
Confirm Claude Code CLI is globally installed: run
claude --versionin a terminal — it should print2.1.187or higher -
Confirm the IDE version is ≥ 2024.1
-
Restart the IDE; if needed, run File → Invalidate Caches / Restart
Environment variables not taking effect?¶
JetBrains IDEs may not pick up environment variables from your shell configuration files (GUI-launched processes often don't load ~/.zshrc). Solutions:
-
macOS: Launch the IDE from the terminal (e.g.
open -a "IntelliJ IDEA") instead of clicking the Dock icon; or use Tools → Create Command-line Launcher and start it from a terminal -
All platforms: Manually add
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENin Run/Debug Configurations → Environment variables -
Persistence: Set them via JetBrains Toolbox,
*.vmoptions, or system-level environment variables so they are read on every launch
Authentication failure / 401 / 403?¶
-
Check that
ANTHROPIC_AUTH_TOKENis a valid QCode key starting withcr_, with no stray spaces or quotes -
Confirm
ANTHROPIC_BASE_URLhas no trailing slash and the path is/api(Anthropic protocol) -
Run
curl -i https://api.qcode.cc/api/v1/messages: a401means the gateway is reachable (only auth is missing); a connection error indicates a network/proxy problem
Connection timeouts / blocked behind a corporate proxy?¶
-
Users in mainland China should switch to
asia.qcode.ccfirst -
If you're behind a corporate proxy, make sure the IDE's Settings → Appearance & Behavior → System Settings → HTTP Proxy is configured correctly, or set the
HTTPS_PROXYenvironment variable for the terminal -
Confirm your firewall allows the IDE process outbound access to
*.qcode.cc:443
Changed environment variables but the IDE doesn't notice?¶
Environment variables are read once at process startup. After editing ~/.zshrc or system variables, you must fully quit and restart the IDE (not just reopen a window) for the changes to take effect.
Next Steps¶
-
See Endpoints & API Formats for the four domains and the base URL for each protocol
-
See VS Code Integration for the VS Code extension
-
See Cline Integration for another VS Code AI extension
-
See CLI Tips for terminal usage tips
Wondering which model is most cost-effective to run in JetBrains? Check the QCode pricing page and pick Opus / Sonnet / Haiku to fit your budget.