Trae Integration
Use the Claude Code extension in ByteDance's Trae IDE (including offline install guide for Trae CN)
Need an API key? Sign up →Endpoints & base URLs →
On This Page
Last verified: 2026-09-18 · 📄 Per official docs (Trae 3.3.101 (released 2026-09-15))
At a glance¶
| Item | Details |
|---|---|
| Models you can use | Claude ✅ (Claude Code extension; the built-in AI also accepts Anthropic-Messages-format custom models) · GPT ✅ · Chinese models ✅ (built-in AI, OpenAI format) · Gemini ❌ |
| Protocol & Base URL | Anthropic: https://api.qcode.cc/api · OpenAI: https://api.qcode.cc/openai/v1 |
| Where to configure | built-in AI: Settings → custom models; the Claude Code extension shares ~/.claude/ |
| Official docs | docs.trae.ai |
Trae is an AI-native IDE from ByteDance, derived from VS Code. It takes extensions, and it ships its own Agent and Chat modes — as of v3.3.56 (2026-05-08) the old Builder and Builder with MCP agents were merged into Agent, and the official documentation no longer mentions Builder. This guide covers two things: installing and using the Claude Code extension in Trae (international) or Trae CN (China), and adding QCode.cc as a custom model of the built-in AI.
Naming note: the official documentation site (Chinese and English) currently calls this IDE TraeCode, while the Chinese marketing site leads with TraeWork (Work / Code / Design modes). There is no official rename announcement — the changelog simply starts using TraeCode in release titles from v3.3.84 (2026-08-07). This page keeps its file name and URL.
Prerequisites¶
Before configuring the Trae extension, ensure:
-
Claude Code CLI is installed and working
-
See Installation Guide to complete installation
-
See Environment Configuration to complete setup
-
Trae or Trae CN is installed and up to date
-
International edition: trae.ai
- China edition (Trae CN): trae.com.cn
Trae CN or the international edition? The official docs do not describe a regional difference. They say only: "If the extension you need is not available in the TraeCode extension marketplace, you can install an extension from the VS Code extension marketplace into TraeCode." So every "not found in the marketplace" step below is conditional: use the marketplace if it has the extension, otherwise use a
.vsix.
Installation Steps¶
Step 1: Install the Claude Code Extension¶
The Claude Code extension can be installed via two paths — try them in order. Note the official caveat as well: an extension release that depends on newer VS Code APIs may not work in TraeCode, in which case the docs point you to an older release from Version History.
Path A: Install from Trae's Built-in Extension Marketplace (Recommended)¶
-
Open Trae and navigate to the Extensions panel (
Ctrl+Shift+X/Cmd+Shift+X) -
Search for "Claude Code" (publisher: Anthropic)
-
Click Install
If your Trae marketplace does not list Claude Code, use Path B. (The vendor does not document which builds lack it, so we do not claim any.)
Path B: Offline .vsix Local Install¶
Use this path when the marketplace does not offer the extension:
-
Open the Claude Code extension page
-
Download the
.vsixthat matches your platform and architecture. The method in Trae's own docs: on the extension page open Version History, take theitemNameandversionfields and build the download URL:
text
https://marketplace.visualstudio.com/_apis/public/gallery/publishers/<publisher>/vsextensions/<extension>/<version>/vspackage
For Claude Code that is publishers/anthropic/vsextensions/claude-code/<version>/vspackage.
🔴 Get the right architecture: Claude Code is published per platform (file names carry suffixes such as @win32-x64 or @alpine-arm64), and the Trae docs explicitly warn that architecture-specific extensions must be downloaded for the platform you run. The wrong build installs and then does nothing. macOS splits Apple Silicon / Intel; Linux and Windows split x64 / arm64.
Or click Download Extension in the right sidebar of the extension page, if your page shows that link.
Tip: Accessing the VS Code Marketplace from mainland China may require a proxy. If the download fails locally, download the
.vsixon a machine with a reliable international connection and copy it over.
- In Trae, open the Extensions panel → click the ⋯ menu in the upper right → Install from VSIX, and select the downloaded
.vsixfile
The docs offer one more way: drag the downloaded .vsix into the Extensions panel and Trae starts installing it automatically.
Some environments do have a trae launcher command, but Trae's documentation records no flag for installing extensions with it and we have not tested it, so we do not print a command here.
Step 2: Configure primaryApiKey¶
This is a critical step! The Claude Code extension requires primaryApiKey in the configuration file.
Good news: Trae shares the same configuration path as VS Code (
~/.claude/config.json). Users who already configured VS Code do not need to repeat this step.
Windows¶
Edit or create the config file C:\Users\YourUsername\.claude\config.json:
{
"primaryApiKey": "qcode"
}
macOS¶
Edit or create the config file ~/.claude/config.json:
mkdir -p ~/.claude
cat > ~/.claude/config.json << 'EOF'
{
"primaryApiKey": "qcode"
}
EOF
Linux¶
Edit or create the config file ~/.claude/config.json:
mkdir -p ~/.claude
cat > ~/.claude/config.json << 'EOF'
{
"primaryApiKey": "qcode"
}
EOF
Note: The value of
primaryApiKeycan be anything (likeqcode); what matters is that the field is set. The actual API authentication still uses theANTHROPIC_AUTH_TOKENfrom your environment variables.Important: The config file is
config.json, NOTsettings.json. Please distinguish carefully between the two.
Step 3: Restart Trae¶
After configuration, restart Trae for the changes to take effect.
Relationship with Trae's Built-in AI¶
Trae's built-in AI (Agent and Chat) is no longer limited to ByteDance's own backend. The official docs state that besides the built-in models you can add custom ones, and the Custom configuration kind asks for an API format, a request URL, a model ID and credentials — one of the API formats being Anthropic Messages, described verbatim as compatible with the Anthropic /v1/messages specification, suitable for the Claude series and compatible services, with "some Claude API proxy services" listed as a typical case.
| Custom model in the built-in AI | Claude Code extension | |
|---|---|---|
| Protocol | API format: Anthropic Messages or OpenAI Chat Completions | Anthropic Messages |
| Where | Settings → Models → Add model → Custom model | extension settings plus the ~/.claude/ configuration |
| URL | Two modes: turn on Full URL and give the complete address, or leave it off and give a base URL that Trae completes per API format | ANTHROPIC_BASE_URL |
| Catch | Auto mode never calls custom models (stated by the docs), so leave Auto to use yours | independent of the built-in AI; they coexist |
Mapped onto QCode endpoints (reference only — we did not run this inside Trae):
| API format | Full URL on | Full URL off (base URL) |
|---|---|---|
| Anthropic Messages | https://api.qcode.cc/api/v1/messages |
https://api.qcode.cc/api |
| OpenAI Chat Completions | https://api.qcode.cc/openai/v1/chat/completions |
https://api.qcode.cc/openai/v1 |
Use a model ID exactly as listed on qcode.cc/models, and your cr_ key as the API key.
If you already purchased a QCode.cc subscription, we recommend using the Claude Code extension as your primary driver to get the most value out of your plan.
Usage¶
Keyboard Shortcuts¶
| Shortcut | Function |
|---|---|
Cmd+Esc / Ctrl+Esc |
Open/Close Claude Code panel |
Cmd+Shift+P / Ctrl+Shift+P |
Open command palette, search for Claude commands |
Common Features¶
-
Code Explanation
-
Select code
- Right-click and choose "Ask Claude" or use shortcut
-
Enter your question, e.g., "Explain this code"
-
Code Generation
-
Open Claude panel
- Describe the feature you need
-
Claude will generate code with insert options
-
Code Refactoring
-
Select code to refactor
- Ask Claude to help refactor
-
Preview and apply changes
-
Error Fixing
-
When code has errors
- Select the error code or message
- Ask Claude to analyze and provide fixes
Configuration Options¶
In Trae settings you can adjust Claude Code extension behavior (these settings are identical to VS Code):
-
Open Settings (
Ctrl+,/Cmd+,) -
Search for "Claude Code"
-
Adjust options as needed
Common Settings¶
{
"claude-code.autoSuggest": true,
"claude-code.inlineChat": true
}
Using with Terminal CLI¶
The Trae extension and terminal CLI can be used together:
| Scenario | Recommended Tool |
|---|---|
| Quick code edits | Trae extension |
| Complex project analysis | Terminal CLI |
| Code review | Either |
| Git operations | Terminal CLI |
| File generation | Either |
Troubleshooting¶
Claude Code Not Found in the Marketplace¶
Symptoms: Searching for "Claude Code" in Trae's Extensions panel returns no results, or the results are not the official Anthropic-published extension.
Solution: Use Path B: Offline .vsix Local Install (see Step 1 above). The vendor's position is only that extensions missing from the TraeCode marketplace can be installed from the VS Code marketplace; it does not split this by China / international builds.
Trae CN Cannot Download the .vsix¶
Symptoms: Accessing marketplace.visualstudio.com fails or downloads at 0 B/s.
Solution:
-
Download the
.vsixover a reliable international connection or through a proxy -
Or contact QCode.cc support for a mirror link of the Claude Code extension
.vsix -
Install via "Install from VSIX" once the file is available locally
Claude Code Panel Blank or Won't Start¶
-
Confirm
~/.claude/config.jsonexists and contains valid JSON -
Confirm the filename is
config.json, NOTsettings.json(the most common pitfall) -
Confirm environment variables
ANTHROPIC_BASE_URLandANTHROPIC_AUTH_TOKENare set -
Run
claudein the terminal to verify the CLI works
Shortcut Conflicts with Trae's Built-in AI¶
If Cmd+Esc / Ctrl+Esc is captured by Trae's Agent or Chat:
-
Open Trae Settings → Keyboard Shortcuts
-
Search for
claude-codeorClaude Code -
Rebind "Claude Code: Toggle Panel" to a non-conflicting key
Connection Timeout¶
-
Check that
https://asia.qcode.ccis reachable from your network -
Verify the
ANTHROPIC_BASE_URLenvironment variable -
CN users on a non-proxied network should prefer the mainland fast lane
https://api.qcode.cc/api(supports request lookup via probe.qcode.cc)
Next Steps¶
-
Explore CLI Tips to boost efficiency
-
Learn Workflow Tips to optimize your development flow
-
See VS Code Integration if you also use VS Code
Get started with QCode
One API key for Claude Code, Codex and more — billed per token, per-model prices on qcode.cc/models