Daring Designs uses cookies to enhance your experience, analyze site traffic, and improve our services. By clicking dismiss, you agree to our use of cookies.

Skip to main content
Daring Designs
Contact Search

How to Run Multiple Claude Code Accounts Side by Side

Stop logging in and out. Here's how to run your work and personal Claude Code accounts simultaneously with a single shell alias.

If you use Claude Code for both work and personal projects, you've probably hit this friction: you can only be logged into one account at a time. Switching means /logout, /login, re-authenticate — every single time.

There's a better way. With one line in your shell config, you can run both accounts simultaneously in separate terminal windows, each with their own sessions, memory, and settings.

The Problem

Claude Code stores everything — credentials, session history, project memory, MCP server configs — in a single ~/.claude directory. One directory means one account.

But Claude Code supports a CLAUDE_CONFIG_DIR environment variable that lets you point to a different config directory. That's the entire trick.

The Setup (2 Minutes)

Step 1: Create a Shell Alias

Add this to your ~/.zshrc (or ~/.bashrc for bash):

# Claude Code - personal account (separate config dir)
alias claude2='CLAUDE_CONFIG_DIR=~/.claude-personal claude'

Then reload your shell:

source ~/.zshrc

Step 2: Bootstrap Your Personal Config

You have two options here.

Option A: Start fresh

Just run claude2 — the config directory gets created automatically on first launch:

claude2

Option B: Copy your existing config

If you want your personal instance to start with all your existing sessions, settings, and project memory:

cp -R ~/.claude ~/.claude-personal

This copies everything: sessions, MCP server configs, project memory, settings. From this point on, the two directories evolve independently.

Step 3: Authenticate Your Personal Account

claude2

Once inside the session, run:

/login

Authenticate with your personal account. This overwrites the credentials in ~/.claude-personal only — your work account in ~/.claude stays untouched.

How It Works

The alias sets CLAUDE_CONFIG_DIR before launching Claude Code. This tells it to use ~/.claude-personal instead of the default ~/.claude for all config, credentials, and session data.

  • claude → uses ~/.claude → Work account

  • claude2 → uses ~/.claude-personal → Personal account

Each directory stores its own:

  • Authentication credentials — persisted in macOS Keychain, scoped to the config dir

  • Session history — resumable with --continue or --resume

  • Project memory — per-project context that carries across sessions

  • MCP server configs — account-level .mcp.json

  • Settings — settings.json and settings.local.json

Running Both Simultaneously

Open two terminal windows and run one in each:

# Terminal 1 — work
claude

# Terminal 2 — personal
claude2

They run completely independently. No conflicts, no shared state.

Resuming Named Sessions

You can name sessions in either account and resume them later:

# Start a named session on your personal account
claude2 -n "side-project-auth-refactor"

# Resume it later
claude2 --resume side-project-auth-refactor

Going Further: Three or More Accounts

The pattern scales. Need a client account too?

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

Each alias is a fully isolated Claude Code environment.

Tips

  • Auth persists across reboots. Both accounts stay logged in until you explicitly /logout.

  • Project-level config is separate from account config. Your CLAUDE.md files and per-project settings live in the repo, not in ~/.claude, so they're shared across both accounts automatically.

  • MCP servers are per-account. If you configure MCP servers in one account, you'll need to configure them in the other too (or copy the .mcp.json between config directories).

TL;DR

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

# Reload shell
source ~/.zshrc

# Optionally copy existing config
cp -R ~/.claude ~/.claude-personal

# Authenticate personal account
claude2
# then run /login inside the session

# Now both work independently
claude    # → work account
claude2   # → personal account

One alias. Two accounts. Zero friction.