How to Use Multiple Accounts in Claude Code
Run Claude Code as your work account in one terminal and your personal account in another, with CLAUDE_CONFIG_DIR, shell aliases or Clawdrobe.

Claude Code keeps one login per configuration folder. Give each account its own folder with the CLAUDE_CONFIG_DIR environment variable, and each terminal session runs as whichever account that folder is signed in to. A work session and a personal one can run side by side. You don't need to log out and back in between them. Below are three setups, and the mistakes that put a session on the wrong account.
How Claude Code decides which account to use#
By default Claude Code keeps its settings, session history and login under ~/.claude. On a Mac the login itself goes into the macOS Keychain. Anthropic's authentication docs describe the switch: set CLAUDE_CONFIG_DIR to another folder and Claude Code uses that folder instead, with its own settings, history and claude.ai login. The Keychain entry is tied to the folder too, so two folders really are two separate logins.
Two things can override the folder:
ANTHROPIC_API_KEY. If it's set in your shell, Claude Code bills that API key instead of your Pro or Max subscription, even when you're logged in, once you've approved the key.unset ANTHROPIC_API_KEYtakes you back to the subscription.- Console logins. Anthropic notes that a Claude Console sign-in without an API key is stored outside the configuration folder, so separate folders don't keep two of those apart. Everything below is about claude.ai accounts (Pro, Max, Team, Enterprise).
When you're unsure, type /status inside Claude Code. It shows which login the session is using.
Option 1: log out and log back in#
The built-in way. Inside Claude Code, type /logout, then start claude again and log in with the other account in the browser window that opens.
That's fine if you switch once in a while. If you switch daily it gets old fast: you're one account at a time, and it's easy to forget which one you left signed in.
Option 2: one config folder per account#
This is the approach Anthropic documents.
Pick a folder per extra account, for example
~/.claude-work. Your existing~/.claudestays your main account.Start Claude Code with that folder:
CLAUDE_CONFIG_DIR=~/.claude-work claudeThe first time, Claude Code opens a browser window to log in. Sign in with the work account. From then on, that folder stays signed in to it.
Plain
claudestill uses~/.claudeand your main account.
To make it one word, add an alias to ~/.zshrc (the first line is the docs' own example):
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
alias claude-client='CLAUDE_CONFIG_DIR=~/.claude-client claude'
Open a new terminal tab (or run source ~/.zshrc) and you can type claude-work in one tab and claude in the next.
What doesn't come along#
A new config folder starts empty. Anything you set up in ~/.claude lives only there:
- your user settings (
settings.json) and permission rules, - your personal
CLAUDE.mdwith your global instructions, - custom slash commands, subagents and plugins,
- MCP servers you added for yourself (they live in
.claude.jsoninside the folder), - your session history, so
--resumeonly lists sessions from the same account.
Project files are different: a repo's own CLAUDE.md and .claude/ folder go wherever the repo goes, so every account sees them. For the personal setup, you can copy what you need into each folder, or symlink files such as CLAUDE.md if you want one copy to edit. Don't copy credential files between folders; let each folder log in on its own.
Option 3: Clawdrobe, if you also use Claude Desktop#
If your accounts live in Claude Desktop too, the folder-per-account setup is already there. Clawdrobe gives each account its own copy of Claude Desktop with its own sign-in, and its own Claude Code configuration folder alongside it.
- Download Clawdrobe, then add your accounts (or import the one you're already signed in to).
- Select an account in the sidebar.
- Under Tools, click Open Claude Code in Terminal.
A Terminal window opens, prints the account's name and starts claude with CLAUDE_CONFIG_DIR already pointing at that account's folder. If Claude Code asks you to log in, use that account; the folder remembers it. Your main account just runs plain claude, the same as before.
Clawdrobe also handles the "what doesn't come along" problem. Each extra account's folder links back to your main ~/.claude for your personal setup (CLAUDE.md, settings.json, slash commands, agents, skills, hooks and plugins) and gets a copy of your MCP servers. It also shares session history, so --resume lists the same sessions whichever account you're in. Each account still logs in on its own.
That shared history means every account sees every session. If two clients must stay fully apart, give those accounts their own folders as in option 2 instead.
Each account also has its own 5-hour and weekly limits, and Anthropic counts Claude and Claude Code against the same limits on Pro and Max (as of October 2026). Clawdrobe shows both meters for every account and can alert you at 70, 80 or 90%. Clawdrobe reads the meters from what Claude Desktop records, and because the limits are shared, your terminal work shows there once that account's Claude Desktop updates them. Before a long session, check which account has room. ⌘ 0 opens the account with the most room left.
Clawdrobe is free for two accounts with every feature; Clawdrobe Pro is a one-time $10 for more. It's a Mac app for macOS 26 or later and isn't affiliated with Anthropic.
Pitfalls that send you to the wrong account#
- An API key in your environment. If
ANTHROPIC_API_KEYis exported in~/.zshrc, every session uses it no matter which folder you pick. Check/statusif a session bills the wrong way. - A
~that never expands. In quotes ("~/.claude-work") or in an editor's environment settings,~stays a literal character. Anthropic asks for absolute paths, such as/Users/you/.claude-work. - Setting it per project. Anthropic's docs say project and local settings can't set
CLAUDE_CONFIG_DIR, so putting it in a repo's.claude/settings.jsondoes nothing. Set it in the shell or an alias. /logoutonly touches one folder. It logs out the folder the session runs in. Log out in aclaude-worktab and your work folder logs out; your main account doesn't.- SSH sessions. If the Keychain is locked, as it can be over SSH, Claude Code saves the login to
.credentials.jsoninside the config folder instead (readable only by you). Keep that folder private and out of dotfile repos.
Which one should you use?#
- Switch a few times a month?
/logoutand log in again. - Live in the terminal and never open Claude Desktop? One config folder per account plus an alias. It's free and needs no extra software.
- Use Claude Desktop and Claude Code with the same accounts, or want one setup across all of them? Clawdrobe runs each account's Claude Desktop and Claude Code from one window and shows how much of each limit is left.
For the desktop side of the same question, see how to use multiple Claude accounts on one Mac.
More from the blog
Four ways to use a work and a personal Claude account on the same Mac, what each one costs you in time, and how to keep both open side by side.
Every Claude account, side by side
Clawdrobe is free for two accounts. macOS 26 or later · Apple silicon and Intel.
