How to use several Claude Code accounts on one Mac
Give each Claude Code account its own configuration folder, add a shell alias per account, and sign in once per folder. Here are the steps and the traps.
Give each account its own configuration folder with the CLAUDE_CONFIG_DIR environment variable, sign in once inside each folder, and start Claude Code through a small alias so you never have to log out to change accounts. This is the setup Anthropic describes itself: "To stay signed in to multiple accounts at once, such as work and personal accounts, give each account its own configuration directory" (Claude Code authentication docs).
This post is the practical setup on macOS. For what lives in a folder, read CLAUDE_CONFIG_DIR explained. For the terms question, read Is it allowed to have more than one Claude account?.
When this setup makes sense
The one case Anthropic's documentation names is "work and personal accounts". People use the same setup for other accounts that were issued to them, such as a seat from each of two client organisations. In every case each account is a real subscription or seat of your own, used for its own work.
This post does not suggest extra accounts as a way to get more usage. Anthropic's Team plan page says "Each seat is for one named individual" (Team plan), and its other words on accounts and limits are quoted in the post on whether more than one account is allowed, linked above.
Step 1: choose a folder per account
By default Claude Code keeps your main account's configuration in two places in your home folder: the ~/.claude folder and a ~/.claude.json file next to it, which holds account details and MCP server configurations (settings). Leave your main account there. For every other account pick a new folder, such as ~/.claude-work (Anthropic's example) or ~/.claude-acme. Starting the name with .claude- keeps the folders easy to spot.
Each folder gets its own settings, session history and sign-in, so your preferences and history do not carry over from one folder to the next. CLAUDE_CONFIG_DIR explained lists exactly what moves into the folder.
Step 2: add an alias for each one
Anthropic's example is a shell alias:
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
On a Mac with zsh, put the line in ~/.zshrc, then open a new Terminal window or run source ~/.zshrc. Add one alias per account:
alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
alias claude-acme='CLAUDE_CONFIG_DIR=~/.claude-acme claude'
A plain claude keeps using ~/.claude and ~/.claude.json, so your original account is untouched.
Step 3: sign in once per folder
Start the first alias:
claude-work
The first time you run it, Claude Code walks you through login and setup for the new folder and opens a browser to log in (authentication docs). If you are already signed in to claude.ai in the browser as a different account, switch accounts on that page before you approve, otherwise the folder ends up holding the wrong account. If the browser does not open, press c to copy the URL. If the browser shows a code instead of finishing, paste it at the "Paste code here if prompted" prompt. Success shows "Login successful".
If a folder is already set up but signed out, run /login inside Claude Code started with that alias.
Repeat for every folder. After this you only sign in again if a login expires (Claude Code then asks you to run /login).
Step 4: check which account a session is using
Inside any session, /status opens the Status tab, "showing version, model, account, and connectivity" (commands). Make it a habit to run it the first time you open a session in a new folder.
From a shell, claude auth status shows the authentication status, but without the variable it checks the default folder. Start it through the alias instead, for example claude-work auth status. The claude auth command has three subcommands, login, logout and status.
How it works on macOS
On macOS the sign-in itself is kept in the Keychain, and with CLAUDE_CONFIG_DIR set Claude Code keys the Keychain entry to the folder, so each folder reads its own entry (authentication docs). Users have reported versions where folders shared one entry (GitHub issue 20553, still open as of November 2026). What that looks like and what to do about it is in CLAUDE_CONFIG_DIR explained.
Traps to avoid
- Do not run
/logoutto change accounts. It removes all stored credentials, including saved MCP server logins (troubleshooting). The folder approach exists so you do not need it; Switch Claude Code accounts without logging out explains what logging out costs. - Watch for
ANTHROPIC_API_KEY. A key exported in your shell profile is in the environment of every alias, and Claude Code can use it instead of your subscription, which means API charges. See Claude Code API key overrides subscription. - Console sign-ins are the exception. Separate folders do not keep two Claude Console sign-ins made without an API key apart (authentication docs).
- Other apps do not follow your alias. Claude Desktop's Code tab uses the account signed in to the app. IDEs are covered in Run two Claude Code accounts at the same time.
There is no built-in switcher
Claude Code has no account switcher as of November 2026. A popular feature request asks for something "like gh auth switch" (GitHub issue 30031), and it is still open. Until that changes, a folder per account is the approach Anthropic documents.
Keeping an eye on all of them
Each account has its own limits, and they only show up when you check inside that account. Headroom is a free Mac menu bar app, independent of Anthropic and not made, endorsed or supported by it, that shows session use and weekly use for every Claude Code account signed in on your Mac in one panel. It finds the ~/.claude folder and any folder in your home folder whose name starts with .claude- and holds a signed-in account, so the folders you made above appear by themselves. It reads the sign-in Claude Code already saved on your Mac. You can also add an account from its "…" menu with "Add an Account…"; the steps are in Add a second Claude Code account to Headroom. Download it from the Headroom home page.
Headroom does not switch accounts for you. You still choose the account by the command you start.