Beta
Discord Download

How to use multiple Claude accounts in Claude Code

AutoRouter7 min read

Use AutoRouter, the Mac app for Codex and Claude Code: connect more than one plan, and when one account reaches its limit, AutoRouter moves on to the account with the most room left before it spends any credit, so Claude Code keeps going without a logout. AutoRouter Free connects two subscriptions and Pro connects any number, across Claude, ChatGPT, Grok and Gemini plans. Natively, Claude Code holds one login per configuration directory. Run /logout and then /login to switch accounts, or give each account its own directory with the CLAUDE_CONFIG_DIR environment variable to stay signed in to both, as Anthropic's authentication docs show.

AutoRouter wrote this post. The native methods below cost nothing extra and work on macOS, Linux and Windows. Every command is from Anthropic's Claude Code docs as read on November 17, 2026; check the linked page before you paste.

How do you log out of Claude Code and switch accounts?

Type /logout at the Claude Code prompt, then sign in to the other account with /login. Anthropic's docs say logging out also resets your first-launch setup state, so the next claude walks you through login and setup again (Claude Code authentication). This works for one account at a time: the old login is gone until you sign back in.

  1. In Claude Code, type /logout.
  2. Run claude again, or type /login, and choose your account type: a claude.ai subscription or the Anthropic Console.
  3. Sign in to the other account in the browser window that opens. If it doesn't open, press c to copy the login URL.
  4. When the terminal shows Login successful, press Enter, then run /status to confirm the account.

The same steps work from your shell, outside a session (CLI reference). claude auth login takes --email to pre-fill an address and --console to sign in to the Console for API billing, and claude auth status prints the active login as JSON, or as text with --text:

claude auth logout
claude auth login --email you@work.example
claude auth status --text

If /login seems to have no effect, check for an API key. When ANTHROPIC_API_KEY is set and approved, Claude Code uses it ahead of your /login subscription. Run unset ANTHROPIC_API_KEY to fall back to the subscription, and /status to see which credential is active (Claude Code authentication).

How do you run two Claude accounts side by side?

Give each account its own configuration directory with CLAUDE_CONFIG_DIR. Each directory keeps its own settings, session history and claude.ai login or API key, so you stay signed in to a work and a personal account at once and pick one when you start claude (Claude Code authentication). The default directory is ~/.claude.

  1. Add the alias below to ~/.zshrc (or ~/.bashrc).
  2. Open a new terminal and run claude-work. Claude Code walks you through login and setup for the new directory; sign in with the second account.
  3. Run claude as before for your first account, which keeps using ~/.claude.
  4. Run /status in each session to confirm which account it uses.
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'

Three details from Anthropic's docs. Settings, session history and plugins all live under the directory, so the second account starts without your usual settings until you add them (environment variables). Project and local settings files can't set CLAUDE_CONFIG_DIR; set it in your shell, user settings or managed settings, with an absolute path in a settings file. And separate directories don't keep two Console sign-ins made without an API key apart, because Claude Code stores that kind of sign-in outside the directory. Claude Code environment variables covers where each variable can be set.

Where does Claude Code store your login?

On macOS, Claude Code stores your login in the encrypted macOS Keychain (credential management). If the Keychain rejects the write, for example when it's locked in an SSH session, Claude Code falls back to ~/.claude/.credentials.json with file mode 0600, which is where it keeps logins on Linux. On Windows the file is %USERPROFILE%\.claude\.credentials.json.

This is why CLAUDE_CONFIG_DIR works for multiple accounts. With the variable set, Claude Code keeps .credentials.json under that directory and keys the macOS Keychain entry to the directory too, so a session with a different directory reads a different entry. claude auth status names the directory in use in its configDirectory field, on Claude Code v2.1.268 or later (CLI reference).

How do you use multiple accounts with AutoRouter?

Connect each plan in AutoRouter once, and it moves Claude Code on to the account with the most room left when one reaches its limit, before it spends any credit. You don't log out or keep separate directories. AutoRouter Free costs $0 a month and connects two subscriptions; Pro, at $50 a month with $20 of included usage, connects any number. The plans can be Claude, ChatGPT, Grok or Gemini plans, and any of them can run in Claude Code, so a ChatGPT plan works there beside your Claude accounts.

  1. Download AutoRouter for macOS from autorouter.com.
  2. Open it, sign in or create a free account, and sign in to each plan you want to use.
  3. Allow Accessibility, and click Enable for Claude Code.
  4. Start a new Claude Code session and choose AutoRouter with /model.

Enabling adds AutoRouter to Claude Code's settings.json after saving a copy of the file, and disabling Claude Code in AutoRouter's settings switches it back. With AutoRouter selected, it also works out how hard each task is and sends it to the model that fits, so quick work doesn't burn a plan. When a ChatGPT or Claude plan hits its limit, Pro keeps those requests going from its monthly usage, at the provider's price plus 10%, until the plan resets; new accounts get Pro free for their first month, or until $20 of usage is spent, whichever comes first. How Claude Code usage limits work explains the five-hour and weekly limits each account runs into.

The trade-offs are real. AutoRouter runs on macOS 14 or later and is in beta, and Claude Code needs Node 22.18 or later to use it. Free stops at two subscriptions. Requests pass through AutoRouter's servers on their way to each provider; AutoRouter doesn't store transcripts, but keeps the message that opens each request, up to 4,000 characters, to review routing (AutoRouter privacy).

Which multiple-account method should you use?

Use /logout and /login for an occasional switch, CLAUDE_CONFIG_DIR to keep a work and a personal account apart, and AutoRouter to keep Claude Code going across accounts when one reaches its limit. The community tool claude-swap sits in between: it saves each account's login and swaps the active one from the command line, by hand or automatically as an account nears its limit, with a usage dashboard. As of November 17, 2026:

MethodSigned in at onceHow you switchWhen an account hits its limitPlatforms
/logout and /loginOne accountLog out, log inYou switch by handmacOS, Linux, Windows
CLAUDE_CONFIG_DIROne per directoryStart claude with the other directoryYou start the other accountmacOS, Linux, Windows
claude-swap (community)Any number savedcswap switch, or cswap autoIt can switch on its own; on macOS, Claude Code may take about 30 seconds to noticemacOS, Linux, Windows
AutoRouterTwo on Free, any number on ProNothing to switchMoves on to the account with the most room left, before any creditmacOS 14 or later

claude-swap installs with uv tool install claude-swap, and cswap list shows each account's plan, five-hour and seven-day usage and reset times, per its README. For more on stretching one plan, see How to cut Claude Code and Codex costs.

Questions

How do I log out of Claude Code?

Type /logout at the Claude Code prompt, or run claude auth logout in your shell. Logging out also resets first-launch setup, so the next claude asks you to log in again (Claude Code authentication).

How do I see which account Claude Code is using?

Run /status in a session, which shows the account, or claude auth status --text in your shell. When a login and an API key are both configured, /status marks the one that isn't in use.

How do I check usage on each account?

Run /usage in a session started with that account; on a Pro, Max, Ultra, Team or Enterprise plan it shows the plan's usage limits (commands). How to check your Claude Code usage covers /usage and the claude.ai settings page in detail.

Why does Claude Code use my API key instead of my new login?

An approved ANTHROPIC_API_KEY ranks above a /login subscription in Claude Code's credential order. Run unset ANTHROPIC_API_KEY, or switch off "Use custom API key" in /config, and the subscription login takes over (Claude Code authentication).

Sources