Claude Code
Claude Code is Anthropic's terminal AI coding assistant and can connect to SilvaMux Coding Plan.
Before You Start
- Purchase a subscription: buy a Coding Plan Personal subscription (Lite / Pro / Max with monthly, quarterly, or yearly billing) on the subscription page; it takes effect immediately after payment.
- Create a subscription API key: in the console, go to Coding Plan → API Keys, create a key, and copy the full value starting with
cp_live_right away. - Confirm endpoints and protocols: all tools share the Base URL
https://www.silvamux.com/api/coding-plan/v1, compatible with both the OpenAI and Anthropic protocols; see Endpoints & Protocols for endpoint details.
cp_live_ key can only call the /api/coding-plan/v1 subscription endpoints; using it on regular endpoints (such as /api/v1/chat/completions) returns 403 CODING_PLAN_KEY_NOT_ALLOWED; conversely, a regular sk_live_ key cannot call the subscription endpoints.For the full flow of purchasing, key creation, and a verification call, see Quick Start.
Install Claude Code
macOS / Linux
- Install or update Node.js (v18.0 or later).
- Run the following command in a terminal to install Claude Code.
npm install -g @anthropic-ai/claude-code
Verify the install; a version number means it succeeded.
claude --version
Windows
Using Claude Code on Windows requires WSL or Git for Windows. Then run the following in WSL or Git Bash:
npm install -g @anthropic-ai/claude-code
Configure Credentials
Configure the following in Claude Code:
ANTHROPIC_BASE_URL:https://www.silvamux.com/api/coding-plan/v1ANTHROPIC_AUTH_TOKEN: yourcp_live_subscription keyANTHROPIC_MODEL: a Coding Plan model (for exampledeepseek-v4-pro)
macOS / Linux
- Create and open the config file
~/.claude/settings.json(~is your home directory; create the.claudedirectory first withmkdir -p ~/.claudeif needed).
mkdir -p ~/.claude
nano ~/.claude/settings.json
- Add the following, replacing
YOUR_API_KEYwith yourcp_live_key. The available models followGET /api/coding-plan/v1/modelsand the Model Plaza.
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_BASE_URL": "https://www.silvamux.com/api/coding-plan/v1",
"ANTHROPIC_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "deepseek-v4-pro",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "deepseek-v4-pro",
"CLAUDE_CODE_SUBAGENT_MODEL": "deepseek-v4-pro"
}
}
- Edit or create
~/.claude.jsonand set the top-level fieldhasCompletedOnboardingtotrueto avoid theUnable to connect to Anthropic serviceserror on startup.
{
"hasCompletedOnboarding": true
}
Save and open a new terminal for the changes to take effect.
Windows
- Create the config directory (PowerShell):
mkdir -Force $HOME\.claude
notepad $HOME\.claude\settings.json
- In the opened
%USERPROFILE%\.claude\settings.json, add the sameenvconfiguration as macOS/Linux (same Base URL andcp_live_key). - Edit or create
%USERPROFILE%\.claude.jsonand set the top-level fieldhasCompletedOnboardingtotrue.
Configure the Context Window
Claude Code uses a 200K context window by default. If your model supports a longer context, add CLAUDE_CODE_MAX_CONTEXT_TOKENS to the env in ~/.claude/settings.json:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
"ANTHROPIC_BASE_URL": "https://www.silvamux.com/api/coding-plan/v1",
"ANTHROPIC_MODEL": "deepseek-v4-pro",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "1000000"
}
}
The actual available context length depends on the model.
Permission Modes
Claude Code offers several permission modes that control how tool actions are confirmed:
| Mode | Behavior |
|---|---|
default | Ask for confirmation on every action. |
acceptEdits | Auto-approve file edits; other actions still ask. |
plan | Read-only planning; no changes. |
dontAsk | Do not ask; actions that need confirmation are denied. |
bypassPermissions | Bypass all permission checks. |
delegate | Delegated mode. |
Use --permission-mode to set the default mode for a session:
claude --permission-mode plan
claude --permission-mode acceptEdits
You can also enter /permissions in a session to manage pre-approve and pre-deny rules, or configure the permissions field in ~/.claude/settings.json:
{
"permissions": {
"allow": ["Bash(git:*)", "Read", "Edit"],
"deny": ["Bash(rm:*)"],
"defaultMode": "default"
}
}
allow auto-approves matching tool calls and deny auto-denies matching tool calls; rules support wildcards.
Use Claude Code
- Open a terminal, go to your project directory, and start Claude Code.
cd path/to/your_project
claude
- On first start, authorize Claude Code to execute files.
- Run
/statusto confirm the model, Base URL, and API key. - Start chatting in Claude Code.
Switch Models
- At startup:
claude --model deepseek-v4-pro - During a session: enter
/model deepseek-v4-pro
Common Commands
| Command | Description | Example |
|---|---|---|
/init | Generate a CLAUDE.md in the project root for project-level instructions and context. | /init |
/status | Show the current model, Base URL, and other config status. | /status |
/model <name> | Switch models. | /model deepseek-v4-pro |
/clear | Clear the conversation history and start fresh. | /clear |
/plan | Enter planning mode to analyze and discuss without making changes. | /plan |
/compact | Compact the conversation history to free up context. | /compact |
/config | Open the config menu for language, theme, and more. | /config |
See the Claude Code documentation for more.
IDE Plugins
Claude Code provides plugins for VS Code and JetBrains IDEs.
VS Code
- Complete "Configure Credentials" above first.
- Open VS Code, search the marketplace for
Claude Code for VS Code, and install it. - Restart VS Code and click the icon in the top-right corner to start. If an Anthropic login screen appears, the configuration has not taken effect yet — finish the setup first.
JetBrains
- Complete "Install Claude Code" and "Configure Credentials" first.
- Open your JetBrains IDE (IntelliJ IDEA, PyCharm, etc.), search the marketplace for
Claude Code, and install it. - Restart the IDE and use the icon in the top-right corner; switch models with
/model <name>.
FAQ
Error: Unable to connect to Anthropic services
This means Claude Code is trying to reach Anthropic's official service instead of SilvaMux, usually because the configuration has not taken effect:
- Confirm
ANTHROPIC_BASE_URLishttps://www.silvamux.com/api/coding-plan/v1andANTHROPIC_AUTH_TOKENis yourcp_live_key in~/.claude/settings.json. - Check that
hasCompletedOnboardingistruein~/.claude.json. - After changing the config, open a brand-new terminal before running
claude.
401 on calls
The API key and Base URL do not match: a Coding Plan cp_live_ key must be used with https://www.silvamux.com/api/coding-plan/v1, not a regular sk_live_ key.
429 on calls
When any subscription quota window is exhausted, calls return 429 QUOTA_EXCEEDED (the message identifies 5h / weekly / monthly). Wait for the window to recover, or check remaining quota in the console.
Best Practices
- Context management: use
/clearto reset conversations,/compactto compress history, and@to reference files explicitly. - Plan first: for complex tasks, enter Plan mode to analyze the approach before editing files.
- Capture project knowledge: maintain a CLAUDE.md in the project root with build commands, code conventions, and workflows.
- Extend capabilities: connect external services via MCP and capture workflow knowledge with Skills.
- Close the feedback loop: require relevant tests to run after changes and define clear success criteria.