Critical Fixes: - Fixed PowerShell terminal closing when using `irm | iex` installation * Changed `exit 1` to `return` in install.ps1 (line 229) * Terminal now stays open on errors, showing full error messages * Affects: Windows PowerShell 5.1+, PowerShell 7+ - Fixed installation download path * Changed `/ccs.ps1` to `/lib/ccs.ps1` in install.ps1 (line 223) * Resolves standalone installation failures from GitHub - Simplified Claude CLI detection logic across all platforms * Removed complex validation that failed with npm-installed Claude * Now trusts system PATH (standard case for users) * Falls back to CCS_CLAUDE_PATH for custom installations * Fixes: `where.exe claude` shows installed but CCS reports "not found" Improvements: - Simplified error messages (removed lengthy search location details) - Reduced codebase by 332 lines (454 deleted, 122 added) - npm package size reduced: 17.2 KB → 15.9 KB (7.6% smaller) Cross-Platform Parity: - bash (lib/ccs): Simplified detection, removed validate_claude_cli - PowerShell (lib/ccs.ps1): Simplified detection, removed Test-ClaudeCli - Node.js (bin/*.js): Simplified detection, removed validateClaudeCli - All versions now use identical trust-the-PATH approach Files Modified: - installers/install.ps1: exit→return, download path fix - lib/ccs.ps1: simplified detection (165 lines removed) - lib/ccs: simplified detection (172 lines removed) - bin/claude-detector.js: simplified detection (86 lines removed) - bin/ccs.js: removed validation calls (31 lines removed) - .github/workflows/publish-npm.yml: fixed package name - CHANGELOG.md: comprehensive v2.4.1 release notes - VERSION, package.json: bumped to 2.4.1 Testing: bash validated, npm syntax checked, manual Windows testing recommended
CCS - Claude Code Switch
One command, zero downtime, right model for each task
Switch between Claude Sonnet 4.5 and GLM 4.6 instantly. Stop hitting rate limits. Start optimizing costs.
Languages: English | Tiếng Việt
🚀 Quick Start
🔑 Prerequisites
Before installing CCS, make sure you're logged into Claude CLI with your subscription account:
claude /login
Primary Installation Methods
Option 1: npm Package (Recommended)
macOS / Linux / Windows
npm install -g @kai/ccs
Compatible with npm, yarn, pnpm, and bun package managers.
Option 2: Direct Install (Traditional)
macOS / Linux
curl -fsSL ccs.kaitran.ca/install | bash
Windows PowerShell
irm ccs.kaitran.ca/install | iex
Your First Switch
# Use Claude subscription (default)
ccs "Review this architecture design"
# Switch to GLM for cost-optimized tasks
ccs glm "Create a simple REST API"
# Use GLM for all subsequent commands until switched back
ccs glm
ccs "Debug this issue"
ccs "Write unit tests"
Package Manager Options
All major package managers are supported:
# npm (default)
npm install -g @kai/ccs
# yarn
yarn global add @kai/ccs
# pnpm (70% less disk space)
pnpm add -g @kai/ccs
# bun (30x faster)
bun add -g @kai/ccs
Configuration (Auto-created)
~/.ccs/config.json:
{
"profiles": {
"glm": "~/.ccs/glm.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 Troubleshooting Guide for detailed setup instructions.
The Daily Developer Pain Point
You have both Claude subscription and GLM Coding Plan. Two scenarios happen every day:
- Rate Limits Hit: Claude stops mid-project → you manually edit
~/.claude/settings.json - Cost Waste: Simple tasks use expensive Claude → GLM would work fine
Manual switching breaks your flow. CCS fixes it instantly.
Why CCS Instead of Manual Switching?
| Feature | Benefit | Emotional Value |
|---|---|---|
| Instant Switching | One command, no file editing | Confidence, control |
| Zero Downtime | Never interrupt your workflow | Reliability, consistency |
| Smart Delegation | Right model for each task automatically | Simplicity, ease |
| Cost Control | Use expensive models only when needed | Efficiency, savings |
| Cross-Platform | Works on macOS, Linux, Windows | Flexibility, portability |
| Reliable | Pure bash/PowerShell, zero dependencies | Trust, peace of mind |
The Solution:
ccs # Use Claude subscription (default)
ccs glm # Switch to GLM fallback
# Hit rate limit? Switch instantly:
ccs glm # Continue working with GLM
One command. Zero downtime. No file editing. Right model, right task.
🏗️ Architecture Overview
graph LR
subgraph "User Command"
CMD[ccs glm]
end
subgraph "CCS Processing"
CONFIG[Read ~/.ccs/config.json]
LOOKUP[Lookup profile → settings file]
VALIDATE[Validate file exists]
end
subgraph "Claude CLI"
EXEC[claude --settings file_path]
end
subgraph "API Response"
API[Claude Sub or GLM API]
end
CMD --> CONFIG
CONFIG --> LOOKUP
LOOKUP --> VALIDATE
VALIDATE --> EXEC
EXEC --> API
⚡ Features
Instant Profile Switching
- One Command:
ccs glmto switch to GLM,ccsto use Claude subscription - no config file editing - Smart Detection: Automatically uses right model for each task
- Persistent: Switch stays active until changed again
Zero Workflow Interruption
- No Downtime: Switching happens instantly between commands
- Context Preservation: Your workflow remains uninterrupted
- Seamless Integration: Works exactly like native Claude CLI
Task Delegation
🚧 Work in Progress: This feature is experimental and not fully tested. Use with caution.
CCS includes intelligent task delegation via the /ccs meta-command:
Install CCS commands:
ccs --install # Install /ccs command to Claude CLI
Use task delegation:
# After running ccs --install, you can use:
/ccs glm /plan "add user authentication"
/ccs glm /code "implement auth endpoints"
/ccs glm /ask "explain this error"
Remove when not needed:
ccs --uninstall # Remove /ccs command from Claude CLI
Benefits:
- ✅ Save tokens by delegating simple tasks to cheaper models
- ✅ Use right model for each task automatically
- ✅ Seamless integration with existing workflows
- ✅ Clean installation and removal when needed
💻 Usage Examples
ccs # Use Claude subscription (default)
ccs glm # Use GLM fallback
ccs --version # Show CCS version and install location
ccs --install # Install CCS commands and skills to ~/.claude/
ccs --uninstall # Remove CCS commands and skills from ~/.claude/
🗑️ Uninstall
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/:
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📄 License
CCS is licensed under the MIT License.
Made with ❤️ for developers who hit rate limits too often
