Multi-account switcher for Claude Code
Project description
claude-swap
Multi-account switcher for Claude Code. Easily switch between multiple Claude accounts without logging out.
Installation
Using uv (recommended)
uv tool install claude-swap
Using pipx
pipx install claude-swap
From source
git clone https://github.com/realiti4/claude-swap.git
cd claude-swap
uv sync
uv run cswap --help
Usage
Add your first account
Log into Claude Code with your first account, then:
cswap --add-account
Add more accounts
Log out of Claude Code, log in with another account, then:
cswap --add-account
Refresh expired tokens
If an account's token expires, log back into Claude Code with that account and re-run:
cswap --add-account
This will update the stored credentials without creating a duplicate.
Switch accounts
Rotate to the next account:
cswap --switch
Or switch to a specific account:
cswap --switch-to 2
cswap --switch-to user@example.com
Note: Restart Claude Code after switching for the new account to take effect.
Other commands
cswap --list # List all accounts with usage stats
cswap --status # Show current account
cswap --remove-account 2 # Remove an account
cswap --purge # Remove all claude-swap data
How it works
- Backs up OAuth tokens and config when you add an account
- Swaps credentials when you switch accounts
- Account credentials stored securely using platform-appropriate methods
Data locations
| Platform | Credentials | Config backups |
|---|---|---|
| Windows | Windows Credential Manager | ~/.claude-swap-backup/ |
| macOS | macOS Keychain | ~/.claude-swap-backup/ |
| Linux | File-based (~/.claude-swap-backup/credentials/) |
~/.claude-swap-backup/ |
Uninstall
Remove all data:
cswap --purge
Then uninstall the tool:
uv tool uninstall claude-swap
# or
pipx uninstall claude-swap
Requirements
- Python 3.12+
- Claude Code installed and logged in
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_swap-0.7.1.tar.gz.
File metadata
- Download URL: claude_swap-0.7.1.tar.gz
- Upload date:
- Size: 45.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d5bf978da73a6088fcf0d85c531c053a04ea670438a0c8e6ecf898ad6e903c5
|
|
| MD5 |
4e18423cdd7e0419a2a4f751c2360a73
|
|
| BLAKE2b-256 |
5ed6181b1905e8e71d487eb24c0b83e444b45d8f8936ec2b406f6ef380b33908
|
Provenance
The following attestation bundles were made for claude_swap-0.7.1.tar.gz:
Publisher:
publish.yml on realiti4/claude-swap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_swap-0.7.1.tar.gz -
Subject digest:
0d5bf978da73a6088fcf0d85c531c053a04ea670438a0c8e6ecf898ad6e903c5 - Sigstore transparency entry: 1228238353
- Sigstore integration time:
-
Permalink:
realiti4/claude-swap@c151310df520cfc56d0e769409422f1421f7d041 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/realiti4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c151310df520cfc56d0e769409422f1421f7d041 -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_swap-0.7.1-py3-none-any.whl.
File metadata
- Download URL: claude_swap-0.7.1-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33204e22a2d250eaff6dc9b1d7e718a10020da5e92180a56974022f37d132057
|
|
| MD5 |
db8aa18621d9fc38a21a4c87bdf3b38a
|
|
| BLAKE2b-256 |
41bef7471ef43d49bd20305c6cf3815e2a0a73fdd6ef0ccfa339a560e15fdd7c
|
Provenance
The following attestation bundles were made for claude_swap-0.7.1-py3-none-any.whl:
Publisher:
publish.yml on realiti4/claude-swap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_swap-0.7.1-py3-none-any.whl -
Subject digest:
33204e22a2d250eaff6dc9b1d7e718a10020da5e92180a56974022f37d132057 - Sigstore transparency entry: 1228238412
- Sigstore integration time:
-
Permalink:
realiti4/claude-swap@c151310df520cfc56d0e769409422f1421f7d041 -
Branch / Tag:
refs/tags/v0.7.1 - Owner: https://github.com/realiti4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c151310df520cfc56d0e769409422f1421f7d041 -
Trigger Event:
release
-
Statement type: