- Reorganized README structure with collapsible sections for better readability - Added comprehensive GLMT experimental warnings and troubleshooting guides - Updated installation instructions with traditional vs npm options - Added parallel workflow examples and detailed feature comparisons - Enhanced documentation with proper acknowledgments and security limits - Standardized language and formatting across all README variants
CCS - Claude Code Switch
One command, zero downtime, multiple accounts
Switch between multiple Claude accounts, GLM, and Kimi instantly.
Stop hitting rate limits. Keep working continuously.
Languages: English | Tiếng Việt | 日本語
Quick Start
Installation
npm Package (Recommended)
macOS / Linux / Windows
npm install -g @kaitranntt/ccs
All major package managers are supported:
# yarn
yarn global add @kaitranntt/ccs
# pnpm (70% less disk space)
pnpm add -g @kaitranntt/ccs
# bun (30x faster)
bun add -g @kaitranntt/ccs
Alternative: Direct Install (Traditional)
macOS / Linux
curl -fsSL ccs.kaitran.ca/install | bash
Windows PowerShell
irm ccs.kaitran.ca/install | iex
Note: Traditional installs bypass Node.js routing for faster startup, but npm is prioritized for easier deployment automation.
Configuration (Auto-created)
CCS automatically creates configuration during installation (via npm postinstall script).
~/.ccs/config.json:
{
"profiles": {
"glm": "~/.ccs/glm.settings.json",
"glmt": "~/.ccs/glmt.settings.json",
"kimi": "~/.ccs/kimi.settings.json",
"default": "~/.claude/settings.json"
}
}
Custom Claude CLI Path
If Claude CLI is installed in a non-standard location (D drive, custom directory), set CCS_CLAUDE_PATH:
export CCS_CLAUDE_PATH="/path/to/claude" # Unix
$env:CCS_CLAUDE_PATH = "D:\Tools\Claude\claude.exe" # Windows
See also: Troubleshooting Guide for detailed setup instructions.
Windows Symlink Support (Developer Mode)
Windows users: Enable Developer Mode for true symlinks (better performance, instant sync):
- Open Settings → Privacy & Security → For developers
- Enable Developer Mode
- Reinstall CCS:
npm install -g @kaitranntt/ccs
Warning: Without Developer Mode, CCS automatically falls back to copying directories (works but no instant sync across profiles).
Your First Switch
Important
Before using alternative models, update API keys in settings files:
- GLM: Edit
~/.ccs/glm.settings.jsonand add your Z.AI Coding Plan API Key- GLMT: Edit
~/.ccs/glmt.settings.jsonand add your Z.AI Coding Plan API Key- Kimi: Edit
~/.ccs/kimi.settings.jsonand add your Kimi API key
Parallel Workflow: Planning + Execution
# Terminal 1 - Planning (Claude Sonnet)
ccs "Plan a REST API with authentication and rate limiting"
# Terminal 2 - Execution (GLM, cost-optimized)
ccs glm "Implement the user authentication endpoints from the plan"
Thinking Models (Kimi & GLMT)
# Kimi - Stable thinking support
ccs kimi "Design a caching strategy with trade-off analysis"
# GLMT - Experimental (see full disclaimer below)
ccs glmt "Debug complex algorithm with reasoning steps"
Note: GLMT is experimental and unstable. See GLM with Thinking (GLMT) section below for full details.
The Daily Developer Pain Point
Session limits shouldn't kill your flow state.
Developers face multiple subscription scenarios daily:
- Account Separation - Company Claude account vs personal Claude → you must manually switch contexts to keep work and personal separate
- Rate Limits Hit - Claude stops mid-project → you manually edit
~/.claude/settings.json - Cost Management - 2-3 Pro subscriptions ($20/month each) vs Claude Max at 5x cost ($100/month) → Pro tier is the practical ceiling for most developers
- Model Choice - Different tasks benefit from different model strengths → manual switching
Manual context switching breaks your workflow. CCS manages it seamlessly.
Why CCS Instead of Manual Switching?
| Feature | Benefit |
|---|---|
| Account Isolation | Keep work separate from personal |
| Cost Optimization | 2-3 Pro accounts vs Max at 5x cost |
| Instant Switching | One command, no file editing |
| Zero Downtime | Never interrupt workflow |
| Rate Limit Management | Switch accounts when limits hit |
| Cross-Platform | macOS, Linux, Windows |
Architecture
Profile Types
Settings-based: GLM, GLMT, Kimi, default
- Uses
--settingsflag pointing to config files - GLMT: Embedded proxy for thinking mode support
Account-based: work, personal, team
- Uses
CLAUDE_CONFIG_DIRfor isolated instances - Create with
ccs auth create <profile>
Shared Data (v3.1)
Commands and skills symlinked from ~/.ccs/shared/ - no duplication across profiles.
~/.ccs/
├── shared/ # Shared across all profiles
│ ├── agents/
│ ├── commands/
│ └── skills/
├── instances/ # Profile-specific data
│ └── work/
│ ├── agents@ → shared/agents/
│ ├── commands@ → shared/commands/
│ ├── skills@ → shared/skills/
│ ├── settings.json # API keys, credentials
│ ├── sessions/ # Conversation history
│ └── ...
| Type | Files |
|---|---|
| Shared | commands/, skills/, agents/ |
| Profile-specific | settings.json, sessions/, todolists/, logs/ |
Note
Windows: Copies directories if symlinks unavailable (enable Developer Mode for true symlinks)
Usage Examples
Basic Switching
ccs # Claude subscription (default)
ccs glm # GLM (cost-optimized)
ccs kimi # Kimi (with thinking support)
Multi-Account Setup
# Create accounts
ccs auth create work
ccs auth create personal
Run concurrently in separate terminals:
# Terminal 1 - Work
ccs work "implement feature"
# Terminal 2 - Personal (concurrent)
ccs personal "review code"
Help & Version
ccs --version # Show version
ccs --help # Show all commands and options
GLM with Thinking (GLMT)
Caution
NOT PRODUCTION READY - EXPERIMENTAL FEATURE
GLMT is experimental and requires extensive debugging:
- Streaming and tool support still under active development
- May experience unexpected errors, timeouts, or incomplete responses
- Requires frequent debugging and manual intervention
- Not recommended for critical workflows or production use
Alternative for GLM Thinking: Consider going through the CCR hustle with the Transformer of Bedolla (ZaiTransformer) for a more stable implementation.
Important
GLMT requires npm installation (
npm install -g @kaitranntt/ccs). Not available in native shell versions (requires Node.js HTTP server).
Note
Acknowledgments: The Foundation That Made GLMT Possible
CCS's GLMT implementation owes its existence to the groundbreaking work of @Bedolla, who created ZaiTransformer - the first integration to bridge Claude Code Router (CCR) with Z.AI's reasoning capabilities.
Why this matters: Before ZaiTransformer, no one had successfully integrated Z.AI's thinking mode with Claude Code's workflow. Bedolla's work wasn't just helpful - it was foundational. His implementation of:
- Request/response transformation architecture - The conceptual blueprint for how to bridge Anthropic and OpenAI formats
- Thinking mode control mechanisms - The patterns for managing reasoning_content delivery
- Embedded proxy design - The architecture that CCS's GLMT proxy is built upon
These contributions directly inspired and enabled GLMT's design. Without ZaiTransformer's pioneering work, GLMT wouldn't exist in its current form. The technical patterns, transformation logic, and proxy architecture implemented in CCS are a direct evolution of the concepts Bedolla first proved viable.
Recognition: If you benefit from GLMT's thinking capabilities, you're benefiting from Bedolla's vision and engineering. Please consider starring ZaiTransformer to support pioneering work in the Claude Code ecosystem.
GLM vs GLMT Comparison
| Feature | GLM (ccs glm) |
GLMT (ccs glmt) |
|---|---|---|
| Endpoint | Anthropic-compatible | OpenAI-compatible |
| Thinking | No | Experimental (reasoning_content) |
| Tool Support | Basic | Unstable (v3.5+) |
| MCP Tools | Limited | Buggy (v3.5+) |
| Streaming | Stable | Experimental (v3.4+) |
| TTFB | <500ms | <500ms (sometimes), 2-10s+ (often) |
| Use Case | Reliable work | Debugging experiments only |
Tool Support (v3.5) - EXPERIMENTAL
GLMT attempts MCP tools and function calling:
- Bidirectional Transformation: Anthropic tools ↔ OpenAI format (unstable)
- MCP Integration: MCP tools sometimes execute (often output XML garbage)
- Streaming Tool Calls: Real-time tool calls (when not crashing)
- Backward Compatible: May break existing thinking support
- Configuration Required: Frequent manual debugging needed
Streaming Support (v3.4) - OFTEN FAILS
GLMT attempts real-time streaming with incremental reasoning content delivery:
- Default: Streaming enabled (TTFB <500ms when it works)
- Auto-fallback: Frequently switches to buffered mode due to errors
- Thinking parameter: Claude CLI
thinkingparameter sometimes works- May ignore
thinking.typeandbudget_tokens - Precedence: CLI parameter > message tags > default (when not broken)
- May ignore
Status: Z.AI (tested, tool calls frequently break, requires constant debugging)
How It Works (When It Works)
- CCS spawns embedded HTTP proxy on localhost (if not crashing)
- Proxy attempts to convert Anthropic format → OpenAI format (often fails)
- Tries to transform Anthropic tools → OpenAI function calling format (buggy)
- Forwards to Z.AI with reasoning parameters and tools (when not timing out)
- Attempts to convert
reasoning_content→ thinking blocks (partial or broken) - Attempts to convert OpenAI
tool_calls→ Anthropictool_useblocks (XML garbage common) - Thinking and tool calls sometimes appear in Claude Code UI (when not broken)
Control Tags & Keywords
Control Tags:
<Thinking:On|Off>- Enable/disable reasoning blocks (default: On)<Effort:Low|Medium|High>- Control reasoning depth (deprecated - Z.AI only supports binary thinking)
Thinking Keywords (inconsistent activation):
think- Sometimes enables reasoning (low effort)think hard- Sometimes enables reasoning (medium effort)think harder- Sometimes enables reasoning (high effort)ultrathink- Attempts maximum reasoning depth (often breaks)
Environment Variables
GLMT features (all experimental):
- Forced English output enforcement (sometimes works)
- Random thinking mode activation (unpredictable)
- Attempted streaming with frequent fallback to buffered mode
General:
CCS_DEBUG_LOG=1- Enable debug file loggingCCS_CLAUDE_PATH=/path/to/claude- Custom Claude CLI path
API Key Setup
# Edit GLMT settings
nano ~/.ccs/glmt.settings.json
Set Z.AI API key (requires coding plan):
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "your-z-ai-api-key"
}
}
Security Limits (DoS Protection)
v3.4 Protection Limits:
| Limit | Value | Purpose |
|---|---|---|
| SSE buffer | 1MB max per event | Prevent buffer overflow |
| Content buffer | 10MB max per block | Limit thinking/text blocks |
| Content blocks | 100 max per message | Prevent DoS attacks |
| Request timeout | 120s | Both streaming and buffered |
Debugging
Enable verbose logging:
ccs glmt --verbose "your prompt"
Enable debug file logging:
export CCS_DEBUG_LOG=1
ccs glmt --verbose "your prompt"
# Logs: ~/.ccs/logs/
GLMT debugging:
# Verbose logging shows streaming status and reasoning details
ccs glmt --verbose "test"
Check reasoning content:
cat ~/.ccs/logs/*response-openai.json | jq '.choices[0].message.reasoning_content'
Troubleshooting:
- If absent: Z.AI API issue (verify key, account status)
- If present: Transformation issue (check
response-anthropic.json)
Uninstall
Package Managers
# npm
npm uninstall -g @kaitranntt/ccs
# yarn
yarn global remove @kaitranntt/ccs
# pnpm
pnpm remove -g @kaitranntt/ccs
# bun
bun remove -g @kaitranntt/ccs
Official Uninstaller
# macOS / Linux
curl -fsSL ccs.kaitran.ca/uninstall | bash
# Windows PowerShell
irm ccs.kaitran.ca/uninstall | iex
🎯 Philosophy
- YAGNI: No features "just in case"
- KISS: Simple bash, no complexity
- DRY: One source of truth (config)
📖 Documentation
Complete documentation in docs/:
- Installation Guide
- Configuration
- Usage Examples
- System Architecture
- GLMT Control Mechanisms
- Troubleshooting
- Contributing
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Star History
License
CCS is licensed under the MIT License.
Made with ❤️ for developers who hit rate limits too often
