Currently Available: Need a skilled Software Developer for your next project?
Categories
Coding Agents

How to Use Multiple Claude Code Accounts on One Machine

If you use Claude Code for both work and personal projects, you can keep separate accounts signed in on the same computer. The documented method is to give each account its own configuration directory, the folder Claude Code uses for settings, session history, and supported login credentials. Set the directory before you start Claude Code. That directory gives the launch its own settings, session history, and supported login credentials.

Each terminal can use a different account without copying your project files. The main exception is Claude Console sign-in without an API key: Anthropic says those sign-ins are stored outside the configuration directory, so separate directories do not isolate them.

Give each account its own configuration directory

Claude Code uses ~/.claude by default. Set the CLAUDE_CONFIG_DIR environment variable, a shell setting Claude Code reads when it starts, to choose a different folder for a launch. Anthropic documents this approach for keeping multiple accounts signed in at once in its authentication instructions.

In Bash or Zsh, keep claude for the default account and add an alias, a shortcut command, for another account:

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

Add the line to ~/.bashrc or ~/.zshrc, then open a new terminal. Run claude-work to start Claude Code with that profile. On the first launch, Claude Code prompts you to sign in. To add another account, create another alias with a different directory, such as ~/.claude-personal.

On Windows, set the variable in PowerShell before launching Claude Code:

$env:CLAUDE_CONFIG_DIR = "$HOME\.claude-work"
claude

The setting applies only to commands you start from that PowerShell session. For another account, open a separate terminal, set CLAUDE_CONFIG_DIR to a different path there, and run claude. The environment variable documentation describes the variable and Claude Code’s default configuration location.

Each profile has its own settings and session history, but both launches still access the project files in the directory from which you start Claude Code. Selecting a different profile does not make a separate copy of your codebase.

Check which account Claude Code uses

Start Claude Code from each profile and run:

/status

The command shows how Claude Code is signed in. Run it whenever Claude Code seems to be using the wrong account.

The ANTHROPIC_API_KEY environment variable can affect which credentials Claude Code uses. In interactive mode, Claude Code asks whether to use the key. In non-interactive -p mode, it uses the key if one is set. If you want to use a subscription login, check the shell that started Claude Code and remove the key from that shell's environment. Anthropic explains this order in its environment variable guidance.

Know what profile separation does not cover

A separate configuration directory keeps supported login credentials and profile data apart. There is an exception for Claude Console sign-ins without API keys. Anthropic says those credentials are stored outside the configuration directory, so using different directories does not separate those sign-ins. If you use this sign-in method, the two directories do not represent isolated Console accounts.

Each profile directory contains account data, so keep it private. Anthropic documents encrypted Keychain storage on macOS, though it uses file-based storage in some cases. On Linux, credentials are stored in files. Keep profile directories out of shared folders and source-control repositories. On a work computer, follow your employer’s rules for permitted accounts and authentication methods.

Separate profiles do not change your usage limits or account terms. Anthropic says its advertised Pro, Max, and Ultra limits assume ordinary individual use of Claude Code and the Agent SDK. Check the terms for your plan and use case. Multiple profiles do not bypass those limits. See Anthropic’s legal and compliance guidance.

What I'm building

Delegate tasks. Get software.

Give Vroni a GitHub issue, bug report, spec, or rough idea. It reads the repo, plans the change, writes code, runs checks, and works toward a review-ready pull request.

Take a look at vroni.com

Email updates

Usually a new article and a few links I found interesting.

No spam. Unsubscribe with one click.

Leave a Reply

Your email address will not be published. Required fields are marked *