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

  1. Claude Code CLI is installed and working (current version 2.1.187)

  2. Follow the Installation Guide to complete installation

  3. Follow the Environment Variables guide to configure the QCode API
  4. Run claude --version in a terminal to confirm it works

  5. JetBrains IDE 2024.1 or later (the plugin depends on a recent IntelliJ-platform API)

  6. A QCode API Key (starts with cr_) — the same key works for all endpoints

Installation Steps

Step 1: Install the Claude Code Plugin

  1. Open your JetBrains IDE

  2. Go to Settings / PreferencesPluginsMarketplace

  3. Search for "Claude Code" (publisher: Anthropic)

  4. Click Install

  5. Restart the IDE

Tip: If your network cannot reach the JetBrains Marketplace directly, download the .zip package 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.cc with asia.qcode.cc is usually faster and more stable:

bash export ANTHROPIC_BASE_URL="https://asia.qcode.cc/api"

The four domains api / asia / us / eu share the same API key, so pick whichever is best for your region. The BASE_URL must not have a trailing slash.

Tip: JetBrains IDEs inherit system environment variables. If you've already configured them in ~/.zshrc or ~/.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

  1. In the IDE, press Cmd+Esc (macOS) or Ctrl+Esc (Windows/Linux) to open the Claude Code panel

  2. Type a simple message (e.g. "hello") to test the connection

  3. 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 SettingsKeymap to customize them.

Core Capabilities

  1. Code explanation: Select code → Right-click → Ask Claude to have it explain the logic

  2. Code generation: Describe your requirements in plain language in the Claude panel and let it generate or modify code

  3. Error fixing: Send a stack trace or error message to Claude for analysis and a fix

  4. 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-2 model — 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 ultracode in 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 /workflows command. 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-json for scripted calls. json returns a structured object containing result, total_cost_usd, usage, and session_id, which is easy to parse with jq. See Automation & CI/CD.

FAQ

Claude Code panel not showing?

  1. Confirm the plugin is installed and enabled (SettingsPluginsInstalled)

  2. Confirm Claude Code CLI is globally installed: run claude --version in a terminal — it should print 2.1.187 or higher

  3. Confirm the IDE version is ≥ 2024.1

  4. Restart the IDE; if needed, run FileInvalidate 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 ToolsCreate Command-line Launcher and start it from a terminal

  • All platforms: Manually add ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN in Run/Debug ConfigurationsEnvironment variables

  • Persistence: Set them via JetBrains Toolbox, *.vmoptions, or system-level environment variables so they are read on every launch

Authentication failure / 401 / 403?

  1. Check that ANTHROPIC_AUTH_TOKEN is a valid QCode key starting with cr_, with no stray spaces or quotes

  2. Confirm ANTHROPIC_BASE_URL has no trailing slash and the path is /api (Anthropic protocol)

  3. Run curl -i https://api.qcode.cc/api/v1/messages: a 401 means 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.cc first

  • If you're behind a corporate proxy, make sure the IDE's SettingsAppearance & BehaviorSystem SettingsHTTP Proxy is configured correctly, or set the HTTPS_PROXY environment 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

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.

Related Documents

Codex Complete Tutorial
From Installation to Mastery — Complete Usage Guide for OpenAI Codex CLI with QCode.cc
Connect SillyTavern to QCode
Chat with QCode.cc's Claude / GPT models in SillyTavern; an honest note on whether gpt-image-2 image generation can be connected, plus alternatives
Cursor Editor Setup
Connect QCode.cc to Cursor IDE with a custom Anthropic / OpenAI Base URL + API Key, including model config, custom-endpoint limitations, and troubleshooting
🚀
Get Started with QCode — Claude Code & Codex
One plan for both Claude Code and Codex, Asia-Pacific low latency
View Pricing Plans → Create Account
Team of 3+?
Enterprise: dedicated domain + sub-key management + ban protection, from ¥250/person/mo
Learn Enterprise →