Claude Code

Claude Code is Anthropic's terminal AI coding assistant and can connect to SilvaMux Coding Plan.

Before You Start

  1. 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.
  2. 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.
  3. 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.
A 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

  1. Install or update Node.js (v18.0 or later).
  2. 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/v1
  • ANTHROPIC_AUTH_TOKEN: your cp_live_ subscription key
  • ANTHROPIC_MODEL: a Coding Plan model (for example deepseek-v4-pro)

macOS / Linux

  1. Create and open the config file ~/.claude/settings.json (~ is your home directory; create the .claude directory first with mkdir -p ~/.claude if needed).
mkdir -p ~/.claude
nano ~/.claude/settings.json
  1. Add the following, replacing YOUR_API_KEY with your cp_live_ key. The available models follow GET /api/coding-plan/v1/models and 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"
  }
}
  1. Edit or create ~/.claude.json and set the top-level field hasCompletedOnboarding to true to avoid the Unable to connect to Anthropic services error on startup.
{
  "hasCompletedOnboarding": true
}

Save and open a new terminal for the changes to take effect.

Windows

  1. Create the config directory (PowerShell):
mkdir -Force $HOME\.claude
notepad $HOME\.claude\settings.json
  1. In the opened %USERPROFILE%\.claude\settings.json, add the same env configuration as macOS/Linux (same Base URL and cp_live_ key).
  2. Edit or create %USERPROFILE%\.claude.json and set the top-level field hasCompletedOnboarding to true.

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:

ModeBehavior
defaultAsk for confirmation on every action.
acceptEditsAuto-approve file edits; other actions still ask.
planRead-only planning; no changes.
dontAskDo not ask; actions that need confirmation are denied.
bypassPermissionsBypass all permission checks.
delegateDelegated 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

  1. Open a terminal, go to your project directory, and start Claude Code.
cd path/to/your_project
claude
  1. On first start, authorize Claude Code to execute files.
  2. Run /status to confirm the model, Base URL, and API key.
  3. Start chatting in Claude Code.

Switch Models

  • At startup: claude --model deepseek-v4-pro
  • During a session: enter /model deepseek-v4-pro

Common Commands

CommandDescriptionExample
/initGenerate a CLAUDE.md in the project root for project-level instructions and context./init
/statusShow the current model, Base URL, and other config status./status
/model <name>Switch models./model deepseek-v4-pro
/clearClear the conversation history and start fresh./clear
/planEnter planning mode to analyze and discuss without making changes./plan
/compactCompact the conversation history to free up context./compact
/configOpen 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

  1. Complete "Configure Credentials" above first.
  2. Open VS Code, search the marketplace for Claude Code for VS Code, and install it.
  3. 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

  1. Complete "Install Claude Code" and "Configure Credentials" first.
  2. Open your JetBrains IDE (IntelliJ IDEA, PyCharm, etc.), search the marketplace for Claude Code, and install it.
  3. 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:

  1. Confirm ANTHROPIC_BASE_URL is https://www.silvamux.com/api/coding-plan/v1 and ANTHROPIC_AUTH_TOKEN is your cp_live_ key in ~/.claude/settings.json.
  2. Check that hasCompletedOnboarding is true in ~/.claude.json.
  3. 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 /clear to reset conversations, /compact to 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.