How to Switch Claude Accounts in the Terminal

Switch Claude Code to another account with /login or claude auth, check which one you're on, and set up one command per account so you never log in twice.

TCtThe Clawdrobe team
· 7 min read
Clawdrobe cover art titled "How to Switch Claude Accounts in the Terminal" with four account tiles

To switch Claude Code to another account, type /login inside a session (Claude Code describes it as "Switch Anthropic accounts"), or run claude auth logout and then claude auth login from your shell. Check the result with claude auth status --text. If you switch back and forth every day, give each account its own config folder instead, so you switch by typing a different command, without logging in again.

First, check which account you're on#

Two ways to check:

  • Inside Claude Code: type /status. It shows the login the session is using.
  • From the shell: run claude auth status --text. It prints the login method (a Pro, Max or Team subscription, for example), the organization and the email. Drop --text to get JSON with the same details plus configDirectory, the folder that login lives in.

claude auth status is the quickest check in a script or before a long job, because it doesn't start a session.

Option 1: switch in place#

This replaces the login Claude Code has stored, so it suits switching once in a while.

Inside a session:

  1. Type /login.
  2. A browser window opens. Sign in with the other account.
  3. Run /status to confirm.

From the shell:

claude auth logout
claude auth login --email [email protected]
claude auth status --text

A few flags help here:

  • --email fills in the address on the login page, so you're less likely to sign in to the wrong account out of habit.
  • --sso forces your organization's single sign-on, for Team and Enterprise accounts that use it.
  • --console signs in to the Anthropic Console instead, which bills API usage rather than a Pro or Max subscription. Leave it off for a claude.ai account; subscription login is the default.

The catch is that the folder holds one login at a time. Switch to your work account and your personal one is signed out until you switch back, with another trip through the browser.

Option 2: one config folder per account#

Claude Code keeps its settings, history and login in ~/.claude. Anthropic's authentication docs describe CLAUDE_CONFIG_DIR: point it at another folder and Claude Code uses that folder instead, with its own login, so you switch accounts by picking a folder.

  1. Sign the new folder in once, without starting a session:

    CLAUDE_CONFIG_DIR=$HOME/.claude-work claude auth login --email [email protected]
  2. Add an alias to ~/.zshrc:

    alias claude-work='CLAUDE_CONFIG_DIR=$HOME/.claude-work claude'
  3. Open a new terminal tab. Now claude is your personal account and claude-work is your work account, and both can run at once in different tabs.

To check a folder without opening it, run CLAUDE_CONFIG_DIR=$HOME/.claude-work claude auth status --text.

A new folder starts empty: your user settings, personal CLAUDE.md, slash commands, MCP servers and session history stay in ~/.claude. How to use multiple accounts in Claude Code covers what to copy or link across.

If the account depends on the project (a client's repos always use the client's account), you can skip the alias and let the folder you cd into pick the account. Claude Code: a different account for each project shows how with direnv or a few lines of zsh.

Option 3: Clawdrobe, if you also use Claude Desktop#

Clawdrobe is a Mac app that runs each Claude account in its own copy of Claude Desktop, with its own sign-in. Each account also gets its own Claude Code config folder, and the terminal side comes ready-made:

  • A command per account. In the account's Tools, Clawdrobe sets up a claude-<name> command, so claude-work runs Claude Code as the work account. The Tools button also opens Claude Code as that account in Terminal, iTerm, Ghostty or another terminal you pick in Settings.
  • An account per folder. Add a client's folders under the account's Tools → Folders, paste the one line Clawdrobe shows into ~/.zshrc, and plain claude runs as that account inside those folders.
  • The account in the status line. Turn on "Show the account in Claude Code" in Settings → General and copy the line it shows into ~/.claude/settings.json. Every session then shows which account it runs as, so you don't need /status to check.

Each account still signs in to Claude Code on its own, once. Unlike a bare new folder, the added accounts link back to your main ~/.claude, so your CLAUDE.md, settings, slash commands, skills, hooks, plugins and MCP servers come along. Session history is shared too, so claude --resume lists sessions from every account. If a client's work must stay completely apart, give that client a fresh folder as in option 2.

On Pro and Max, Anthropic counts Claude and Claude Code against the same limits (as of November 2026). Clawdrobe shows each account's 5-hour and weekly meters in one window, so you can pick the account with room before a long session. ⌘ 0 opens the one with the most left.

Clawdrobe is free for two accounts with every feature; Clawdrobe Pro is a one-time $10 for more. It needs macOS 26 or later and isn't affiliated with Anthropic.

Pitfalls#

  • ANTHROPIC_API_KEY in your shell. Once you approve the key, Claude Code uses it instead of your subscription login, so switching accounts changes nothing. If /status shows an API key you didn't expect, unset ANTHROPIC_API_KEY and check ~/.zshrc for an export.
  • Logging out the wrong folder. /logout and claude auth logout act on the folder in use. Run one in a claude-work tab and the work account logs out; your personal one stays signed in.
  • The browser decides which account signs in. /login hands you to the browser, and the browser may already be signed in to claude.ai as someone else. Use --email, or a browser profile per account, so you approve the login as the right person. How to sign in to two Claude accounts at once has more on this.
  • A ~ that doesn't expand. Inside quotes or an editor's environment settings, ~ stays a literal character. Use $HOME or a full path such as /Users/you/.claude-work.
  • Setting it per project. Set CLAUDE_CONFIG_DIR in the shell, an alias or a folder hook, so it's there before claude starts. Don't count on a repo's .claude/settings.json to pick the account.
  • Console logins. Anthropic notes that a Console login without an API key is stored outside the config folder, so separate folders don't keep two of those apart. Everything above is about claude.ai accounts.

Which one should you use?#

  • Switch a few times a month? /login, or claude auth logout and claude auth login --email ….
  • Switch every day, terminal only? One config folder per account and an alias. It's free and takes five minutes.
  • The account depends on the project? Let the folder decide, with direnv, a zsh hook or Clawdrobe's folders.
  • Use the same accounts in Claude Desktop too? Clawdrobe sets up the commands, folders and status line for every account, and shows how much of each limit is left.

More from the blog

Guide

Claude Code: A Different Account for Each Project

Clawdrobe7 min read

Make plain claude use your client's account in the client's folder and your own account everywhere else, with direnv, a zsh hook or Clawdrobe.

Troubleshooting

Claude Code Sessions Gone After Switching Accounts?

Clawdrobe6 min read

Switched accounts in Claude Desktop and the Code tab is empty? Your sessions aren't deleted. Why the list changes, how to get them back, and how to see them everywhere.

Guide

How to Sign In to Two Claude Accounts at Once

Clawdrobe7 min read

Stay signed in to a work and a personal Claude account at the same time in the browser, Claude Desktop and Claude Code, without the sign-in landing in the wrong one.

Every Claude account, side by side

Clawdrobe is free for two accounts. macOS 26 or later · Apple silicon and Intel.