Orpheus
Multiple accounts

How do you run two Claude accounts on one machine?

Short answer

Give each Claude account its own config folder, which Anthropic documents. Your default account stays in ~/.claude. Start Claude Code with CLAUDE_CONFIG_DIR=~/.claude-work, run /login once to sign in the other subscription, and add a shell alias. Each agent then runs on the account whose folder it was started with, and each account keeps its own limits.

On this page

How it works

Claude Code keeps settings, session history and plugins in one configuration folder, ~/.claude by default. The CLAUDE_CONFIG_DIR environment variable points it at a different folder. Each folder has its own settings, history and claude.ai login, so two folders keep two accounts signed in at once.12

Anthropic says

“To stay signed in to multiple accounts at once, such as work and personal accounts, give each account its own configuration directory.”

Authentication, Log in with multiple accounts, code.claude.com · Checked .

The environment variables reference says the same, and calls the variable "Useful for running multiple accounts side by side," with the alias alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude' as its example.2

These are your own subscriptions. A second folder does not create an account or add capacity. It gives a subscription you already pay for its own place to sign in, for example a work plan next to a personal one. Sharing one account between people is not allowed. See what the terms say.

Set up the second account

  1. Pick a folder name

    Any path works. A name that says which account it holds is easier to live with, such as ~/.claude-work.

  2. Start Claude Code with that folder and sign in

    CLAUDE_CONFIG_DIR=~/.claude-work claude # inside Claude Code, then finish in the browser /login

    The first run in a new folder walks you through login and setup. You do this once per folder.1

  3. Add an alias

    Put this in ~/.zshrc or ~/.bashrc and open a new terminal. claude stays on your default account and claude-work uses the other one.

    alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
  4. Check which account each folder holds

    claude auth status --text CLAUDE_CONFIG_DIR=~/.claude-work claude auth status --text

    claude auth status prints JSON by default, and --text makes it readable. Since v2.1.268 the JSON includes a configDirectory field naming the folder in use.3 Inside a session, /status shows which plan and organization the sign-in uses.1

One tmux session per account

For agents that run for hours, put each in its own tmux session and start it with the folder of the account it should use. tmux's -e flag sets a variable for everything in that session, so plain claude inside it uses that account.5

# a session whose agents run on the Work account tmux new -s work-api -c ~/code/api -e CLAUDE_CONFIG_DIR="$HOME/.claude-work" claude # a session on the default account tmux new -s home-blog -c ~/code/blog claude

Prefixing the account to the session name, as in work-api, makes tmux ls show which account each agent is on.

Two Claude accounts on one machine, one config folder each
Config folderAccountStart an agent on it with
~/.claudePersonal, the defaultclaude
~/.claude-workWorkclaude-work, or CLAUDE_CONFIG_DIR=~/.claude-work claude
Source: Claude Code docs, Authentication. Checked .

Details that trip people up

  • Where the sign-in lives. On Linux the login is stored in .credentials.json inside the folder. On macOS it goes in the Keychain, and the Keychain entry is keyed to the folder, so each folder reads its own.1
  • Console logins without an API key are the exception. Anthropic notes that separate folders do not keep two such Claude Console sign-ins apart, because they are stored outside the configuration folder.1
  • Set it in your shell, not the project. Project and local settings files cannot set CLAUDE_CONFIG_DIR. In a user settings file, write the absolute path, because ~ is not expanded there.2
  • A running agent stays on its account. To move one, exit it and start it again under the other folder with claude --continue to pick up the latest conversation in that project folder.3

See usage for each account

Each subscription has its own 5-hour and weekly limits. Inside Claude Code, /usage shows the plan usage bars for the account that session is signed in to.7 Two open-source tools read the local logs of several folders:

# ccusage: one report per folder CLAUDE_CONFIG_DIR="$HOME/.claude-work" npx ccusage@latest claude daily # Claude Code Usage Monitor: several folders, kept apart claude-monitor --data-paths "$HOME/.claude,$HOME/.claude-work"

ccusage accepts a comma-separated list in CLAUDE_CONFIG_DIR, but it combines the data from every folder in the list, so run it once per folder to see each account.4 Claude Code Usage Monitor's --data-paths scans several folders "without merging unrelated accounts into one 5-hour window."6 Both estimate from local logs on this machine. They do not read Anthropic's own percentage for the account.

Common questions

Does the second account change my default one?

No. Your default account stays in ~/.claude and is not touched. The second account lives in its own folder.

Do I have to sign in every time?

No. You sign in once per folder. After that, starting Claude Code with that folder uses the account already signed in there.

Is CLAUDE_CONFIG_DIR an official feature?

Yes. Anthropic documents it in the Claude Code environment variables reference and in the authentication guide, which shows the claude-work alias as its example for running multiple accounts side by side.

How do I tell which account a session is using?

Run /status inside the session, or claude auth status --text in the shell with the same CLAUDE_CONFIG_DIR. Naming tmux sessions after the account also helps.

Can two people share one Claude account this way?

No. Anthropic's Consumer Terms say you may not share your account credentials or make your account available to anyone else. Config folders are for accounts that are each yours.

Sources

  1. Authentication: Log in with multiple accounts, Credential managementClaude Code docs, AnthropicUndated · Checked
  2. Environment variables: CLAUDE_CONFIG_DIRClaude Code docs, AnthropicUndated · Checked
  3. CLI reference: claude auth status, --continueClaude Code docs, AnthropicUndated · Checked
  4. ccusage: Claude Code data source and directory detectionccusageUndated · Checked
  5. tmux(1) manual page, new-session -etmux projectUndated · Checked
  6. Claude Code Usage Monitor READMEMaciek-roboblog on GitHubUndated · Checked
  7. Commands: /usageClaude Code docs, AnthropicUndated · Checked