🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman
CLI switcher for Claude Code provider configs
ccc is a command-line tool for running Claude Code with different provider settings. It keeps one shared config, overlays provider-specific env values, and can replace the `claude` command so switching providers feels like using the same tool.
Builders who want Claude Code to use different model providers without editing config by hand.
You can switch providers and run Claude Code with the right endpoint and model in one command.
What it does
Provider switching
Run `ccc glm`, `ccc kimi`, or another provider name to launch Claude Code with that provider's config.
Config merge
Deep-merges shared settings with provider settings while keeping your existing `settings.json` intact.
Patch mode
`ccc patch` replaces the system `claude` command with ccc, and `ccc patch --reset` restores it.
Validation
Checks the current provider or all providers with `ccc validate` and `ccc validate --all`.
Config migration
Prompts to migrate an existing `~/.claude/settings.json` into `~/.claude/ccc.json`.
How to get it
- 1Run
OS=$(uname -s | tr '[:upper:]' '[:lower:]'); ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/'); curl -LO "https://github.com/guyskk/claude-code-config-switcher/releases/latest/download/ccc-${OS}-${ARCH}" && sudo install -m 755 "ccc-${OS}-${ARCH}" /usr/local/bin/ccc && rm "ccc-${OS}-${ARCH}" && ccc --version - 2Verify your provider configuration
# Validate current provider ccc validate # Validate all providers ccc validate --all
README
ccc - Claude Code Configuration Switcher
Recommended LLMs
-
小米顶尖模型 MiMo V2.5-Pro 等,通过我的邀请码注册:双方各得 ¥10 API 体验金 + 首单 9 折。邀请码:2DZZC9。注册: https://platform.xiaomimimo.com?ref=2DZZC9 (注册后自动填入 · 体验金 40 天有效)
-
智谱 Coding Plan,国内顶流编程大模型,20+主流工具全适配,性价比拉满!👉立即参与「拼好模」:https://www.bigmodel.cn/glm-coding?ic=S8PMS595T0
Why ccc?
ccc is a CLI tool that provides seamless provider switching for Claude Code. Switch between Kimi, GLM, MiniMax, and other providers with one command.
Quick Start
1. Install
Option A: One-line install (Linux / macOS)
OS=$(uname -s | tr '[:upper:]' '[:lower:]'); ARCH=$(uname -m | sed -e 's/x86_64/amd64/' -e 's/aarch64/arm64/'); curl -LO "https://github.com/guyskk/claude-code-config-switcher/releases/latest/download/ccc-${OS}-${ARCH}" && sudo install -m 755 "ccc-${OS}-${ARCH}" /usr/local/bin/ccc && rm "ccc-${OS}-${ARCH}" && ccc --version
Option B: Download from Releases
Download the binary for your platform (ccc-darwin-arm64, ccc-linux-amd64, etc.) and install to /usr/local/bin/.
2. Configure
If you already have ~/.claude/settings.json, the first time you run ccc it will prompt to migrate and automatically generate the ccc config at ~/.claude/ccc.json.
You can also create the config file manually:
{
"settings": {
"permissions": {
"defaultMode": "bypassPermissions"
}
},
"providers": {
"glm": {
"env": {
"ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
"ANTHROPIC_MODEL": "glm-4.7"
}
},
"kimi": {
"env": {
"ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
"ANTHROPIC_MODEL": "kimi-k2-thinking"
}
}
}
}
Security Warning:
bypassPermissionsallows Claude Code to execute tools without confirmation. Only use this in trusted environments.
3. Use
# Show help
ccc --help
# Switch to a provider and run Claude Code
ccc glm
# Run with current provider
ccc
# Pass any Claude Code arguments
ccc glm -p
4. Validate (Optional)
Verify your provider configuration:
# Validate current provider
ccc validate
# Validate all providers
ccc validate --all
Patch Command: Replace claude with ccc
Make ccc your default Claude Code by replacing the system claude command.
# Replace claude command with ccc (requires sudo)
sudo ccc patch
# After patching, `claude` command now uses ccc
claude --help # Shows ccc help
# Restore original claude command
sudo ccc patch --reset
Configuration
Config file location, default: ~/.claude/ccc.json
Configuration Merge Strategy
When you run ccc, your existing settings.json is read and deep-merged with ccc.json. Priority: user settings.json > provider > base settings. Your manual edits, plugins, and hooks are preserved; provider env is passed via command line and never written into settings.json.
Environment Variable Handling
Claude Code's settings.json env field overrides environment variables passed by ccc when launching claude. To ensure provider env takes precedence, ccc passes provider env via the --settings CLI parameter, which has higher priority than settings.json.
This means:
- Your
settings.jsonenvis preserved as-is (ccc never modifies it) - Provider env automatically overrides conflicting keys via
--settings - Non-conflicting keys in
settings.jsonstill work normally
{
"settings": {
"permissions": {
"defaultMode": "bypassPermissions"
},
"alwaysThinkingEnabled": true
},
"claude_args": ["--verbose"],
"current_provider": "glm",
"providers": {
"glm": {
"env": {
"ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
"ANTHROPIC_MODEL": "glm-4.7"
}
},
"kimi": {
"env": {
"ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic",
"ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
"ANTHROPIC_MODEL": "kimi-k2-thinking",
"ANTHROPIC_SMALL_FAST_MODEL": "kimi-k2-0905-preview"
}
}
}
}
Config Fields
| Field | Description |
|---|---|
settings | Shared Claude Code config template for all providers |
claude_args | Fixed arguments to pass to Claude Code (optional) |
current_provider | Currently used provider (auto-managed by ccc) |
providers.{name} | Provider-specific Claude Code configuration |
Provider Configuration
Each provider only needs to specify the fields it wants to override. Common fields:
| Field | Description |
|---|---|
env.ANTHROPIC_BASE_URL | API endpoint URL |
env.ANTHROPIC_AUTH_TOKEN | API key/token |
env.ANTHROPIC_MODEL | Main model to use |
env.ANTHROPIC_SMALL_FAST_MODEL | Fast model for quick tasks |
How merging works: Provider settings are deep-merged with the base template. Provider env takes precedence over settings.env.
Environment Variables
| Variable | Description |
|---|---|
CCC_CONFIG_DIR | Override config directory (default: ~/.claude/) |
# Debug with custom config directory
CCC_CONFIG_DIR=./tmp ccc glm
Building from Source
# Build for all platforms
./build.sh --all
# Build for specific platforms
./build.sh -p darwin-arm64,linux-amd64
# Custom output directory
./build.sh -o ./bin
Supported platforms: darwin-amd64, darwin-arm64, linux-amd64, linux-arm64
License
MIT License - see LICENSE file for details.
Files in the repo
- .github
- docs
- internal
- tests
- .gitignore
- .markdownlint.json
- build.sh
- CHANGELOG.md
- check.sh
- CLAUDE.md
- go.mod
- go.sum
- integration_test.go
- LICENSE
- main.go
- README-CN.md
- README.md
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.