How to Connect Doubao‑Seed‑Code to Claude Code in Minutes
This guide shows how to replace Claude Code's default model with the Chinese Doubao‑Seed‑Code programming model by creating a wrapper script, configuring environment variables, and running a few shell commands, then demonstrates the setup by generating a functional Space Invaders web game.
Claude Code is a popular AI coding assistant, but its default model is unavailable in China. By adding a custom wrapper script, you can switch its backend to the domestic Doubao‑Seed‑Code model without affecting existing functionality.
Model Overview
Doubao‑Seed‑Code is ByteDance's first programming‑focused LLM, ranked first on the SWE‑Bench‑Verified leaderboard when combined with the Trae IDE. It offers strong quality, fast response, and low cost (e.g., a 9.9 CNY first‑month plan).
Switching the Backend
The original claude command still runs the Claude Sonnet 4.5 model. Adding a new claude-doubao command points Claude Code to Doubao‑Seed‑Code, allowing both commands to coexist.
Setup Steps (≈3 minutes)
Create a project directory and install Claude Code locally:
$ mkdir ~/claude-model
$ cd ~/claude-model
$ npm init -y
$ npm install @anthropic-ai/claude-codeCreate a hidden configuration folder: $ mkdir .claude-doubao Add a bin directory to the PATH:
$ mkdir ~/claude-model/bin
export PATH="$HOME/claude-model/bin:$PATH"Update ~/.bash_profile (macOS) or ~/.bashrc (Linux) accordingly.
Create the wrapper script ~/claude-model/bin/claude-doubao:
#!/usr/bin/env bash
# Wrapper for Claude Code CLI using Doubao API
CLAUDE_BIN="$HOME/claude-model/node_modules/.bin/claude"
export ANTHROPIC_AUTH_TOKEN="YOUR_DOUBAO_API_KEY"
export ANTHROPIC_BASE_URL="https://ark.cn-beijing.volces.com/api/compatible"
export ANTHROPIC_MODEL="doubao-seed-code-preview-latest"
export API_TIMEOUT_MS=3000000
export CLAUDE_CONFIG_DIR="$HOME/claude-model/.claude-doubao"
exec "$CLAUDE_BIN" "$@"Make it executable:
$ chmod +x ~/claude-model/bin/claude-doubaoVerification
Run claude-doubao --version to confirm the wrapper works, then start Claude Code with claude-doubao to use the Doubao model.
Demo: Generating a Space Invaders Game
Create a project folder, launch Claude Code via the new command, and prompt:
Write an HTML and JavaScript page implementing space invaders
Within two‑three minutes the model outputs complete HTML/JS files that run correctly in a browser, as shown in the screenshots. The generated code is readable and requires no manual fixes.
Additional Tests
The author also generated an SVG of a pelican riding a bicycle, confirming the model’s versatility.
Conclusion
After integration, Claude Code operates smoothly with Doubao‑Seed‑Code, offering fast response and code quality comparable to the original model. The low‑price API plan (9.9 CNY/month) makes it an attractive alternative for developers in China.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
