Skip to content
Updated September 29, 2026

How to use multiple Claude Code accounts

A Max plan you pay for yourself and a Team seat from work. Maybe a client’s account on top. Out of the box, Claude Code signs in one account per machine, and switching means /logout, a browser tab and a fresh setup. You don’t have to work that way.

Short answer

Give each account its own configuration directory and start Claude Code with CLAUDE_CONFIG_DIR pointing at it, usually through an alias like claude-work. Each directory keeps its own settings, session history and login, so every account stays signed in and two can run at once. Keep plain claude for your default account, and don’t export an API key or OAuth token in your shell profile, because either one overrides every directory.

Give each account its own CLAUDE_CONFIG_DIR

This is the method Anthropic documents. The Claude Code authentication guide says that to stay signed in to several accounts at once, you give each one its own configuration directory and set CLAUDE_CONFIG_DIR to it when you start claude. Each directory has its own settings, session history, and claude.ai login or API key.

# ~/.zshrc or ~/.bashrc
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
alias claude-client='CLAUDE_CONFIG_DIR=~/.claude-client claude'

Open a new terminal and run claude-work. Claude Code sees an empty directory and walks you through login and first-run setup, exactly as it did the first time you installed it. Sign in with the work account there. Plain claude still opens your original account, untouched.

After that, picking an account means picking a command. Two terminals running two aliases are two independent Claude Code processes on two logins, and neither knows the other exists.

Inside each directory you’ll find what ~/.claude normally holds: settings.json, a projects/ tree with that account’s session transcripts, plugins, and caches. It also holds .claude.json, the file that plain claude keeps at ~/.claude.json in your home folder. That file holds your MCP servers, per-project trust and the signed-in account profile, so those are per account too.

Where the login is actually stored

On a Mac the login isn’t a file in that directory. Claude Code writes it to the macOS Keychain and, per Anthropic’s credential documentation, keys the Keychain entry to the configuration directory, so a session with a different CLAUDE_CONFIG_DIR reads a different entry.

You can see this for yourself. The command below lists entry names only. It doesn’t print any secret and doesn’t trigger a Keychain prompt.

security dump-keychain | grep 'Claude Code-credentials'

# "svce"<blob>="Claude Code-credentials"            ← plain claude
# "svce"<blob>="Claude Code-credentials-5e0f9b21"   ← one CLAUDE_CONFIG_DIR

The default account uses the bare name. Every other directory gets a suffix. On the Mac we checked, the suffix is the first eight hex digits of the SHA-256 of the directory’s absolute path. Anthropic doesn’t document the naming, so treat that as an observation, not a contract. The practical consequence is the documented part: the directory decides which login you get.

PlatformWhere the login goes
macOSThe login Keychain, in an entry tied to the directory
macOS, Keychain locked.credentials.json inside that directory, mode 0600. This happens over SSH, for example.
Linux.credentials.json inside that directory, mode 0600
Windows.credentials.json inside that directory, protected by your profile’s access controls

One documented exception: separate directories don’t keep two Claude Console sign-ins apart if you signed in without creating an API key, because Claude Code stores that kind of sign-in outside the configuration directory. Subscription logins and Console API keys follow the directory as described above.

Don’t point CLAUDE_CONFIG_DIR at ~/.claude

It looks harmless to make the aliases symmetrical, with claude-personal set to CLAUDE_CONFIG_DIR=~/.claude and claude-work set to ~/.claude-work. It isn’t the same as leaving the variable unset.

We checked this on Claude Code 2.1.280 on macOS. With the variable set explicitly to ~/.claude, Claude Code used a Keychain entry with a hashed suffix instead of the bare default entry. It also read ~/.claude/.claude.json instead of ~/.claude.json. The result is an account that asks you to sign in again and doesn’t see the MCP servers you’d already configured. Anthropic’s documentation doesn’t address this case either way.

The fix is to leave the default account alone. Plain claude is account one, and only the extra accounts get an alias. Since the entry name comes from the path, write each alias’s path the same way every time, too.

Credentials that outrank every directory

This is the failure that makes people think the method doesn’t work. Claude Code picks one credential in a fixed order, and the login you created with /login sits near the bottom of it. From Anthropic’s authentication precedence list, these all win over it:

  • ANTHROPIC_AUTH_TOKEN, sent as a bearer token, usually for a gateway or proxy.
  • ANTHROPIC_API_KEY. Once you approve it, you’re billed through the Console key instead of your subscription, even while signed in.
  • An apiKeyHelper script configured in settings.
  • CLAUDE_CODE_OAUTH_TOKEN, the one-year token from claude setup-token. Claude Code reads it again in every new session until you remove it from your shell profile.
  • Cloud-provider credentials, and some Anthropic profile credentials, rank above /login as well.

Export any of these in ~/.zshrc and every alias quietly runs on that one credential, whatever directory it points at. Run /status inside each account after setting it up. It shows which login method is active, and when both a login and an API key are configured it marks the one that isn’t in use.

Sharing your setup without sharing the login

A new directory starts empty. Your personal CLAUDE.md, custom agents, commands, skills and permission rules don’t follow you into claude-work. That’s the isolation working, and it’s also the first annoyance people hit.

Share the files you write by hand with symlinks, and copy settings.json on purpose instead of linking it. Claude Code writes to that file itself, and you may want different permissions or models per account anyway.

# share hand-written config from the default account
for item in CLAUDE.md agents commands skills; do
  [ -e ~/.claude/"$item" ] && ln -s ~/.claude/"$item" ~/.claude-work/"$item"
done
cp ~/.claude/settings.json ~/.claude-work/settings.json

Never link .claude.json, .credentials.json or the whole directory. Those carry the account identity, and linking them puts two accounts back on one login, which is the problem you started with.

What the directory method leaves unsolved

The setup above is enough for most people who switch a few times a week. It’s worth knowing what it still doesn’t give you, because no shell configuration produces these:

Still missingWhy
One history across accountsEach directory has its own projects/ tree. claude --resume under one alias can’t see sessions from the other.
Knowing which account has room/usage reports one account at a time, and only inside that account. You usually find out an account is out when a turn fails.
Carrying a task across at the limitA session belongs to the account that wrote it. Continuing on another account means rebuilding the context by hand.
A pooled allowanceEach account is metered on its own plan, and on Pro and Max it’s shared with that account’s Claude chats. Nothing merges two accounts, whatever a tool claims.

The last row will never change. The first three are interface problems, so a layer above Claude Code can help with them. If one account hitting its limit is the thing you’re solving right now, the usage-limit guide covers every option Anthropic gives you before a second account comes into it.

Doing it in Crowsnest

Crowsnest is ours, so weigh this section accordingly. It uses exactly the directory method above and adds the parts shell configuration can’t reach.

Adding an account creates its directory at ~/.claude/crowsnest-accounts/<id>/ and gives you the command to run in your own terminal, CLAUDE_CONFIG_DIR=<dir> claude, where you sign in with /login. Crowsnest doesn’t perform the sign-in, and it never reads the credential afterwards. To show an account as signed in, it asks the Keychain whether that directory’s entry exists, without requesting the secret, so no token enters the app and no Keychain prompt appears.

One history, labelled by account

The conversation gallery reads every registered account’s projects/ tree, so sessions from all your Claude Code accounts are searchable in one place, each marked with the account that wrote it.

Limits read per account

The five-hour and seven-day windows each turn reports are recorded against the account that ran it, so you can see which one has room before you start.

A warning at 90%

When a Claude Code account crosses 90% of a window and another account is signed in, Crowsnest says so. It offers the continuation action and never fires it for you.

An attributed fork, not a resume

Continuing on another account starts a new session under that account’s directory, with a quoted briefing capped at 8,000 characters of conversation. The original session is left exactly as it was.

Automatic behaviour is off until you turn it on. Even then, continuing after a quota failure skips the confirmation only when exactly one other account is signed in. With two or more it draws a chooser and waits. Quota is never pooled. Each account keeps its own meter, shown separately.

Several accounts per provider is a Pro feature. Standard drives one Claude Code or Codex account at a time and still browses and searches history. If you run one Claude account, none of this applies to you, and plain claude is the whole answer.

Questions behind the search

How do I use multiple Claude Code accounts?

Give each account its own configuration directory and start Claude Code with CLAUDE_CONFIG_DIR pointing at it, usually through a shell alias such as alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'. The first run in a new directory walks you through login. Each directory keeps its own settings, session history and login, so both accounts stay signed in.

Can I switch Claude Code accounts without logging out?

Yes. Instead of running /logout and /login in one directory, keep each account in its own CLAUDE_CONFIG_DIR and pick the account by which alias you start. Nothing is logged out, and two terminals can run two accounts at the same time.

Why does Claude Code ask me to log in again after I set CLAUDE_CONFIG_DIR?

On macOS, Claude Code keys its Keychain entry to the configuration directory, so a different directory reads a different entry and starts signed out. That includes setting CLAUDE_CONFIG_DIR to ~/.claude explicitly: in our check on Claude Code 2.1.280 it created a separate Keychain entry from the one plain claude uses. Leave the default account as plain claude and point each extra account at its own directory.

Why is my second Claude Code alias still using the wrong account?

Something in your environment outranks the directory’s login. ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, an apiKeyHelper script and CLAUDE_CODE_OAUTH_TOKEN all take precedence over the subscription login stored by /login. If one is exported in your shell profile, every alias uses it. Run /status to see which credential is active.

Do multiple Claude Code accounts combine my usage limits?

No. Each account is metered on its own plan, and on Pro and Max that allowance is shared with the same account’s Claude chats. Separate accounts let you keep working when one hits its limit and keep employer or client work on the right subscription. They do not create a larger shared allowance.

Is it against Anthropic’s terms to have more than one Claude account?

Holding separate accounts you are entitled to, such as a personal subscription and one your employer provides, is ordinary practice. Creating extra accounts to get around the usage limit of a single subscription is a different thing, and it is the sort of use providers restrict. Read Anthropic’s current terms for your plan before you rely on any arrangement described here.

Claude Code behaviour above was checked against Anthropic’s authentication documentation on September 29, 2026, and on Claude Code 2.1.280 on macOS where the documentation is silent; those observations are marked as ours. Crowsnest behaviour was checked against the released 0.3.1 application source on the same date. Claude Code changes quickly; follow Anthropic’s documentation for current behaviour.