# How to use multiple Claude accounts in Claude Code

> Use Auto, the Mac app for all your coding agents: connect more than one plan, and when one account reaches its limit, Auto moves on to the account with the most room left before it spends any credit, with no logging out. Natively, Claude Code holds one login per configuration directory: switch with `/logout` and `/login`, or keep accounts side by side by giving each its own directory with the `CLAUDE_CONFIG_DIR` environment variable.

Author: Tyler J. Cagle (https://x.com/tjcages)
Published: 2026-11-17T08:41:00.000Z
Reading time: 7 min
Canonical: https://auto.sh/blog/claude-code-multiple-accounts
Part of: How to cut Claude Code and Codex costs (https://auto.sh/blog/cut-claude-code-and-codex-costs.md)
Publisher: Auto (https://auto.sh)

![Auto moves Claude Code to the plan with room. How do you use your accounts? You want One at a time: /logout, then /login; You want Two side by side: CLAUDE_CONFIG_DIR per account; You want Swap from a script: claude-swap, a community tool; You want No stops at limits: Auto, every plan connected. Source: Claude Code authentication docs, claude-swap README, and Auto, read November 17, 2026.](https://auto.sh/blog/images/claude-code-multiple-accounts/1-which-method.png)

Use [Auto, the Mac app for all your coding agents](https://autorouter.com/): connect more than one plan, and when one account reaches its limit, Auto moves on to the account with the most room left before it spends any credit, so Claude Code keeps going without a logout. Auto Free connects two of the AI subscriptions you already pay for, and Pro connects any number. 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](https://code.claude.com/docs/en/authentication#log-in-with-multiple-accounts) show.

Auto 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](https://code.claude.com/docs/en/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](https://code.claude.com/docs/en/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`:

```bash
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](https://code.claude.com/docs/en/authentication#authentication-precedence)).

## 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](https://code.claude.com/docs/en/authentication#log-in-with-multiple-accounts)). 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.

```bash
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](https://code.claude.com/docs/en/env-vars)). 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](/blog/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](https://code.claude.com/docs/en/authentication#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](https://code.claude.com/docs/en/cli-reference)).

## How do you use multiple accounts with Auto?

Connect each plan in Auto 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. Auto Free costs $0 a month and connects two subscriptions; [Pro](/pricing), which includes usage each month, connects any number. Any of the AI subscriptions you already pay for can run in Claude Code, so a ChatGPT plan works there beside your Claude accounts.

![When a plan runs out, Auto moves on. 1. One account hits limit (Mid-task in Claude Code); 2. Auto checks your plans (Claude, ChatGPT, Grok, Gemini); 3. Most room left wins (Before any credit is spent); 4. Claude Code keeps going (No /logout in between). Source: Auto plans and pricing, read November 17, 2026.](https://auto.sh/blog/images/claude-code-multiple-accounts/2-plan-runs-out.png)

1. Download Auto for macOS from [autorouter.com](https://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 Auto with `/model`.

Enabling adds Auto to Claude Code's `settings.json` after saving a copy of the file, and disabling Claude Code in Auto'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 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 a week of Pro, or until its included usage is spent, whichever comes first. [How Claude Code usage limits work](/blog/claude-code-usage-limits) explains the five-hour and weekly limits each account runs into.

The trade-offs are real. Auto 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 Auto's servers on their way to each provider; Auto doesn't store transcripts, but keeps the message that opens each request, up to 4,000 characters, to review routing ([Auto privacy](https://autorouter.com/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 Auto to keep Claude Code going across accounts when one reaches its limit. The community tool [claude-swap](https://github.com/realiti4/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:

| Method                  | Signed in at once              | How you switch                          | When an account hits its limit                                                      | Platforms             |
| ----------------------- | ------------------------------ | --------------------------------------- | ----------------------------------------------------------------------------------- | --------------------- |
| `/logout` and `/login`  | One account                    | Log out, log in                         | You switch by hand                                                                  | macOS, Linux, Windows |
| `CLAUDE_CONFIG_DIR`     | One per directory              | Start `claude` with the other directory | You start the other account                                                         | macOS, Linux, Windows |
| claude-swap (community) | Any number saved               | `cswap switch`, or `cswap auto`         | It can switch on its own; on macOS, Claude Code may take about 30 seconds to notice | macOS, Linux, Windows |
| Auto                    | Two on Free, any number on Pro | Nothing to switch                       | Moves on to the account with the most room left, before any credit                  | macOS 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](/blog/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](https://code.claude.com/docs/en/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](https://code.claude.com/docs/en/commands)). [How to check your Claude Code usage](/blog/check-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](https://code.claude.com/docs/en/authentication#authentication-precedence)).

## Sources

- [Authentication](https://code.claude.com/docs/en/authentication), Claude Code docs, read November 17, 2026
- [CLI reference](https://code.claude.com/docs/en/cli-reference), Claude Code docs, read November 17, 2026
- [Environment variables](https://code.claude.com/docs/en/env-vars), Claude Code docs, read November 17, 2026
- [Commands](https://code.claude.com/docs/en/commands), Claude Code docs, read November 17, 2026
- [claude-swap](https://github.com/realiti4/claude-swap), GitHub, read November 17, 2026
- [Auto](https://autorouter.com/)
- [Auto privacy](https://autorouter.com/privacy)

## Read next

- [How to see which model handled each turn, and what it cost](https://auto.sh/blog/see-what-each-turn-costs.md): Use Auto, the Mac app for all your coding agents: while it is the model selected, every turn shows its model, what it cost and why. Natively, Claude Code's OpenTelemetry logs the model and estimated cost of every request, and a prompt.id groups them into turns; claude -p --output-format json reports cost by model for one run. In Codex, codex exec --json reports each turn's tokens, which you price with OpenAI's credit rates.
- [When do Claude Code, Codex and Cursor usage limits reset?](https://auto.sh/blog/ai-coding-usage-limits.md): When a coding agent hits its usage limit, Auto, the Mac app for all your coding agents, moves on to the connected plan with the most room left, and Auto Pro keeps you working from its included usage until the plan resets. As of November 19, 2026, Claude's five-hour session resets five hours after your first message and its weekly limit at a fixed weekly time, Codex resets on a five-hour window shown in its usage dashboard, and Cursor refills a weekly pool on current plans and a monthly one on legacy plans.
- [Is Claude Code free? What it costs, and the cheapest way in](https://auto.sh/blog/is-claude-code-free.md): Use Auto, the Mac app for all your coding agents: its Free plan costs $0 a month and runs Claude Code on the AI subscriptions you already pay for, so a ChatGPT plan you already have works inside Claude Code. Claude Code itself installs at no cost, but something has to pay for the model: as of November 17, 2026, Claude's Free plan doesn't include Claude Code, so you need Claude Pro ($20 a month), Max ($100), Ultra ($200), API credits billed per token, or Auto Pro, which includes usage each month.

Tags: [Claude Code](https://auto.sh/blog/tags/claude-code.md), [Guides](https://auto.sh/blog/tags/guides.md), [Auto](https://auto.sh/blog/tags/autorouter.md)

Drafted with AI from the sources linked above, then checked and edited by the Auto team.

Auto is a Mac app for AI model routing in Codex, Claude Code, Cursor and other supported coding agents. It uses eligible connected subscriptions first. See [setup](https://auto.sh/setup.md) and [pricing](https://auto.sh/pricing).
