Kipt

Your prompts and skills, one keystroke away.

Explore

Claude Code multiple accounts: run work and personal side by side

Use Claude Code with multiple accounts: give each login its own CLAUDE_CONFIG_DIR, set up shell aliases, VS Code and Desktop, and avoid the common pitfalls.

By the Kipt team · Updated 26 October 2026

How do you use multiple accounts in Claude Code?

To use multiple accounts in Claude Code, give each account its own configuration directory and point the CLAUDE_CONFIG_DIR environment variable at it when you start claude. Each directory keeps its own settings, session history, and claude.ai login or API key, so a work account and a personal account can stay signed in at the same time.

This is the documented approach. The authentication docs describe it under "Log in with multiple accounts," and the environment variables reference says CLAUDE_CONFIG_DIR is "Useful for running multiple accounts side by side."

If you only need to change accounts now and then, you don't need any of this: run /logout, then /login, and pick the other account.

How do you set up a work and a personal account?

The pattern is one alias per extra account. Your personal account keeps the default directory, ~/.claude, and the work account gets its own.

In Bash or Zsh, add this line to ~/.bashrc or ~/.zshrc:

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

Open a new terminal and run claude-work. Claude Code sees an empty directory and walks you through login and setup again. Sign in with your work account. From then on:

  • claude starts with your personal login and settings.
  • claude-work starts with your work login and settings.

You can add as many as you need, such as claude-client for a client's Team plan. Run /status in any session to confirm which account it's using; the Status tab shows version, model, account and connectivity.

In PowerShell, you can set the variable for the current window before launching:

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

The variable stays set for the rest of that PowerShell window, so later launches there use the work directory too. Run Remove-Item Env:CLAUDE_CONFIG_DIR to go back.

What does each configuration directory hold?

According to the docs, "All settings, session history, and plugins are stored under this path." In practice, each account directory has its own:

Item Separate per directory?
claude.ai login or API key Yes
User settings (settings.json) Yes
Session history and resume list Yes
Installed plugins Yes
Account details, personal MCP servers and folder trust (.claude.json) Yes, Claude Code writes it inside the directory
Personal skills and user CLAUDE.md Yes, they live in the directory
A repository's CLAUDE.md and .claude/settings.json No, they live in the repo
Managed settings from your organization No, they apply to the whole machine

The .claude directory reference adds that when CLAUDE_CONFIG_DIR is set, "every ~/.claude path on this page lives under that directory instead."

Credentials follow the directory too. On macOS, Claude Code stores logins in the Keychain, and with CLAUDE_CONFIG_DIR set it keys the Keychain entry to that directory, "so a session with a different CLAUDE_CONFIG_DIR reads a different entry." On Linux and Windows the .credentials.json file sits inside the directory.

The flip side: a new directory starts empty. Plugins, personal skills, your user CLAUDE.md and preferences such as vim mode have to be set up again for each account.

How do you use multiple accounts in VS Code and the Desktop app?

The alias only covers the terminal. Other surfaces need the variable set their own way.

  • VS Code extension. Set CLAUDE_CONFIG_DIR in the extension's claudeCode.environmentVariables setting. The VS Code docs note that the entry "applies only when its value is an absolute path; the extension doesn't expand ~ and ignores a relative value." See the VS Code guide for the extension's other settings.
  • Claude Desktop. The Desktop docs say to set CLAUDE_CONFIG_DIR in one of the places you'd set a variable for dev servers, then quit and reopen Desktop.
  • Settings files. You can also set it in the env block of your user settings or managed settings. Write an absolute path such as "/home/you/.claude-work", because no shell expands ~ there. Claude Code ignores CLAUDE_CONFIG_DIR in a project's .claude/settings.json and .claude/settings.local.json.

What can still mix up your accounts?

A few things sit outside the configuration directory, so they apply whichever alias you use.

API keys in your shell. Claude Code picks credentials in a fixed order, and ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY rank above a subscription login from /login. If your work key is exported in ~/.zshrc, your personal sessions use it too, once you approve it. Keep keys out of global shell files, and where you can, sign in with /login in each directory instead of using a key. The API key guide explains the trade-offs, and /status marks the credential that isn't in use when both are present.

Keyless Console sign-ins. If you sign in to a Claude Console account without creating an API key, Claude Code stores that sign-in as an Anthropic profile outside the configuration directory. The docs state that separate directories "don't keep two Claude Console sign-ins without an API key apart."

Your employer's managed settings. Managed settings apply wherever Claude Code runs on a machine. If your company laptop sets forceLoginOrgUUID, Claude Code reports an error for a claude.ai login to any other organization and exits at startup, so a personal account may simply not work on that machine. That's a policy decision, not a bug.

Hooks and scripts with hard-coded paths. This one is Kipt's inference, not something the docs state: CLAUDE_CONFIG_DIR changes where Claude Code looks, so a hook or script you wrote that names ~/.claude literally will most likely keep reading the default directory. If you have scripts like that, check them after you add a second account.

When should you just switch instead?

Separate directories are worth it when you work in both accounts on the same day. If you change accounts rarely, switching is simpler:

  1. Run /logout. This also resets first-launch setup, so the next start walks you through login again.
  2. Run claude (or /login) and choose the other account.

Anthropic's Team and Enterprise help article gives the same advice for joining an organization: if you're signed in with a different account, run /login first, then select your Team or Enterprise plan and authorize. If the organization option doesn't appear, log out, run claude update, restart your terminal and try again.

A setup that works well

  • Keep your most-used account on the default ~/.claude.
  • Add one alias per extra account, named after the account.
  • Set the same variable for VS Code or Desktop if you use them, with an absolute path.
  • Keep API keys out of global shell files.
  • Run /status whenever you're unsure which account a session is on.

One thing that should stay the same across accounts is your prompt library. Kipt keeps prompts and Agent Skills as Markdown in a private GitHub repo you own, and npx skills add https://github.com/<you>/<repo>.git --all -g installs every skill into Claude Code. Because each configuration directory has its own personal skills, check that a skill installed for one account shows up in the other before you rely on it. For login errors that aren't about multiple accounts, see the Claude Code login issues guide.

Questions

Can I use two Claude accounts in Claude Code at the same time?

Yes. Give each account its own configuration directory and set CLAUDE_CONFIG_DIR to that directory when you start claude. Each directory keeps its own settings, session history, and claude.ai login or API key, so both accounts stay signed in.

How do I switch accounts in Claude Code?

To switch the account a directory uses, run /logout and then /login inside Claude Code. To keep two accounts signed in at once, use a separate CLAUDE_CONFIG_DIR for each one, for example an alias named claude-work.

Where does Claude Code store my login?

On macOS it uses the encrypted Keychain; on Linux and Windows it uses a .credentials.json file in the .claude folder. When CLAUDE_CONFIG_DIR is set, the credentials file lives under that directory and the macOS Keychain entry is keyed to it, so each directory reads its own login.

Does a new CLAUDE_CONFIG_DIR keep my plugins and settings?

No. Settings, session history and plugins are stored under the configuration directory, so a new directory starts empty and Claude Code walks you through login and setup the first time. Project files committed in a repository, such as CLAUDE.md and .claude/settings.json, still apply because they live in the repo.

Why does Claude Code still use the wrong account?

An ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN exported in your shell outranks a claude.ai login once approved, whichever directory you use. Run /status to see the active account, and unset the variable to fall back to the subscription login.

Can I keep two Claude Console logins apart with CLAUDE_CONFIG_DIR?

Not if you signed in to Console without an API key. Claude Code stores that kind of sign-in outside the configuration directory, so separate directories don't keep two of them apart. Console logins that created an API key are stored with the directory's other credentials.

More in Claude Code

All guides

Keep your prompts and skills in one place, in your own GitHub. Install every skill with one command.

Get started

Kipt is an independent product, not affiliated with or endorsed by Anthropic, OpenAI, Cursor or GitHub. Claude, ChatGPT, Codex, Cursor and GitHub are trademarks of their owners.