Run two Claude Code accounts simultaneously on your computer without re-authenticating by using separate configuration directories.
- Requires separate Anthropic accounts (different emails).
- Update Claude Code:
npm install -g @anthropic-ai/claude-code. - If re-authentication occurs, verify
CLAUDE_CONFIG_DIRwithecho $CLAUDE_CONFIG_DIR.
-
Create Separate Config Directories
mkdir ~/.claude-personal mkdir ~/.claude-work
-
Add Aliases to Shell Config
-
Open
~/.zshrc(or~/.bashrcfor Bash) in an editor:nano ~/.zshrc -
Add:
alias claude-personal="CLAUDE_CONFIG_DIR=~/.claude-personal claude" alias claude-work="CLAUDE_CONFIG_DIR=~/.claude-work claude"
-
Save and reload:
source ~/.zshrc
-
-
Authenticate Each Account
- For account 1:
After authentication, the credentials are saves to
claude-personal
~/.claude-personal. - For account 2:
After authentication, the credentials are saves to
claude-work
~/.claude-work.
- For account 1:
-
Switch or Run Simultaneously
- Run
claude-personalorclaude-workin separate terminal tabs (Cmd + T). - Each uses its own config and usage limits.
- Run