Skip to content

Instantly share code, notes, and snippets.

@KMJ-007
Created July 22, 2025 13:17
Show Gist options
  • Select an option

  • Save KMJ-007/0979814968722051620461ab2aa01bf2 to your computer and use it in GitHub Desktop.

Select an option

Save KMJ-007/0979814968722051620461ab2aa01bf2 to your computer and use it in GitHub Desktop.

Manage Multiple Claude Code Accounts

Run two Claude Code accounts simultaneously on macOS without re-authenticating by using separate configuration directories.

Steps

  1. Create Separate Config Directories

    mkdir ~/.claude-account1
    mkdir ~/.claude-account2
  2. Add Aliases to Shell Config

    • Open ~/.zshrc (or ~/.bashrc for Bash) in an editor:
      nano ~/.zshrc
    • Add:
      alias claude-account1="CLAUDE_CONFIG_DIR=~/.claude-account1 claude"
      alias claude-account2="CLAUDE_CONFIG_DIR=~/.claude-account2 claude"
    • Save and reload:
      source ~/.zshrc
  3. Authenticate Each Account

    • For account 1:
      claude-account1
      Log in; credentials save to ~/.claude-account1.
    • For account 2:
      claude-account2
      Log in; credentials save to ~/.claude-account2.
  4. Switch or Run Simultaneously

    • Run claude-account1 or claude-account2 in separate terminal tabs (Cmd + T).
    • Each uses its own config and usage limits.

Notes

  • Requires separate Anthropic accounts (different emails).
  • Check Anthropic’s terms to ensure compliance.
  • Update Claude Code: npm install -g @anthropic-ai/claude-code.
  • If re-authentication occurs, verify CLAUDE_CONFIG_DIR with echo $CLAUDE_CONFIG_DIR.
@manikandan-22
Copy link
Copy Markdown

I was doing the exact same thing manually — separate config dirs, shell aliases, the whole setup.

Eventually got tired of maintaining it by hand (settings not syncing, plugins missing on the second account, version nag issues, backups cross-contaminating) so I packaged the whole thing into an npm tool:

npmjs.com/package/claude-code-accounts

It automates the dir setup, symlinks your settings/plugins/skills across accounts (so you configure once, works everywhere), handles shell config automatically, and lets you choose what to share vs keep separate.

You get a claude-work command that shares everything except credentials.

@Shahinyanm
Copy link
Copy Markdown

Hey

With Opus 4.7 dropping and tokens burning through subscriptions faster than ever, I built a small tool to solve a problem many of us have — multiple Claude subscriptions sitting in separate directories, each with their own isolated settings.

The problem: You have 2-3 Claude accounts (personal, work, client) but each one lives in its own ~/.claude-* directory. Skills, agents, memory, project configs — all duplicated. Add a useful skill to one, the others don't see it.

The fix: https://github.com/Digital-Threads/aimux — think of it as tmux but for Claude subscriptions. One shared brain, multiple billing accounts.

How it works:

  • All your memory, skills, agents, commands, settings, and projects stay in one place — shared across every subscription
  • Each subscription keeps its own credentials and auth — completely isolated
  • Switch between accounts in one command: aimux run w launches work, aimux run o launches personal
  • Any flags pass straight through to Claude: aimux run w --resume, aimux run o -m claude-sonnet-4-6
  • Set a default model per profile — e.g. keep Opus 4.6 or 4.6[1m] which still runs on the old tokenizer, so you can work without watching your token balance drain in real time

Setup takes about 30 seconds:
npm install -g @digital-threads/aimux
aimux init # auto-detects your existing Claude directories
aimux status # see what you've got
aimux run # pick a profile and go

Works on macOS and Linux. Tested with 3 subscriptions running side by side — same skills, same memory, different billing.

If you're juggling multiple Claude accounts and tired of things being out of sync, give it a shot. Happy to help set it

@franzos
Copy link
Copy Markdown

franzos commented May 11, 2026

You can do something similiar with tku:

tku account list
Accounts (claude):
  * default              org: 652311d5  Claude Max (5x)
    business             org: cc4e31d9  team (5x)

* = currently active

Typical workflow for two accounts:

# already logged into account A via Claude Code
tku account add work

# log into account B (Claude Code drives this, not tku)
claude /logout
claude /login

tku account add personal

# from now on:
tku account use work
tku account use personal

All other properties like memory, skills, agents ... are shared between accounts.

@yogaaja22
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment