Skip to main content

Claude Code multiple accounts: stay signed in to both, and keep the chat when you switch

Claude Code supports multiple accounts through one config directory per account. We ran the setup against a local mock API, including shared skills and picking up the same conversation after a switch.

Dark illustration of a terminal window with two commands, claude and claude-work, between two cards labeled ~/.claude Account A and ~/.claude-work Account B, with a third card reading skills and history shared
Share
On this page

If you have two Claude accounts, you know the routine. One hits its usage limit, you type /login, sign in to the other one in the browser, paste the code back into the terminal, and do it all again a few hours later. Only one account is signed in at a time, so you can't run both side by side either.

Anthropic documents a better way: give each account its own config directory and add one alias, so claude opens one account and claude-work opens the other, both signed in at once. The side effect is that your conversation history splits in two as well, and the second account can't see what you were just working on. This guide sets up the directories, then shares skills, settings and history back across them, with commands for macOS, Linux and Windows. We ran the key steps on a dev machine against a local mock API, without signing in to any real account.

For the occasional switch, just run /login

If you switch once or twice a week, you don't need any setup. Type /login inside Claude Code, sign in to the other account in the browser, paste the code back, and the current session carries on under the new account. Our Claude Code install guide walks through the first login with screenshots.

Skip /logout. According to the docs, logging out also resets first-run setup, so you'd be picking a theme again next time. Conversation history lives in the config directory on your machine and follows the directory, not the account, so after /login you're still in the same conversation, and claude -c in the same project folder picks it up later. A few things do behave differently after an account switch; they're covered in the history section below.

If what you really need is more usage rather than a second identity, moving up a plan is often less hassle than juggling accounts. Our Pro vs Max vs Ultra comparison lays out the limits.

Give each account its own config directory

Claude Code keeps your login, settings and history in one config directory, ~/.claude by default. Set the CLAUDE_CONFIG_DIR environment variable when you start it and it uses a different directory, with its own login. The Authentication page has a section on exactly this, using work and personal accounts as the example:

The Log in with multiple accounts section of the Claude Code Authentication docs, saying to give each account its own configuration directory, followed by an alias claude-work example
code.claude.com, December 4

You'll still see posts calling this variable undocumented and unsupported. That's out of date. The docs now also say where credentials go: with the variable set, .credentials.json lives in that directory, and on macOS the Keychain entry is tied to the directory, so each one reads its own.

macOS and Linux. Add this line to ~/.zshrc (or ~/.bashrc if you use Bash) and open a new terminal window:

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

Windows. PowerShell doesn't run profile scripts by default. Allow them for your user, then create and open your profile:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
if (!(Test-Path $PROFILE)) { New-Item -Type File -Force $PROFILE }
notepad $PROFILE

Add this function in Notepad, save, and reopen PowerShell:

function claude-work {
  $env:CLAUDE_CONFIG_DIR = "$HOME\.claude-work"
  try { claude @args } finally { Remove-Item Env:CLAUDE_CONFIG_DIR }
}

Now run claude-work. The new directory is empty, so Claude Code walks you through first-run setup and asks you to sign in. Sign in to the second account, then type /status to check which account you're on. Plain claude still opens the first one.

If both commands show the same account, look for ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN or CLAUDE_CODE_OAUTH_TOKEN in your shell config. All three take precedence over a /login sign-in, so whichever one is set wins in every directory. Remove it and open a new terminal.

After the first run on our dev machine, the new directory looked like this:

~/.claude-work
├── .claude.json
├── backups/
├── plugins/
├── projects/
└── sessions/

.claude.json holds that account's details, preferences and personal MCP servers, and projects/ holds its history. A third account is one more alias with another directory name.

Reuse your skills and settings in the second account

A new directory starts empty. Your skills, the permission rules in settings.json and your global CLAUDE.md all stay behind in ~/.claude. The docs page on the .claude directory says so directly: once CLAUDE_CONFIG_DIR is set, every path that normally sits under ~/.claude moves under that directory instead.

The simplest fix is to leave the first account's files where they are and put links to them in the second account's directory. Don't link the credentials; they're what keeps the two accounts apart.

Diagram: ~/.claude belongs to the first account and holds skills, settings.json, CLAUDE.md and projects history; ~/.claude-work belongs to the second account, with its own login and usage limits, and links those items back to ~/.claude

On macOS and Linux, run this. It only links what the first account has and the second one doesn't, and skips anything missing:

for f in skills agents commands settings.json CLAUDE.md; do
  [ -e ~/.claude/$f ] && [ ! -e ~/.claude-work/$f ] && ln -s ~/.claude/$f ~/.claude-work/$f
done

On Windows, use a directory junction for folders, which works without admin rights. Symlinks to single files need admin rights or Developer Mode, so it's easier to copy settings.json and CLAUDE.md and edit both copies when you change them. Skip the first line if you don't have a skills folder.

New-Item -ItemType Junction -Path "$HOME\.claude-work\skills" -Target "$HOME\.claude\skills"
Copy-Item "$HOME\.claude\settings.json", "$HOME\.claude\CLAUDE.md" "$HOME\.claude-work\" -ErrorAction SilentlyContinue

In our test, once skills was linked, the second account's requests to Claude included that skill.

Three things need separate handling:

  • Skills synced from claude.ai. Synced skills sit in skills/synced/, per account. Link the whole skills folder and the two accounts' syncs overwrite each other, so link your own skill folders one by one instead.
  • Personal MCP servers. They're stored in .claude.json, which also holds account details, so it can't be linked. Add the servers you need again with claude-work mcp add --scope user.
  • Project settings. The .claude/ folder and CLAUDE.md inside a project travel with the project, so both accounts already see them.

Link your history to continue the same conversation

With separate directories, the second account can't see the first account's conversations. We checked: with its own directory, claude -c on the second account sent only the new message, with nothing from before. Linking projects/ fixes that.

Quit every running Claude Code session first, then run the commands below. The second account's existing history is renamed to projects.bak until you're sure you don't need it.

macOS and Linux:

mv ~/.claude-work/projects ~/.claude-work/projects.bak 2>/dev/null
ln -s ~/.claude/projects ~/.claude-work/projects

Windows:

Rename-Item "$HOME\.claude-work\projects" projects.bak -ErrorAction SilentlyContinue
New-Item -ItemType Junction -Path "$HOME\.claude-work\projects" -Target "$HOME\.claude\projects"

Now when the first account hits its limit, exit, stay in the same project folder and run claude-work -c. The second account continues the most recent conversation; claude-work --resume lets you pick another. On our dev machine, after linking, the second account's request carried the first account's prompt, Claude's reply and then the new message, in order. Claude Code's auto memory lives in projects/ too, so both accounts now share it.

A few things work differently after a switch, whether you link directories or use /login:

  • Claude's earlier thinking may not come along. Anthropic's docs say thinking from models such as Fable 5.2, Sonnet 5.5 and Haiku 5.5 only works in the account that produced it; under another account the API drops it without an error. Opus 5.5 thinking stays readable. What's lost is the unspoken reasoning, not the conversation or the changes, which Claude still sees in full.
  • The first message after a switch costs more. Prompt caches aren't shared across organizations, so the new account reads the whole conversation from scratch. The longer the conversation, the more of your usage that one message takes.
  • /rewind can't undo the other account's edits. File snapshots live in each directory's file-history/, which isn't linked. Use git to roll back changes made before the switch.
  • Don't open the same conversation in both accounts at once. The records Claude Code uses to notice a session open twice sit in each directory's sessions/, so the two accounts can't see each other and you won't get a warning. Exit one before opening the other.

Check whether a switcher tool touches your login token

Search for a Claude Code account switcher and you'll find plenty of small tools. They come in two kinds:

  • One directory per account. The tool creates config directories and switches by changing CLAUDE_CONFIG_DIR. Same idea as the alias, with a menu on top.
  • Token swapping. The tool keeps a single ~/.claude and, on every switch, saves the current .credentials.json somewhere and copies the other account's back in. Your tokens now sit in the tool's own folder as well.

A login token is as good as your account: whoever has it can use your plan without a password. The tell is easy to spot. A tool that only changes CLAUDE_CONFIG_DIR has no reason to read or write .credentials.json; one that does, or that triggers a Keychain prompt on a Mac when you switch, is the second kind. For two or three accounts, the one-line alias is all you need.

Keep your accounts off a rotating VPN

All your accounts on one computer share one public IP address, one operating system and one time zone. Claude Code generates a separate device ID for each config directory, but the IP stays the same, and if your VPN changes servers, every account moves with it.

A work account and a personal account on a stable home or office connection is an ordinary setup and nothing to worry about. Anthropic doesn't publish how it relates accounts to each other, and we won't guess. What we can point to is our write-up on what to do if your Claude account is banned: one of the situations most likely to draw attention is signing in from devices and networks that keep changing. Several accounts hopping together through a VPN's auto-select pool each hit that one.

If you use a VPN or proxy, pin claude.ai and anthropic.com to one fixed server instead of letting it pick the fastest. Our Clash Verge Rev proxy chain guide shows how to give Claude a dedicated static IP. Whether a mismatched time zone matters, and what Claude can actually see, is covered in our time zone test.

With more accounts, give each one a server with Claude Capsule

AIMacMini's Claude Capsule isn't available to download yet, but here's how it handles the problems above. It's a desktop app that signs in and runs the official Claude Code on your own server while your projects stay on your computer. You bring the servers, one per account, and a Claude Code-only server doesn't need much; our server sizing test has the numbers. Each account then gets its server's IP address, time zone and device. You see every account's remaining usage on one screen instead of running /usage in each, and when one runs out, one click moves you to the account with the most room, with the conversation carried over from your computer and no projects/ folder to link. Anthropic manages the accounts, so no tool can promise an account stays in good standing; Capsule keeps each account's environment fixed.

A banner above the conversation says this Singapore account has reached its usage limit and resets in 40 minutes, with a Continue on Tokyo button
Claude Capsule beta, sample data

For the thinking behind it, read We Built Claude a Capsule. For how the 5-hour window and weekly limits are counted, see how Claude usage limits work.

Share

The people at AIMacMini who work with Mac mini and Claude every day.

Start here

Ordered separately and delivered in order after payment; Claude Capsule is activated as soon as you pay.

Get a Claude subscription

Opened with a US physical card, one account per customer.

From $69.90/mo

Subscribe to Claude Capsule

Claude on your server to avoid risk flags; development stays on your computer.

From $19/month

Learn more

Not sure which to pick? Talk to support