Skip to content

Instantly share code, notes, and snippets.

@najathi
Created April 14, 2026 19:25
Show Gist options
  • Select an option

  • Save najathi/bf3f6f08d18698c5f1d12ae962351a07 to your computer and use it in GitHub Desktop.

Select an option

Save najathi/bf3f6f08d18698c5f1d12ae962351a07 to your computer and use it in GitHub Desktop.
Managing Multiple Claude Accounts Simultaneously

Managing Multiple Claude Accounts Simultaneously

Run multiple Claude Code sessions at the same time using separate configuration directories.


Setup

1. Create Configuration Directories

mkdir -p ~/.claude-work
mkdir -p ~/.claude-personal

2. Authenticate Each Account

CLAUDE_CONFIG_DIR=~/.claude-work claude auth login
CLAUDE_CONFIG_DIR=~/.claude-personal claude auth login

3. Add Aliases to ~/.zshrc

alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
alias claude-personal='CLAUDE_CONFIG_DIR=~/.claude-personal claude'

4. Reload Shell

source ~/.zshrc

Usage

Command Config Directory Account
claude ~/.claude Default (original login)
claude-work ~/.claude-work Work account
claude-personal ~/.claude-personal Personal account

You can run all sessions simultaneously in separate terminal tabs.


Optional: Set Personal as Default

To make claude-personal the default when typing claude, add this alias to ~/.zshrc:

alias claude='CLAUDE_CONFIG_DIR=~/.claude-personal claude'

Then reload:

source ~/.zshrc

Adding More Accounts

# Create directory
mkdir -p ~/.claude-client

# Add alias to ~/.zshrc
alias claude-client='CLAUDE_CONFIG_DIR=~/.claude-client claude'

# Reload and authenticate
source ~/.zshrc
CLAUDE_CONFIG_DIR=~/.claude-client claude auth login

Removing an Account

# 1. Remove alias from ~/.zshrc
nano ~/.zshrc  # Delete the alias line

# 2. Reload shell
source ~/.zshrc

# 3. Delete config directory
rm -rf ~/.claude-client

Notes

  • Each config directory maintains its own independent session
  • No logout/login friction when switching between accounts
  • Works on macOS (zsh) and Linux (bash — use ~/.bashrc instead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment