Headroom

Switch Claude Code accounts without logging out

Claude Code has no account switcher. Give each account its own folder and start a different command instead of running /logout and /login each time.

· 5 min read

You switch Claude Code accounts without logging out by not switching at all: each account lives in its own configuration folder, and you pick the account by choosing which command you start. There is no built-in switcher as of November 2026. Running /logout and /login in one folder works, but every /logout removes all stored credentials, saved MCP server logins included.

The setup is two lines of shell and one sign-in per folder. The full walkthrough is in How to use several Claude Code accounts on one Mac; this post explains why the logout route is the wrong tool and what happens if you use it anyway.

What /logout actually does

Anthropic's documentation says: "To log out and re-authenticate, type /logout at the Claude Code prompt. Logging out also resets your first-launch setup state, so the next time you run claude it walks you through login and setup again." The troubleshooting page adds that logging out "removes all stored credentials, including the plaintext file's contents, saved MCP server logins, and plugin sensitive values" (authentication, troubleshooting).

That is more than a sign-out. Saved MCP server logins are credentials too, so logging out to change accounts can mean signing back in to those as well. It is a heavy way to do something you may want several times a day.

The folder approach

Anthropic's documented way to keep more than one account signed in is a configuration directory per account:

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

Each directory has its own settings, session history and claude.ai login or API key (authentication). Add an alias like that for each account, sign in once in each folder, and from then on switching is typing a different command:

claude          # your main account, in the default ~/.claude
claude-work     # the account kept in ~/.claude-work

Nothing is logged out, and neither account is disturbed. Your session history and settings stay with the folder, too, so the two accounts do not mix.

Why switching inside one folder is awkward

A folder holds one saved login, and every session started on that folder shares it. Anthropic's troubleshooting page says parallel sessions on one machine "share a saved login and coordinate its renewal" (troubleshooting); what that means for windows running side by side is covered in Run two Claude Code accounts at the same time.

Sharing is useful when you meant it, and surprising when you did not. If you run /login as a different account in a folder that already has other sessions open, you change the login those sessions share. Users have reported that doing this in one session changes the account shown in the other open sessions on that folder, but not their usage figures until each one runs /login too (GitHub issue 98437). That is a user report on an open issue, not documented behaviour, but it is a good reason not to use one folder as a switching board.

Separate folders avoid the whole question, because each folder has its own saved login.

What switching with /login does to a waiting session

Claude Code can wait out a limit and continue by itself. If a claude.ai usage limit stops Claude mid-task, Claude Code waits in the open session and continues after the limit resets. Anthropic lists switching accounts with /login among the things that end that wait (interactive mode). If a session is waiting to continue, do not run /login in it, or it will no longer pick the task up on its own.

Checking which account you are on

Before you type anything important, check:

/status

Anthropic describes the Status tab as "showing version, model, account, and connectivity" (commands). From a normal shell, claude auth has three subcommands, login, logout and status, and nothing for switching. A user request for a switcher "like gh auth switch" is open on GitHub (issue 30031).

A switching mistake that costs money

Switching has a second trap that has nothing to do with folders. If an ANTHROPIC_API_KEY environment variable is set, Anthropic says Claude Code will use it "instead of your Claude subscription", which means API usage charges rather than your plan's included usage (Pro, Max and Ultra with Claude Code). In an interactive session Claude Code asks once whether to use the key and remembers your answer (authentication). If you moved from one account to another and the bill looks wrong, run /status and look for the credential that is in use. The details are in Claude Code API key overrides subscription.

When to still use /login

There are good reasons to run /login: a new folder that did not walk you through sign-in, renewing an expired login (Claude Code shows "Login expired · Please run /login"), and fixing "OAuth token revoked". For those, run it inside the folder that needs it, started the usual way:

CLAUDE_CONFIG_DIR=~/.claude-work claude

then /login at the prompt. The lapsed-login case is walked through in Headroom says Sign-in lapsed.

A note on which accounts to use

Keep to accounts that are yours to use: a personal plan, and a seat your employer or client has issued to you. This post is about moving between your own accounts without friction; it does not suggest a second account as a way around a limit. Anthropic's Team plan page says "Each seat is for one named individual" (Team plan), and its words on sharing accounts are quoted in Is it allowed to have more than one Claude account?.

Seeing both accounts at once

Headroom is a free, independent Mac menu bar app (not made, endorsed or supported by Anthropic) that lists every Claude Code account signed in on your Mac, with session use, weekly use and a status for each, so you can see where each account stands without starting a session in each. It does not switch accounts; you still do that with the command you run. Get it from the Headroom home page.