@aravhawk/cc-switch
v2.1.0
Published
Profile manager for Claude Code settings
Maintainers
Readme
cc-switch
Profile manager for Claude Code settings. Easily manage and switch between multiple Claude Code configurations.
Installation
npm install -g @aravhawk/cc-switchOr with pnpm:
pnpm add -g @aravhawk/cc-switchUsage
Interactive Mode
Run cc-switch without arguments to enter interactive mode:
cc-switchThis will present a menu with options to:
- Show the current profile
- Switch between profiles
- Create new profiles
- Delete profiles
- Rename profiles
- List all profiles
Command Line Mode
Actions use flags. Use a positional profile name for quick switching.
Switch Profile
cc-switch <profile-name>Or explicit:
cc-switch --switch <profile-name>Example:
cc-switch workCreate Profile
Create a new profile from your current ~/.claude/settings.json:
cc-switch --create <profile-name>Example:
cc-switch --create personalNew profiles are activated immediately after creation.
Create From Provider Template
Create and apply provider defaults in one step (prompts for API key if omitted):
cc-switch --create <profile-name> --template moonshot --api-key <your-key>Available templates:
- anthropic (claude) – no API key needed; leaves defaults in place
- moonshot (kimi)
- zai (glm)
- minimax
Templates set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and default Haiku/Sonnet/Opus models, and remove any existing ANTHROPIC_API_KEY.
Delete Profile
Delete an existing profile (cannot delete the active profile):
cc-switch --delete <profile-name>Example:
cc-switch --delete old-configRename Profile
Rename an existing profile:
cc-switch --rename <old-name> <new-name>Or:
cc-switch --rename <old-name> --to <new-name>Example:
cc-switch --rename work work-2024List Profiles
List all available profiles:
cc-switch --listCurrent Profile
Show the active profile:
cc-switch --currentHelp and Version
cc-switch help
cc-switch --help
cc-switch version
cc-switch --versionReserved profile names: help and version.
How It Works
cc-switch manages multiple Claude Code profiles by storing copies of your settings.json file in separate profile directories.
Data Layout
~/.cc-switch/
├── profiles/
│ ├── default/
│ │ └── settings.json
│ ├── work/
│ │ └── settings.json
│ └── personal/
│ └── settings.json
└── state.jsonState File
The state.json file tracks the currently active profile:
{
"activeProfile": "default",
"lastSyncedAt": "2026-02-01T12:34:56.789Z"
}Switch Behavior
When you switch profiles:
- The current
~/.claude/settings.jsonis mirrored back to the active profile's directory - The target profile's
settings.jsonis copied to~/.claude/settings.json - The active profile is updated in
state.json
This ensures you never lose your current settings when switching.
Requirements
- Node.js 18 or higher
- Claude Code installed (with
~/.claude/settings.jsonpresent)
First-Time Setup
If you don't have a ~/.claude/settings.json file, you'll see this error:
No ~/.claude/settings.json found. Run Claude Code once to generate it,
or run the setup script provided by your provider (e.g., Z.ai).Simply run Claude Code once to generate the initial settings file, then you can start using cc-switch.
Profile Name Rules
Profile names must:
- Not be empty
- Only contain letters, numbers, hyphens, and underscores
- Not contain path separators (
/,\,..) - Not be reserved words (
help,version)
Error Handling
cc-switch provides clear error messages for common issues:
- Missing Claude settings file
- Profile not found
- Attempting to delete the active profile
- Invalid profile names
- Permission errors
All operations use atomic file writes to prevent data loss.
