Run multiple Claude Code accounts simultaneously without re-authenticating by isolating each account into its own configuration directory using the CLAUDE_CONFIG_DIR environment variable.
This works on:
- macOS (zsh)
- Linux (bash/zsh)
- Windows (PowerShell)
- WSL2 (recommended for Windows devs)
Claude Code reads credentials, usage state, and settings from a config directory. By setting CLAUDE_CONFIG_DIR per command, each Claude instance operates independently — no token overwrites, no forced re-login.
mkdir -p ~/.claude-profile1
mkdir -p ~/.claude-profile2
# optional
mkdir -p ~/.claude-profile3Edit your shell config:
nano ~/.zshrc # or ~/.bashrcAdd the following:
# Claude profiles
alias claude-profile1='CLAUDE_CONFIG_DIR=$HOME/.claude-profile1 command claude'
alias claude-profile2='CLAUDE_CONFIG_DIR=$HOME/.claude-profile2 command claude'
alias claude-profile3='CLAUDE_CONFIG_DIR=$HOME/.claude-profile3 command claude'
# Disable default command to avoid mistakes
alias claude="echo 'Use claude-profile1, claude-profile2, or claude-profile3'"Why
command claude? It bypasses shell aliases and ensures the real Claude binary is executed.
Reload your shell:
source ~/.zshrcclaude-profile1
# log in with Account 1
claude-profile2
# log in with Account 2Each account’s credentials are saved independently.
Open multiple terminal tabs/windows and run:
claude-profile1
claude-profile2Each instance has:
- Separate auth
- Separate rate limits
- Separate usage tracking
mkdir $env:USERPROFILE\.claude-account1
mkdir $env:USERPROFILE\.claude-account2Open your profile:
notepad $PROFILEAdd:
function claude-account1 {
$env:CLAUDE_CONFIG_DIR="$env:USERPROFILE\.claude-account1"
claude
}
function claude-account2 {
$env:CLAUDE_CONFIG_DIR="$env:USERPROFILE\.claude-account2"
claude
}Reload:
. $PROFILERun each function in a separate terminal window:
claude-account1
claude-account2WSL2 behaves exactly like Linux and is the cleanest way to manage multiple Claude accounts on Windows.
Follow the Linux/macOS instructions, using:
~/.claude-profile1
~/.claude-profile2Open multiple WSL tabs and run each profile independently.
-
The VS Code Claude extension inherits environment variables from the terminal that launches it
-
To use a specific profile:
- Launch VS Code from a terminal where
CLAUDE_CONFIG_DIRis already set - OR configure a VS Code task/launch config with
CLAUDE_CONFIG_DIR
- Launch VS Code from a terminal where
Example:
CLAUDE_CONFIG_DIR=~/.claude-profile1 code .Each VS Code window can then target a different Claude account.
Check active config dir:
echo $CLAUDE_CONFIG_DIRIf Claude asks you to re-authenticate:
- Ensure you are not accidentally calling plain
claude - Confirm the alias/function is active
- Requires separate Anthropic accounts (different emails)
- Ensure this usage complies with Anthropic’s terms
- Update Claude Code if needed:
npm install -g @anthropic-ai/claude-codeThis approach gives you:
- Multiple Claude Code accounts
- Zero credential collisions
- Parallel usage with different limits
- Works across macOS, Linux, Windows, and WSL2
Perfect for:
- Personal vs work accounts
- Multiple clients
- Heavy parallel usage
Tip: If you use this daily, keep the default claude command disabled — it prevents accidental logouts.