A CLI tool for managing multiple Claude Code accounts with shared customizations.
Claude Code stores configuration, history, and customizations in ~/.claude. If you use Claude Code with multiple Anthropic accounts (e.g., personal and work), you need separate configurations for each. ccswap lets you:
- Switch accounts instantly - No re-authentication needed
- Share customizations - Skills, commands, and plugins work across all accounts
- Isolate data - Each account has its own history, projects, and settings
- macOS or Linux
- jq - JSON processor
- Claude Code CLI installed
Install jq on macOS:
brew install jqcurl -fsSL https://raw.githubusercontent.com/vvinhas/ccswap/main/scripts/install.sh | bashThen add to your shell profile (~/.zshrc or ~/.bashrc):
export PATH="$HOME/.ccswap/bin:$PATH"Reload your shell:
source ~/.zshrc # or source ~/.bashrcgit clone https://github.com/vvinhas/ccswap.git
cd ccswap
./bin/ccswap initThen add ~/.ccswap/bin to your PATH as shown above.
# Initialize (requires ~/.claude to exist)
ccswap init
# Create accounts
ccswap add work
ccswap add personal
# Switch between accounts
ccswap use work # Switch to work account
ccswap use personal # Switch to personal account
# List all accounts (* marks active)
ccswap list
# Start Claude with active account
ccsWhen you first run ccs with a new account, Claude will prompt you to authenticate. This creates the account's .claude.json with your OAuth credentials.
| Command | Description |
|---|---|
ccswap init |
Initialize ccswap (first-time setup) |
ccswap add <name> |
Create a new account |
ccswap new <name> |
Alias for add |
ccswap remove <name> |
Remove an account |
ccswap use <name> |
Switch to an account |
ccswap list |
List all accounts |
ccswap link skill <name> |
Link a skill from ~/.agents/skills to account(s) |
ccswap --help |
Show help |
ccswap --version |
Show version |
Use ccs instead of claude to launch Claude Code with your active account:
ccs # Start Claude Code
ccs --help # Pass arguments to claude
ccs -p "explain this" # Use with any claude flagsLink skills from ~/.agents/skills/ into account(s):
# Link to active account
ccswap link skill agent-browser
# Link to a specific account
ccswap link skill agent-browser --account=work
# Link to multiple accounts
ccswap link skill agent-browser --accounts=work,personal
# Link to all accounts (except main)
ccswap link skill agent-browser --allIf the skill already exists in the target account, it will be skipped with a warning.
If you want to use claude directly with ccswap, add this alias to your shell profile (~/.zshrc or ~/.bashrc):
alias claude="ccs"After reloading your shell (source ~/.zshrc), running claude will automatically use your active ccswap account.
~/.ccswap/
├── config.json # Active account and account list
├── bin/
│ ├── ccswap # Account management script
│ └── ccs # Claude launcher
└── accounts/
├── main -> ~/.claude # Main account (symlink to original config)
├── work/ # Work account config
│ ├── .claude.json # OAuth credentials (created on first login)
│ ├── settings.json
│ ├── projects/
│ ├── skills -> ../main/skills
│ └── ...
└── personal/ # Personal account config
├── .claude.json # OAuth credentials (created on first login)
├── settings.json
├── projects/
├── skills -> ../main/skills
└── ...
Shared (symlinked to main account):
skills/- Custom skillscommands/- Custom commandsplugins/- Installed pluginsagents/- Custom agents
Account-Specific (isolated per account):
.claude.json- OAuth credentials (created fresh on first login)settings.json- Permissions and preferences (optionally linked to main)projects/- Project memorytodos/- Task listscache/- Cached data- History and telemetry
ccs launches Claude with CLAUDE_CONFIG_DIR set to the active account's directory:
CLAUDE_CONFIG_DIR=~/.ccswap/accounts/work claudeWhen you run ccswap init, your existing ~/.claude directory becomes the "main" account via symlink. This preserves your current configuration and makes shared resources (skills, commands, plugins) available to all accounts.
New accounts created with ccswap add <name> get:
- Symlinks to main's shared directories (skills, commands, plugins, agents)
- Their own
.claude.json(created by Claude on first login - you'll need to authenticate) - Optionally, a symlink to main's settings.json
Install jq:
# macOS
brew install jq
# Ubuntu/Debian
sudo apt install jq
# Fedora
sudo dnf install jqRun the init command:
ccswap initSwitch to another account first:
ccswap other-account
ccswap remove account-to-deleteEnsure PATH is set correctly:
echo $PATH | grep -q ".ccswap/bin" && echo "OK" || echo "Add ~/.ccswap/bin to PATH"MIT