A lightweight CLI tool for switching between Claude Code profiles with different MCP server configurations and authentication methods.
- 🔄 Quick Profile Switching: Interactive TUI for selecting profiles
- 🔐 Dual Auth Support: Standard Claude account (keychain) and Vertex AI (env vars)
- ⚙️ MCP Configuration: Automatic merging of MCP server configs
- 🎨 Beautiful TUI: Clean, keyboard-driven interface with visual indicators
- 🔒 Secure: Credentials stored in system keyring (macOS Keychain / Linux Secret Service)
- 📦 Self-Contained: Single binary with no external dependencies
brew install virtuallytd/tap/claude-code-switcherShell Integration — Add to ~/.zshrc or ~/.bashrc:
ccs() {
# If no arguments, "switch", or "reload", run with eval
if [[ $# -eq 0 ]] || [[ "$1" == "switch" ]] || [[ "$1" == "reload" ]]; then
eval "$(command ccs "$@")"
else
# Pass through other commands (save, current, version, help) directly
command ccs "$@"
fi
}Reload your shell:
source ~/.zshrcVerify:
ccs versionFor more Homebrew options and tap usage, see virtuallytd/homebrew-tap.
- Download the latest binary from releases
- Extract and move to your PATH:
tar -xzf ccs_*.tar.gz sudo mv ccs /usr/local/bin/ - Add the shell function above to your shell config
git clone https://github.com/virtuallytd/claude-code-switcher
cd claude-code-switcher
make installThen add the shell function above to your shell config.
ccs manages Claude Code profiles by:
- Storing profiles in
~/.claude/profiles/<name>/with their ownsettings.json - Switching merges the selected profile's MCP server config into
~/.claude.json - Authentication handles two modes:
- Standard: Copies session tokens between keyring entries (macOS Keychain / Linux Secret Service)
- Vertex AI: Exports environment variables via shell function
The shell wrapper (eval "$(ccs switch)") is required for environment variable export in Vertex AI profiles.
📖 Want more details? See HOW-IT-WORKS.md for a deep dive into the implementation, architecture, and Claude Code integration.
Interactive profile selector:
ccsThis launches a TUI where you can:
- Navigate with arrow keys or
j/k - Select with
Enter - Quit with
q,Esc, orCtrl+C
Re-apply the current profile without interactive selection (useful after editing settings.json):
ccs reloadSave your current Claude Code session token for a profile (required once per standard auth profile):
claude login # Login to Claude first
ccs save personal # Save token for "personal" profileThis is only needed for standard auth profiles. Vertex AI profiles use gcloud credentials.
ccs currentOutput example:
work (vertex)
Profiles live in ~/.claude/profiles/<name>/:
~/.claude/profiles/
├── personal/
│ └── settings.json # MCP server config (required)
└── work/
├── settings.json # MCP server config (required)
└── env.zsh # Vertex AI vars (optional)
Create directory and settings:
mkdir -p ~/.claude/profiles/personalAdd settings.json:
{
"mcpServers": {
"server-name": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}Then save your session token:
claude login
ccs save personalCreate directory, settings, and env vars:
mkdir -p ~/.claude/profiles/workAdd settings.json (same format as above).
Add env.zsh:
export CLAUDE_CODE_USE_VERTEX=1
export CLOUD_ML_REGION=us-east5
export ANTHROPIC_VERTEX_PROJECT_ID=your-project-idVertex AI authentication relies on gcloud auth being configured.
- Profile Discovery: Scans
~/.claude/profiles/for valid profiles - Interactive Selection: Shows TUI with profile list
- Environment Cleanup: Clears Vertex AI vars (prevents leakage)
- Authentication:
- Vertex AI profiles: Sources
env.zshenvironment variables - Standard profiles: Restores session token from keyring to active
"Claude Code"entry
- Vertex AI profiles: Sources
- Settings Merge: Merges
mcpServersfrom profile into~/.claude/settings.json - Shell Commands: Outputs
export/unsetcommands to stdout (eval'd by shell function)
●Filled dot = Currently active profile○Empty dot = Inactive profile- Orange text = Vertex AI profile
- Blue text = Standard auth profile
❯Cursor on selected item
- ✅ macOS: Uses Keychain for secure token storage
- ✅ Linux: Uses Secret Service (gnome-keyring, KWallet)
- ❌ Windows: Not currently supported
SSE (Server-Sent Events) for local servers:
{
"type": "sse",
"url": "http://localhost:3000/sse"
}HTTP for OAuth-based remote servers:
{
"type": "http",
"url": "https://api.example.com"
}"http" for SSE servers — it will cause OAuth authentication errors.
- Session tokens: Encrypted in system keyring (Keychain/Secret Service)
- Vertex AI credentials: Uses
gcloud auth(not stored in profiles) - Environment isolation: Vertex vars cleared before every switch
- File permissions: Settings files should be
0644(readable by owner)
Run claude login first, then switch profiles.
For standard auth profiles, you need to save the token:
claude login
ccs save <profile-name>Ensure the profile directory has a valid settings.json file.
See CONTRIBUTING.md for contribution guidelines.
make build # Build binary
make test # Run tests
make snapshot # Test GoReleaser build locally- bubbletea - TUI framework
- lipgloss - Terminal styling
- 99designs/keyring - Cross-platform keyring
ccs/
├── main.go # CLI entrypoint
├── cmd/
│ ├── switch.go # Interactive switcher (TUI)
│ ├── current.go # Show active profile
│ ├── reload.go # Reload current profile
│ └── save.go # Save session token
└── internal/
├── profile/ # Profile discovery & loading
├── keyring/ # Keyring wrapper
└── config/ # Settings.json merging
See SECURITY.md for security policy and reporting vulnerabilities
MIT
Issues and pull requests welcome!