Skip to main content
Claude Code is an AI coding agent by Anthropic that reads code, edits files, and runs commands in the terminal.

Installation

Open CC Switch and add a ruoli configuration: Select Claude Code and click Apply.
The API URL for Claude Code is https://ruoli.dev, without /v1.

Switch Models

Beyond native Claude models, ruoli routes to third-party models like gpt-5.5, GLM, Kimi, and DeepSeek. Open CC Switch → Edit Provider → Model Mapping, point each Claude alias at the target model, and save — no JSON editing required.
CC Switch Model Mapping
Leave these blank if your provider is natively Claude — only fill them in when you want to route aliases to a different model.

Disable Attribution Header (Required)

Claude Code injects a dynamic attribution header (containing session ID and more) into every request by default — this completely destroys upstream prompt caching, causing cache hit rates to collapse, costs to spike, and responses to slow down.Always disable it, whether you’re using native Claude models or third-party models like GLM / Kimi / DeepSeek.
In CC Switch → Edit Provider → Config JSON, add one line to env:
Add CLAUDE_CODE_ATTRIBUTION_HEADER in CC Switch JSON
The same applies to manual ~/.claude/settings.json — see the example below.

Manual Configuration

Edit ~/.claude/settings.json:
Or via environment variables:

Configure Context Compression

Claude Code auto-compresses context at about 83% of the context window by default. If you’re using a 1M context window, you can adjust when compression triggers via CLAUDE_AUTOCOMPACT_PCT_OVERRIDE. For example, to trigger compression at 180k tokens (180k / 1000k = 18%): Add to the env block in ~/.claude/settings.json:
Or set a temporary environment variable:
You can only set the threshold below 83%. Values above 83% are silently ignored.
Official Documentation: code.claude.com/docs