Reference · Claude Code · Updated 11 November 2026 · By the makers of Claude Sessions Pro

CLAUDE_CONFIG_DIR: what it does, and why it's not working.

One environment variable decides which Claude Code account you are using. Set it right and two accounts run side by side in two terminal tabs. Set it almost right and Claude Code carries on as if you had done nothing.

Short answer: CLAUDE_CONFIG_DIR tells Claude Code which directory to keep its settings, session history and login in. Point it at a second directory and you get a second, separately signed-in Claude Code, as Anthropic's docs describe. When it "doesn't work", the variable usually isn't reaching the command, or another credential is overriding the login. It only affects the terminal: Claude Desktop needs its own separate copy per account, which Claude Sessions Pro sets up along with the variable.

Free 1-hour preview. For macOS 14 or later, 64-bit Windows 10 or 11, or Ubuntu 22.04+ and Debian 12+, with the Claude app installed.

What it separates

  • The login. On a Mac the Keychain entry is keyed to the directory, so a different CLAUDE_CONFIG_DIR reads a different entry. On Linux and Windows the login is the .credentials.json file inside the directory.
  • Settings and history. Each directory has its own settings and its own session history.
  • The default. With the variable unset, Claude Code uses ~/.claude, or %USERPROFILE%\.claude on Windows.

How to set it

  1. Bash or Zsh, as an alias.
    alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
    Add this to ~/.zshrc or ~/.bashrc, open a new terminal, and run claude-work. The first run walks you through login for the new directory.
  2. For one command.
    CLAUDE_CONFIG_DIR=~/.claude-work claude
    Useful for a quick test.
  3. PowerShell on Windows.
    $env:CLAUDE_CONFIG_DIR = "$HOME\.claude-work"
    claude
    This sets it for the current window only.

Six reasons it's not working

  1. It is set in one terminal only. A variable set by hand lives in that tab. Open a new one and it is gone. Use the alias, or set it in your shell profile.
  2. The alias isn't loaded yet. Aliases added to ~/.zshrc apply to new terminals. Open a new tab or run source ~/.zshrc.
  3. The tilde is in quotes. The shell doesn't expand ~ inside quotes, so "~/.claude-work" becomes a folder literally named ~. Use "$HOME/.claude-work".
  4. Another credential outranks the login.
    /status
    If ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN or CLAUDE_CODE_OAUTH_TOKEN is set, Claude Code uses it ahead of the login in your directory. Check which one is active.
  5. You sign in to the Console without an API key. Anthropic's docs say separate directories don't keep two such Console sign-ins apart, because that sign-in is stored outside the configuration directory.
  6. You expected Claude Desktop to follow. The desktop app doesn't read the variable. It keeps its own login in its own data folder.

The variable, set for you.

Claude Sessions Pro gives every Claude account a profile, and each profile has its own Claude app and its own Claude Code directory. Click "Claude Code in Terminal" on a profile and the CLI opens with that profile's CLAUDE_CONFIG_DIR already set, signed in to the same account as the app. No aliases to write, and no wondering which account a tab is on.

The desktop app is covered too, which the variable alone can't do: each account is its own Claude app on a Mac, or its own window on Windows and Linux, all open at once. Try it free for an hour; then it's $15 once for two computers, Mac, PC or Linux, with a 14-day refund.

Claude Sessions Pro with a profile per Claude account, each with its own Claude Code

Example accounts. We make Claude Sessions Pro.

Claude Sessions Pro
$15one-time

Free 1-hour preview · 14-day refund · 2 computers, Mac, PC or Linux

The full two-account setup, with what to copy between folders: two Claude Code accounts in Terminal at once.

FAQ

What is CLAUDE_CONFIG_DIR?

An environment variable that tells Claude Code which directory to use for its settings, session history and login. A different directory is a different, separately signed-in Claude Code.

What is the default Claude config directory?

~/.claude on macOS and Linux, and %USERPROFILE%\.claude on Windows.

Why is CLAUDE_CONFIG_DIR not working?

Usually the variable isn't set in the terminal you are using, the tilde is inside quotes, or an API key or token in your environment is being used ahead of the login. Run /status to see which credential is active.

How do I set CLAUDE_CONFIG_DIR on Windows?

In PowerShell, run $env:CLAUDE_CONFIG_DIR = "$HOME\.claude-work" and then claude. It applies to that window.

Does CLAUDE_CONFIG_DIR work with Claude Desktop?

No. Claude Desktop keeps its own login and doesn't read the variable. Each account needs its own copy of the desktop app, which Claude Sessions Pro sets up.

Claude Sessions Pro is made by LEX GLOBAL IT S.R.L. and is not affiliated with, endorsed by or sponsored by Anthropic. It runs the official Claude app with accounts you already have, and Anthropic's terms apply to each account. Claude is a trademark of Anthropic, PBC.