CLI for switching between multiple Claude Code accounts on macOS.
Claude Code doesn't support multiple accounts. If you use Claude Code with different accounts — say a personal one and a work one — switching means manually replacing ~/.claude.json and swapping the credential stored in the macOS Keychain. Do it wrong and you lose your config, break your session, or leak one account's credential into another.
claudini solves this by managing named profiles that bundle both the config file and the keychain credential. You switch accounts with a single command (claudini use work), and everything else — syncing shared settings, swapping credentials, updating symlinks — happens automatically. All credentials stay in the macOS Keychain; nothing is ever written to disk as plain text.
- Each profile stores its own
claude.jsonon disk and its credential in the macOS Keychain ~/.claude.jsonbecomes a symlink pointing to the active profile'sclaude.json- On switch, the keychain credential is swapped and shared fields (projects, settings, usage history) are synced from the outgoing profile to the incoming one
- Account-specific fields (OAuth tokens, user ID, org caches) stay per-profile
- Credentials never touch the filesystem — they are read from and written to the Keychain directly
~/.claudini/
config.json # { "active_profile": "personal" }
profiles/
personal/
claude.json # account-specific claude.json
work/
claude.json
backups/
before-upgrade/
claude.json # snapshot of ~/.claude.json
claude/ # snapshot of ~/.claude/ directory
macOS Keychain:
"Claude Code-credentials" # active credential (read by Claude Code)
"claudini-profile-personal" # personal profile credential
"claudini-profile-work" # work profile credential
"claudini-backup-before-upgrade" # backup credential
curl -fsSL https://raw.githubusercontent.com/kimrgrey/claudini/main/install.sh | shThe script detects your Mac's architecture (Apple Silicon or Intel), downloads the matching binary from the latest GitHub Release, and installs it to /usr/local/bin/claudini.
To install to a custom location:
INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/kimrgrey/claudini/main/install.sh | shDownload the binary for your architecture from the latest release:
- Apple Silicon:
claudini-aarch64-apple-darwin - Intel:
claudini-x86_64-apple-darwin
Then make it executable and move it to your PATH:
chmod +x claudini-*
mv claudini-* /usr/local/bin/claudinicargo install --path .Or build locally:
cargo build --release
# binary at target/release/claudiniCreate a backup of your current Claude Code configuration before making any changes:
claudini backup create initThis saves a snapshot of your ~/.claude.json, keychain credential, and ~/.claude/ directory so you can restore if anything goes wrong.
claudini initCreates the ~/.claudini/ directory structure and config.json. If already initialized, migrates any legacy plain text credential files to the Keychain.
claudini profile add personalReads the current ~/.claude.json and keychain credential, saves them as the personal profile, and replaces ~/.claude.json with a symlink.
claudini profile add --login workSaves the current credential, clears auth, launches claude for interactive OAuth login, then saves the new account as the work profile.
claudini use workSyncs shared fields, swaps the symlink and keychain credential. claudini use is a shortcut for claudini profile use.
To switch and immediately launch Claude Code in one step:
claudini work
# or equivalently:
claudini use work --launch
claudini use work -lclaudini profile listShows all profiles in a table, with the active one marked.
claudini profile currentPrints the active profile name and associated email address.
claudini profile rename work work-oldRenames a profile. If it's the active profile, the symlink and config are updated automatically.
claudini profile remove workDeletes a profile's stored data and its Keychain credential. Cannot remove the currently active profile.
claudini backup create before-upgradeSaves a snapshot of ~/.claude.json, the keychain credential, and the ~/.claude/ directory.
claudini backup restore before-upgradeReplaces current config, credentials, and ~/.claude/ directory from the named backup.
claudini backup delete before-upgradeDeletes a backup's stored data and its Keychain credential.
claudini backup listShows all available backup names.
All commands support --json for machine-readable output:
claudini --json profile list
claudini --json profile current
claudini --json backup listErrors are returned as {"error": "..."}.
Override the Claude home directory to test safely:
# Via CLI flag
claudini --claude-home /tmp/test-claude profile add test
# Via environment variable
export CLAUDINI_CLAUDE_HOME=/tmp/test-claude
claudini profile add testWhen overridden, claudini looks for <claude-home>/.claude.json instead of ~/.claude.json.
When switching profiles, claudini copies shared fields from the outgoing profile to the incoming one. This keeps things like project configs, tips history, and settings consistent across accounts.
Account-specific fields (preserved per-profile):
oauthAccount, userID, s1mAccessCache, groveConfigCache, passesEligibilityCache, hasShownOpus46Notice, cachedGrowthBookFeatures, cachedExtraUsageDisabledReason, penguinModeOrgEnabled, clientDataCache, claudeCodeFirstTokenDate, hasVisitedExtraUsage, hasVisitedPasses, passesLastSeenRemaining
Shared fields (synced on switch): everything else — projects, githubRepoPaths, tipsHistory, toolUsage, skillUsage, numStartups, installMethod, autoUpdates, hasCompletedOnboarding, etc.
- macOS (uses macOS Keychain via the
keyringcrate withapple-nativefeature) - Rust 1.70+
claudeCLI on PATH (foradd --loginanduse --launch)