Profile manager for Claude Code settings. Easily manage and switch between multiple Claude Code configurations.
npm install -g @aravhawk/cc-switchOr with pnpm:
pnpm add -g @aravhawk/cc-switchRun 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
Actions use flags. Use a positional profile name for quick switching.
cc-switch <profile-name>Or explicit:
cc-switch --switch <profile-name>Example:
cc-switch workCreate 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 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 an existing profile (cannot delete the active profile):
cc-switch --delete <profile-name>Example:
cc-switch --delete old-configRename 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 all available profiles:
cc-switch --listShow the active profile:
cc-switch --currentcc-switch help
cc-switch --help
cc-switch version
cc-switch --versionReserved profile names: help and version.
cc-switch manages multiple Claude Code profiles by storing copies of your settings.json file in separate profile directories.
~/.cc-switch/
├── profiles/
│ ├── default/
│ │ └── settings.json
│ ├── work/
│ │ └── settings.json
│ └── personal/
│ └── settings.json
└── state.json
The state.json file tracks the currently active profile:
{
"activeProfile": "default",
"lastSyncedAt": "2026-02-01T12:34:56.789Z"
}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.
- Node.js 18 or higher
- Claude Code installed (with
~/.claude/settings.jsonpresent)
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 names must:
- Not be empty
- Only contain letters, numbers, hyphens, and underscores
- Not contain path separators (
/,\,..) - Not be reserved words (
help,version)
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.