kaitranntt c8f85a1220 feat: initial commit - ultra-simple claude code switcher
- Core ccs bash script with profile switching
- Installation script with PATH verification
- Example config template
- Comprehensive README with troubleshooting
- Security: input validation, injection prevention
- MIT license
2025-11-01 17:01:42 -04:00

CCS - Claude Code Switch

Ultra-simple wrapper for claude --settings. Switch between Claude profiles with friendly aliases.

Why?

Claude CLI supports --settings flag but it's verbose:

claude --settings ~/.claude/glm.settings.json
claude --settings ~/.claude/sonnet.settings.json --verbose

CCS makes it friendly:

ccs glm
ccs sonnet --verbose

Installation

git clone https://github.com/yourusername/ccs.git
cd ccs
./install.sh

Or as a one-liner:

git clone https://github.com/yourusername/ccs.git && cd ccs && ./install.sh

Configuration

Copy example config:

cp .ccs.example.json ~/.ccs.json

Edit ~/.ccs.json with your profiles:

{
  "profiles": {
    "glm": "~/.claude/glm.settings.json",
    "sonnet": "~/.claude/sonnet.settings.json"
  }
}

Usage

Basic

ccs glm                  # Use GLM profile
ccs sonnet               # Use Sonnet profile

Pass Arguments Transparently

All arguments after the profile name are passed directly to Claude:

ccs glm --verbose
ccs sonnet /plan "add feature"
ccs opus --model claude-opus-4

Requirements

  • bash (3.2+ compatible)
  • jq (JSON processor)
  • Claude CLI installed

Installing jq

# macOS
brew install jq

# Ubuntu/Debian
sudo apt install jq

# Fedora
sudo dnf install jq

How It Works

  1. Reads profile name from first argument
  2. Looks up settings file path in ~/.ccs.json
  3. Executes claude --settings <path> [remaining-args]

That's it. No magic, no proxies, no file modification.

Troubleshooting

Profile not found

Error: Profile 'foo' not found in ~/.ccs.json

Solution: Add the profile to your ~/.ccs.json config file.

Settings file missing

Error: Settings file not found: ~/.claude/foo.settings.json

Solution: Create the settings file or update the path in your config.

jq not installed

Error: jq is required but not installed

Solution: Install jq using your package manager (see Requirements section).

PATH not set

⚠️  Warning: ~/.local/bin is not in PATH

Solution: Add to your shell profile (~/.bashrc or ~/.zshrc):

export PATH="$HOME/.local/bin:$PATH"

Then restart your shell or run source ~/.bashrc (or ~/.zshrc).

Use Cases

Claude Subscription + GLM Coding Plan

If you have both Claude subscription and GLM coding plan:

{
  "profiles": {
    "claude": "~/.claude/sonnet.settings.json",
    "glm": "~/.claude/glm.settings.json"
  }
}
ccs claude           # Use Claude subscription
ccs glm              # Use GLM coding plan

Multiple Anthropic Accounts

{
  "profiles": {
    "work": "~/.claude/work.settings.json",
    "personal": "~/.claude/personal.settings.json"
  }
}

Different Models

{
  "profiles": {
    "sonnet": "~/.claude/sonnet.settings.json",
    "opus": "~/.claude/opus.settings.json",
    "haiku": "~/.claude/haiku.settings.json"
  }
}

Uninstallation

rm ~/.local/bin/ccs
rm ~/.ccs.json

License

MIT

Contributing

PRs welcome! Keep it simple (KISS principle).

Philosophy

YAGNI: We don't add features "just in case" KISS: Simple bash script, no complexity DRY: One source of truth (config file)

This tool does ONE thing well: map profile names to settings files. Nothing more.

S
Description
Switch between Claude accounts, Gemini, Copilot, OpenRouter (300+ models) via CLIProxyAPI OAuth proxy. Visual dashboard, remote proxy support, WebSearch fallback. Zero-config to production-ready.
Readme MIT
33 MiB
Languages
TypeScript 81.4%
HTML 8.1%
JavaScript 7.1%
Swift 1.7%
Shell 1%
Other 0.6%