← Blog AI Cost Management

How to Switch Claude Code Accounts on Mac

By FavTray ·

Written by the team behind FavTray, a Mac developer dashboard for the menu bar. We check every app we cover against its own site, docs or a hands-on test, and each post says which.

Short answer: type /login in Claude Code and sign in with the other account, but then you’re back to a browser sign-in every time you swap. To keep both accounts signed in, give each one its own CLAUDE_CONFIG_DIR with a shell alias, or save each login once in a switcher. FavTray does this from the menu bar, in one click.

Checked 29 September 2026 against the Claude Code docs and Claude Code 2.1.284 on macOS.

TL;DR

  • /logout + /login: built in, but a full browser sign-in on every switch.
  • CLAUDE_CONFIG_DIR aliases: built in and documented by Anthropic; each account gets its own directory, settings, history and login. You choose the account when you start claude.
  • claude setup-token: a one-year token for one shell or script; model requests only.
  • FavTray (Pro): save each login once, switch from the account chip on the AI Usage card. Open Claude Code sessions follow within about 30 seconds.
  • None of these give an account more usage. Each account keeps its own limits; use accounts you own and follow Anthropic’s terms.

Why switch Claude Code accounts at all?

The usual reason is two real accounts on one Mac: a personal Pro or Max plan and a company Team or Enterprise seat. Work code should run on the work account (its data and admin settings apply), and side projects on your own. Others keep a separate account per client.

Anthropic’s docs describe exactly this case, “work and personal accounts”, and point you at CLAUDE_CONFIG_DIR (Authentication). Note what switching isn’t: a way around limits. Anthropic says advertised Pro and Max limits “assume ordinary, individual usage” (Legal and compliance), and each account’s limits stay its own. If you keep running out on one plan, compare plans in Is Claude Max worth it? instead.

Where does Claude Code store your login on a Mac?

Two places matter:

WhatWhere (macOS)
TokensKeychain item “Claude Code-credentials”, account = your macOS user name. The value holds claudeAiOauth (access token, refresh token, expiry, plan) and, if you use them, MCP server logins
Who you areoauthAccount in ~/.claude.json (account ID, email, organisation)
Fallback~/.claude/.credentials.json (mode 0600), only when the Keychain rejects the write, such as a locked Keychain over SSH

With CLAUDE_CONFIG_DIR set, Claude Code keys the Keychain item to that directory, so each directory reads a different entry (Authentication › Credential management). In the 2.1.284 binary that shows up as a separate item named Claude Code-credentials- plus eight hex characters; the docs don’t name it, so treat the exact name as observed.

Claude Code refreshes its own access token shortly before it expires and replaces the refresh token when it does (observed in 2.1.284). That’s why copying the Keychain value around by hand goes stale quickly, and why a good switcher takes a fresh copy of the outgoing account every time it swaps.

How do you switch with /logout and /login?

  1. In Claude Code, type /logout. The docs say this also resets first-launch setup, so the next claude walks you through sign-in again.
  2. Start claude (or type /login) and sign in with the other account in the browser.
  3. Check with /status, which shows the account and organisation in use.

You can also type /login without logging out; it signs the current session in to the new account. Either way, going back means another browser sign-in, because only one login is saved for the default directory. Fine once a month; tedious several times a day.

How do you keep work and personal accounts with CLAUDE_CONFIG_DIR?

This is Anthropic’s documented way to stay signed in to more than one account. Add an alias per extra account to ~/.zshrc:

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

Open a new terminal, run claude-work and sign in once. From then on, claude uses your personal account and claude-work the work one, each with its own settings, session history and login.

Good to know:

  • You pick the account at launch. A running session doesn’t move to another directory; quit and start it with the other alias.
  • Everything is separate: settings, CLAUDE.md in the config directory, user-level MCP servers and your /resume history. That’s a feature for client isolation and a chore if you want one setup everywhere (symlinks help).
  • Editors and other tools only use the alias if they launch claude through your shell with that variable set.
  • Console logins without an API key are stored outside the config directory, so separate directories don’t keep two of those apart (per the docs).

How does claude setup-token help?

claude setup-token runs the same browser authorisation as /login and prints a one-year OAuth token. It saves nothing; you set it yourself:

export CLAUDE_CODE_OAUTH_TOKEN=your-token

It needs a Pro, Max, Team or Enterprise plan and “can only make model requests”: no Remote Control and no claude.ai connectors, though locally configured MCP servers still work (Generate a long-lived token). The variable outranks your /login credential, so it’s handy for pinning one shell or a CI job to a specific account. It isn’t a switcher, and a year-long token in a dotfile deserves the same care as a password.

What happens to open Claude Code sessions when you switch?

  • /login in a session switches that session.
  • Other open sessions on the default directory read the Keychain item again after a short cache. Claude Code 2.1.284 caches that read for about 30 seconds, so open sessions follow a new login within about 30 seconds. Anthropic doesn’t document this, so treat it as observed behaviour.
  • Sessions with their own CLAUDE_CONFIG_DIR, CLAUDE_CODE_OAUTH_TOKEN, ANTHROPIC_API_KEY or an apiKeyHelper never follow a switch of the default login; those credentials take precedence (Authentication precedence).

Run /status in a session if you’re unsure which account it’s on.

How do you switch Claude Code accounts in one click with FavTray?

FavTray’s AI usage tracker already shows each provider’s session and weekly limits in the menu bar. From 2.0.5, FavTray Pro adds saved accounts to it:

  1. Save the account you’re signed in with. Click the account chip on the Claude card in AI Usage and choose Save current login.
  2. Add the others once. Add account… opens Terminal and runs Claude Code’s own sign-in (claude auth login) in a temporary directory, so your current login isn’t touched. Sign in with the other account in the browser; FavTray saves it.
  3. Switch. Click the chip, pick an account. A toast confirms “Switched Claude to …”, and open Claude Code sessions follow within about 30 seconds.

What it does under the hood, so you can judge it:

  • Only the login changes. FavTray replaces the claudeAiOauth part of the Keychain item in place and updates oauthAccount in ~/.claude.json. MCP server logins in the same item are kept, so you don’t re-authorise them.
  • It waits for Claude Code. A switch takes Claude Code’s own refresh lock, so it can’t land in the middle of a token refresh, then reads the result back and rolls back if anything doesn’t match.
  • Saved copies stay on your Mac, in FavTray’s own Keychain items. Before a swap, FavTray saves a fresh copy of the outgoing account.
  • It never signs in or renews a login for you. Inactive accounts show their last-known limits, from when you last used them (“18% · as of 2 h ago”), so you can see which account likely has room. When you switch back, Claude Code renews the login itself on its next request. An account you haven’t used for a long time may need one more sign-in: FavTray hints at that after about three weeks, and marks an account Sign in again only when the login has actually expired or been revoked.
  • It suggests; it never switches on its own. When the active account passes about 90% of its session or weekly limit and another saved account has clearly more room, you get a notification; click it to switch.
  • It tells you when a switch won’t apply: FavTray warns if CLAUDE_CONFIG_DIR, an API key variable or an apiKeyHelper is set, because those terminals use a different credential.

Account switching is part of FavTray Pro, a one-time Lifetime licence (pricing). The usage bars themselves stay free. For Codex, see how to switch Codex CLI accounts; for how FavTray compares with claude-swap and CodexBar, see multiple Claude Code accounts: the best tools.

Which way should you use?

You want to…Use
Switch once in a while/login
Keep clients strictly separate, run two accounts side by sideCLAUDE_CONFIG_DIR aliases
Pin a script or CI job to one accountclaude setup-token
Move all your Claude Code work to another account from the menu bar, and see each account’s last-known limitsFavTray Pro, or claude-swap if you prefer the terminal

Whichever you choose, keep it to accounts you’re entitled to use and check where you stand with Claude Code usage limits on Mac.

Sources (checked 29 September 2026): Claude Code authentication, Claude Code legal and compliance. Keychain naming, refresh and the ~30-second pickup are observed in Claude Code 2.1.284 on macOS and may change.

Frequently Asked Questions

How do I switch accounts in Claude Code?

Type /login at the Claude Code prompt and sign in with the other account in the browser, or /logout first to sign out completely. The next session uses the new account. To keep two accounts signed in at once, give each one its own CLAUDE_CONFIG_DIR, or save each login once in a switcher such as FavTray or claude-swap.

Can I switch Claude Code accounts without logging out?

Yes. Anthropic's docs suggest a separate configuration directory per account: set CLAUDE_CONFIG_DIR, for example with an alias like claude-work, and each directory keeps its own login. Account switchers such as FavTray and claude-swap save each login once and swap the active one without a new browser sign-in.

Where does Claude Code store its login on a Mac?

In the macOS Keychain, in a generic password item named Claude Code-credentials. The signed-in account's identity (email, organisation) is saved as oauthAccount in ~/.claude.json. If the Keychain rejects the write, Claude Code falls back to ~/.claude/.credentials.json with mode 0600.

What happens to open Claude Code sessions when I switch accounts?

Running /login switches the session you type it in. Other open sessions read the Keychain again after a short cache; Claude Code 2.1.284 caches that read for about 30 seconds, so they pick up a new login within about 30 seconds (observed, not documented). Sessions started with a different CLAUDE_CONFIG_DIR or a CLAUDE_CODE_OAUTH_TOKEN keep their own account.

Does switching Claude Code accounts give me more usage?

No. Each account has its own plan and its own limits, and nothing is pooled or extended. Switching only changes which of your own accounts Claude Code signs in with, for example your personal Max plan and your company's Team seat. Follow Anthropic's terms for each account.

Can I use two Claude Code accounts at the same time?

Yes, in separate terminals with separate CLAUDE_CONFIG_DIR directories, or with a CLAUDE_CODE_OAUTH_TOKEN set only in one shell. A switcher that swaps the default login changes every terminal that uses the default directory, so it's for moving all your work to another account, not running two side by side.

Something new: My Dock Buddies