Feature Request: Support for multiple Claude Code sessions with different accounts

Status Fixed / completed
Maintainer reply None cached
Activity 9 comments · opened Mar 2, 2025 · closed Mar 5, 2025

Problem:
Currently, Claude Code doesn't appear to support running multiple instances with different Anthropic accounts simultaneously. When working across different projects or teams that may require different accounts (e.g., personal vs work accounts), users need to constantly log out and log back in.

Feature Request:
Add support for running multiple Claude Code sessions with different Anthropic accounts simultaneously, such as:

  • Allow specifying an account profile when starting Claude Code (e.g., claude --profile work or claude --profile personal)
  • Store credentials separately for each profile
  • Provide visual indication in the terminal of which profile is currently active
  • Allow switching between profiles without losing session context

Use Cases:

  • Working on multiple projects that require different billing accounts
  • Collaborating across personal projects and work projects simultaneously

Additional Context:
The current /login command allows switching accounts, but doesn't support maintaining multiple active sessions simultaneously in different terminals.

View original on GitHub ↗

9 Comments

ghost · 1 year ago

Thank you for the suggestion! As an immediate workaround you can use CLAUDE_CONFIG_DIR env var to set the directory to keep your profile data in, e.g. you can use CLAUDE_CONFIG_DIR=~/work claude for work and CLAUDE_CONFIG_DIR=~/personal claude for personal sessions.

jonopryor · 1 year ago

I have written a simple bash tool to manage the keys for the default Claude configuration file for multiple projects.
I wanted this not just to separate work/personal but to be able to allocate API costs to different Anthropic Console Workspaces for cost tracking.
Hopefully someone finds this useful.

https://github.com/jonopryor/claude-code-api-key-manager

isasmendiagus · 1 year ago
Thank you for the suggestion! As an immediate workaround you can use CLAUDE_CONFIG_DIR env var to set the directory to keep your profile data in, e.g. you can use CLAUDE_CONFIG_DIR=~/work claude for work and CLAUDE_CONFIG_DIR=~/personal claude for personal sessions.

Doing that Claude Code fails to connect to Jetbrains Plugin. (even if I set the CLAUDE_CONFIG_DIR on my terminal and launch webstorm from there)

Is there a permanent solution? Or something in your roadmap?

I really need that option to switch profiles between work and personal projects

mugnimaestra · 1 year ago

Up, this is useful when i have given max plan from the company but I also have one for myself so I can separate it seamlessly

tvvignesh · 1 year ago

Hi. Looking for the same as well. This can help me better manage and use claude code without going for vm or separate lappy or logout and login. Thanks

sf8193 · 1 year ago

was this completed? I don't see any mention of how to use it

rubslopes · 1 year ago

As a workaround, you can expand on @isasmendiagus suggestion:

Thank you for the suggestion! As an immediate workaround you can use CLAUDE_CONFIG_DIR env var to set the directory to keep your profile data in, e.g. you can use CLAUDE_CONFIG_DIR=~/work claude for work and CLAUDE_CONFIG_DIR=~/personal claude for personal sessions.

and add this to your .bashrc or .zshrc:

_claude_with_profile() {
  export CLAUDE_CONFIG_DIR="$1"
  command claude "${@:2}"
}

# Personal profile (default)
claude() {
  _claude_with_profile "$HOME/.claude" "$@"
}

# Work profile
wclaude() {
  _claude_with_profile "$HOME/.claude-work" "$@"
}

and access it with claude or wclaude for personal and work accounts, for instance.

Remember that user files settings.json and CLAUDE.md will be unique for each account. But we can symlink them, I guess.

federicotdn · 1 year ago

I have this in my .bashrc:

claude() {
    local config_value="personal"
    local claude_args=()

    while [[ $# -gt 0 ]]; do
        case $1 in
            -u)
                if [[ -n "$2" && "$2" != -* ]]; then
                    config_value="$2"
                    shift 2
                else
                    echo "Error: -u requires a value" >&2
                    return 1
                fi
                ;;
            *)
                claude_args+=("$1")
                shift
                ;;
        esac
    done

    echo "Claude Code user: $config_value."
    CLAUDE_CONFIG_DIR="$HOME/.claude-$config_value" command claude "${claude_args[@]}"
}

Use it with -u <name> e.g.:

$ claude -u work <other CC args here>

The <name> defaults to personal - that is, ~/.claude-personal/ as the config dir.

The only problem is that changing CLAUDE_CONFIG_DIR seems a bit buggy:

I'm surprised there's no better built-in support for this.

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.