Skip to content
Back to search

claude-code-config-switcher

Switch between multiple Claude Code providers (Kimi, GLM, MiniMax, etc.) with a single command.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/guyskk--claude-code-config-switcher/badge.svg)](/listings/guyskk--claude-code-config-switcher)

HTML

<a href="/listings/guyskk--claude-code-config-switcher"><img src="/api/listings/guyskk--claude-code-config-switcher/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

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](https://github.com/guyskk/claude-code-config-switcher/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**: `bypassPermissions` allows 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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 203 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. # ccc - Claude Code Configuration Switcher
  2. [English](README.md) | [中文文档](README-CN.md)
  3. #### Recommended LLMs
  4. - **小米顶尖模型 MiMo V2.5-Pro 等,通过我的邀请码注册:双方各得 ¥10 API 体验金 + 首单 9 折。邀请码:2DZZC9。注册: https://platform.xiaomimimo.com?ref=2DZZC9 (注册后自动填入 · 体验金 40 天有效)**
  5. - **智谱 Coding Plan,国内顶流编程大模型,20+主流工具全适配,性价比拉满!👉立即参与「拼好模」:https://www.bigmodel.cn/glm-coding?ic=S8PMS595T0**
  6. ## Why ccc?
  7. `ccc` is a CLI tool that provides seamless provider switching for Claude Code. Switch between Kimi, GLM, MiniMax, and other providers with one command.
  8. ## Quick Start
  9. ### 1. Install
  10. #### Option A: One-line install (Linux / macOS)
  11. ```bash
  12. 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
  13. ```
  14. #### Option B: Download from [Releases](https://github.com/guyskk/claude-code-config-switcher/releases)
  15. Download the binary for your platform (`ccc-darwin-arm64`, `ccc-linux-amd64`, etc.) and install to `/usr/local/bin/`.
  16. ### 2. Configure
  17. 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`.
  18. You can also create the config file manually:
  19. ```json
  20. {
  21. "settings": {
  22. "permissions": {
  23. "defaultMode": "bypassPermissions"
  24. }
  25. },
  26. "providers": {
  27. "glm": {
  28. "env": {
  29. "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
  30. "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
  31. "ANTHROPIC_MODEL": "glm-4.7"
  32. }
  33. },
  34. "kimi": {
  35. "env": {
  36. "ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic",
  37. "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
  38. "ANTHROPIC_MODEL": "kimi-k2-thinking"
  39. }
  40. }
  41. }
  42. }
  43. ```
  44. > **Security Warning**: `bypassPermissions` allows Claude Code to execute tools without confirmation. Only use this in trusted environments.
  45. ### 3. Use
  46. ```bash
  47. # Show help
  48. ccc --help
  49. # Switch to a provider and run Claude Code
  50. ccc glm
  51. # Run with current provider
  52. ccc
  53. # Pass any Claude Code arguments
  54. ccc glm -p
  55. ```
  56. ### 4. Validate (Optional)
  57. Verify your provider configuration:
  58. ```bash
  59. # Validate current provider
  60. ccc validate
  61. # Validate all providers
  62. ccc validate --all
  63. ```
  64. ## Patch Command: Replace `claude` with `ccc`
  65. Make `ccc` your default Claude Code by replacing the system `claude` command.
  66. ```bash
  67. # Replace claude command with ccc (requires sudo)
  68. sudo ccc patch
  69. # After patching, `claude` command now uses ccc
  70. claude --help # Shows ccc help
  71. # Restore original claude command
  72. sudo ccc patch --reset
  73. ```
  74. ## Configuration
  75. Config file location, default: `~/.claude/ccc.json`
  76. ### Configuration Merge Strategy
  77. 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`.
  78. #### Environment Variable Handling
  79. 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`.
  80. This means:
  81. - Your `settings.json` `env` is preserved as-is (ccc never modifies it)
  82. - Provider env automatically overrides conflicting keys via `--settings`
  83. - Non-conflicting keys in `settings.json` still work normally
  84. ```json
  85. {
  86. "settings": {
  87. "permissions": {
  88. "defaultMode": "bypassPermissions"
  89. },
  90. "alwaysThinkingEnabled": true
  91. },
  92. "claude_args": ["--verbose"],
  93. "current_provider": "glm",
  94. "providers": {
  95. "glm": {
  96. "env": {
  97. "ANTHROPIC_BASE_URL": "https://open.bigmodel.cn/api/anthropic",
  98. "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
  99. "ANTHROPIC_MODEL": "glm-4.7"
  100. }
  101. },
  102. "kimi": {
  103. "env": {
  104. "ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic",
  105. "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY_HERE",
  106. "ANTHROPIC_MODEL": "kimi-k2-thinking",
  107. "ANTHROPIC_SMALL_FAST_MODEL": "kimi-k2-0905-preview"
  108. }
  109. }
  110. }
  111. }
  112. ```
  113. ### Config Fields
  114. | Field | Description |
  115. | ------------------- | -------------------------------------------- |
  116. | `settings` | Shared Claude Code config template for all providers |
  117. | `claude_args` | Fixed arguments to pass to Claude Code (optional) |
  118. | `current_provider` | Currently used provider (auto-managed by ccc) |
  119. | `providers.{name}` | Provider-specific Claude Code configuration |
  120. ### Provider Configuration
  121. Each provider only needs to specify the fields it wants to override. Common fields:
  122. | Field | Description |
  123. | --------------------------------- | ------------------------------ |
  124. | `env.ANTHROPIC_BASE_URL` | API endpoint URL |
  125. | `env.ANTHROPIC_AUTH_TOKEN` | API key/token |
  126. | `env.ANTHROPIC_MODEL` | Main model to use |
  127. | `env.ANTHROPIC_SMALL_FAST_MODEL` | Fast model for quick tasks |
  128. **How merging works**: Provider settings are deep-merged with the base template. Provider `env` takes precedence over `settings.env`.
  129. ### Environment Variables
  130. | Variable | Description |
  131. | ------------------ | -------------------------------------------------- |
  132. | `CCC_CONFIG_DIR` | Override config directory (default: `~/.claude/`) |
  133. ```bash
  134. # Debug with custom config directory
  135. CCC_CONFIG_DIR=./tmp ccc glm
  136. ```
  137. ## Building from Source
  138. ```bash
  139. # Build for all platforms
  140. ./build.sh --all
  141. # Build for specific platforms
  142. ./build.sh -p darwin-arm64,linux-amd64
  143. # Custom output directory
  144. ./build.sh -o ./bin
  145. ```
  146. **Supported platforms:** `darwin-amd64`, `darwin-arm64`, `linux-amd64`, `linux-arm64`
  147. ## License
  148. MIT License - see LICENSE file for details.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.