[{"data":1,"prerenderedAt":53},["ShallowReactive",2],{"blog-claude-code-multiple-accounts":3,"blog-related-claude-code-multiple-accounts":36},{"slug":4,"title":5,"description":6,"category":7,"categoryId":8,"keyword":9,"date":10,"minutes":11,"body":12,"html":13,"headings":14},"claude-code-multiple-accounts","How to use several Claude accounts with Claude Code","Keep a personal plan and a work seat signed in to Claude Code at once with CLAUDE_CONFIG_DIR, switch cleanly, and avoid the API key trap. Commands included.","Usage & limits","usage-limits","claude code multiple accounts","2026-11-17",4,"To use two Claude accounts with Claude Code, give each one its own configuration directory and start `claude` with `CLAUDE_CONFIG_DIR` pointing at it. Each directory keeps its own login, settings and session history, so your personal plan and your work seat never mix. This is the documented way to stay signed in to several accounts at once; the alternative is logging out and in every time.\n\n## When do you actually need more than one account?\n\nReal cases:\n\n- **Personal plan and a work seat.** Your employer's Team or Enterprise seat for work repositories, your own Pro or Max for side projects.\n- **Several organizations.** One Claude account can belong to more than one organization, each with its own plan.\n- **Client work billed separately.** A different account per client, for accounting or data-handling reasons.\n\nOne case that is not a good reason: creating extra free or paid accounts to get around usage limits. Anthropic's terms govern that, so read them before you try, and prefer the routes in [Claude Code usage limits](\u002Fblog\u002Fclaude-code-usage-limits) (usage credits, a higher plan).\n\n## How do I stay signed in to two accounts with CLAUDE_CONFIG_DIR?\n\nPer the official authentication docs, set the `CLAUDE_CONFIG_DIR` environment variable when you start `claude`, to a directory dedicated to that account. Each directory has its own settings, session history, and claude.ai login or API key. The simplest setup is a shell alias in `~\u002F.zshrc` or `~\u002F.bashrc`:\n\n```sh\n# default account: plain `claude` keeps using ~\u002F.claude\nalias claude-work='CLAUDE_CONFIG_DIR=~\u002F.claude-work claude'\n```\n\nOpen a new terminal and run `claude-work`. The first time, Claude Code walks you through login and setup for that directory; sign in with the work account. From then on, `claude` is your personal account and `claude-work` is the other one. Add a third alias for a third account.\n\nOn macOS, Claude Code stores the login in the Keychain and keys the entry to the configuration directory, so two directories do not overwrite each other. On Linux the login is in `.credentials.json` inside each directory. You do not need to manage either by hand.\n\nWhat the separation means in practice:\n\n- **Sessions are separate.** `claude --resume` in the work directory only lists sessions started there, because history lives under that config directory's `projects` folder.\n- **Settings are separate.** Your `settings.json`, global `CLAUDE.md`, skills, commands and MCP servers in `~\u002F.claude` do not apply to `~\u002F.claude-work`. Copy or symlink what you want to share, for example the global CLAUDE.md and the skills folder.\n- **Limits are separate.** Each account has its own 5-hour window and weekly limit.\n\nA limit from the docs: separate directories do not keep two Claude Console sign-ins that are used without an API key apart, because Claude Code stores that kind of sign-in outside the configuration directory. This applies to Console, not to claude.ai subscriptions.\n\n## How do I check which account is active?\n\nRun `\u002Fstatus` inside a session. It shows the login method, the organization and the email of the active credential. From a shell:\n\n```sh\nclaude auth status\n```\n\n`claude auth login` and `claude auth logout` are the shell equivalents of `\u002Flogin` and `\u002Flogout`. Logging out resets first-launch setup for that directory, so the next `claude` walks you through login again.\n\nTo switch without separate directories, which is fine if you switch rarely, run `\u002Flogout` and then `\u002Flogin` and choose the other account. One Claude account that belongs to several organizations picks the organization during the browser step of login.\n\n## Why does Claude Code keep using the wrong credential?\n\nAlmost always because of an environment variable. Claude Code picks credentials in a fixed order: cloud-provider settings first, then `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_API_KEY`, an `apiKeyHelper` script, `CLAUDE_CODE_OAUTH_TOKEN`, and only then the subscription login from `\u002Flogin`. So if `ANTHROPIC_API_KEY` is set in your shell, Claude Code will use it after you approve it, and bill the API instead of any of your plans.\n\nFix it:\n\n```sh\nenv | grep -E 'ANTHROPIC|CLAUDE_CODE_(USE|OAUTH)'\nunset ANTHROPIC_API_KEY\n```\n\nthen check `\u002Fstatus` again. If both a login and an API key are configured, `\u002Fstatus` marks the one that is not in use. The same trap applies to scripts and CI: `claude setup-token` makes a long-lived token for non-interactive use, and it can only make model requests (no Remote Control, no claude.ai connectors).\n\n## Which account does each project use?\n\nClaude Code does not pick an account from the repository. It picks it from how you launched it. To make it automatic, use a launcher: an alias per account, or a tool like direnv that exports `CLAUDE_CONFIG_DIR` when you enter a folder:\n\n```sh\n# .envrc in ~\u002Fwork\u002F (direnv)\nexport CLAUDE_CONFIG_DIR=~\u002F.claude-work\n```\n\nThen `claude` anywhere under `~\u002Fwork` uses the work login. Keep this explicit. Mixing a personal account into a client repository, or the reverse, is the mistake worth designing around.\n\n## Troubleshooting\n\n- **\"Login expired\" or constant login prompts in one directory.** Run `\u002Flogin` there. Claude Code warns three days before a login expires; unattended sessions stop when it does.\n- **Settings missing in the second account.** Expected: it is a clean directory. Copy `settings.json` and symlink shared folders.\n- **Remote Control or connectors missing.** Both need a claude.ai login, not a token or API key.\n- **Two accounts, one repository.** Fine, but sessions are listed per config directory. Resume with the same alias you started with.\n\n## In Relais\n\nRelais has this built in. In Settings › Accounts you add your own plan, a team seat or another organization, sign each in once, and order them. Behind the scenes each is a Claude Code profile with its own `CLAUDE_CONFIG_DIR`, sharing your settings, skills, commands and session folder; only the login differs. New sessions start on the first account with room. When one hits its usage limit, the session carries on in the next, mid-task, and each still counts toward its own plan's limits. Because sessions stay real Claude Code sessions, `claude --resume` still works on them. Details on [features](\u002Ffeatures) and in the [FAQ](\u002Ffaq).","\u003Cp>To use two Claude accounts with Claude Code, give each one its own configuration directory and start \u003Ccode>claude\u003C\u002Fcode> with \u003Ccode>CLAUDE_CONFIG_DIR\u003C\u002Fcode> pointing at it. Each directory keeps its own login, settings and session history, so your personal plan and your work seat never mix. This is the documented way to stay signed in to several accounts at once; the alternative is logging out and in every time.\u003C\u002Fp>\n\u003Ch2 id=\"when-do-you-actually-need-more-than-one-account\">\u003Ca class=\"anchor\" href=\"#when-do-you-actually-need-more-than-one-account\" aria-label=\"Link to this section\">#\u003C\u002Fa>When do you actually need more than one account?\u003C\u002Fh2>\n\u003Cp>Real cases:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Personal plan and a work seat.\u003C\u002Fstrong> Your employer&#39;s Team or Enterprise seat for work repositories, your own Pro or Max for side projects.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Several organizations.\u003C\u002Fstrong> One Claude account can belong to more than one organization, each with its own plan.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Client work billed separately.\u003C\u002Fstrong> A different account per client, for accounting or data-handling reasons.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>One case that is not a good reason: creating extra free or paid accounts to get around usage limits. Anthropic&#39;s terms govern that, so read them before you try, and prefer the routes in \u003Ca href=\"\u002Fblog\u002Fclaude-code-usage-limits\">Claude Code usage limits\u003C\u002Fa> (usage credits, a higher plan).\u003C\u002Fp>\n\u003Ch2 id=\"how-do-i-stay-signed-in-to-two-accounts-with-claude-config-dir\">\u003Ca class=\"anchor\" href=\"#how-do-i-stay-signed-in-to-two-accounts-with-claude-config-dir\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do I stay signed in to two accounts with CLAUDE_CONFIG_DIR?\u003C\u002Fh2>\n\u003Cp>Per the official authentication docs, set the \u003Ccode>CLAUDE_CONFIG_DIR\u003C\u002Fcode> environment variable when you start \u003Ccode>claude\u003C\u002Fcode>, to a directory dedicated to that account. Each directory has its own settings, session history, and claude.ai login or API key. The simplest setup is a shell alias in \u003Ccode>~\u002F.zshrc\u003C\u002Fcode> or \u003Ccode>~\u002F.bashrc\u003C\u002Fcode>:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode># default account: plain `claude` keeps using ~\u002F.claude\nalias claude-work='CLAUDE_CONFIG_DIR=~\u002F.claude-work claude'\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Open a new terminal and run \u003Ccode>claude-work\u003C\u002Fcode>. The first time, Claude Code walks you through login and setup for that directory; sign in with the work account. From then on, \u003Ccode>claude\u003C\u002Fcode> is your personal account and \u003Ccode>claude-work\u003C\u002Fcode> is the other one. Add a third alias for a third account.\u003C\u002Fp>\n\u003Cp>On macOS, Claude Code stores the login in the Keychain and keys the entry to the configuration directory, so two directories do not overwrite each other. On Linux the login is in \u003Ccode>.credentials.json\u003C\u002Fcode> inside each directory. You do not need to manage either by hand.\u003C\u002Fp>\n\u003Cp>What the separation means in practice:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Sessions are separate.\u003C\u002Fstrong> \u003Ccode>claude --resume\u003C\u002Fcode> in the work directory only lists sessions started there, because history lives under that config directory&#39;s \u003Ccode>projects\u003C\u002Fcode> folder.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Settings are separate.\u003C\u002Fstrong> Your \u003Ccode>settings.json\u003C\u002Fcode>, global \u003Ccode>CLAUDE.md\u003C\u002Fcode>, skills, commands and MCP servers in \u003Ccode>~\u002F.claude\u003C\u002Fcode> do not apply to \u003Ccode>~\u002F.claude-work\u003C\u002Fcode>. Copy or symlink what you want to share, for example the global CLAUDE.md and the skills folder.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Limits are separate.\u003C\u002Fstrong> Each account has its own 5-hour window and weekly limit.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>A limit from the docs: separate directories do not keep two Claude Console sign-ins that are used without an API key apart, because Claude Code stores that kind of sign-in outside the configuration directory. This applies to Console, not to claude.ai subscriptions.\u003C\u002Fp>\n\u003Ch2 id=\"how-do-i-check-which-account-is-active\">\u003Ca class=\"anchor\" href=\"#how-do-i-check-which-account-is-active\" aria-label=\"Link to this section\">#\u003C\u002Fa>How do I check which account is active?\u003C\u002Fh2>\n\u003Cp>Run \u003Ccode>\u002Fstatus\u003C\u002Fcode> inside a session. It shows the login method, the organization and the email of the active credential. From a shell:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>claude auth status\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>\u003Ccode>claude auth login\u003C\u002Fcode> and \u003Ccode>claude auth logout\u003C\u002Fcode> are the shell equivalents of \u003Ccode>\u002Flogin\u003C\u002Fcode> and \u003Ccode>\u002Flogout\u003C\u002Fcode>. Logging out resets first-launch setup for that directory, so the next \u003Ccode>claude\u003C\u002Fcode> walks you through login again.\u003C\u002Fp>\n\u003Cp>To switch without separate directories, which is fine if you switch rarely, run \u003Ccode>\u002Flogout\u003C\u002Fcode> and then \u003Ccode>\u002Flogin\u003C\u002Fcode> and choose the other account. One Claude account that belongs to several organizations picks the organization during the browser step of login.\u003C\u002Fp>\n\u003Ch2 id=\"why-does-claude-code-keep-using-the-wrong-credential\">\u003Ca class=\"anchor\" href=\"#why-does-claude-code-keep-using-the-wrong-credential\" aria-label=\"Link to this section\">#\u003C\u002Fa>Why does Claude Code keep using the wrong credential?\u003C\u002Fh2>\n\u003Cp>Almost always because of an environment variable. Claude Code picks credentials in a fixed order: cloud-provider settings first, then \u003Ccode>ANTHROPIC_AUTH_TOKEN\u003C\u002Fcode>, \u003Ccode>ANTHROPIC_API_KEY\u003C\u002Fcode>, an \u003Ccode>apiKeyHelper\u003C\u002Fcode> script, \u003Ccode>CLAUDE_CODE_OAUTH_TOKEN\u003C\u002Fcode>, and only then the subscription login from \u003Ccode>\u002Flogin\u003C\u002Fcode>. So if \u003Ccode>ANTHROPIC_API_KEY\u003C\u002Fcode> is set in your shell, Claude Code will use it after you approve it, and bill the API instead of any of your plans.\u003C\u002Fp>\n\u003Cp>Fix it:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode>env | grep -E 'ANTHROPIC|CLAUDE_CODE_(USE|OAUTH)'\nunset ANTHROPIC_API_KEY\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>then check \u003Ccode>\u002Fstatus\u003C\u002Fcode> again. If both a login and an API key are configured, \u003Ccode>\u002Fstatus\u003C\u002Fcode> marks the one that is not in use. The same trap applies to scripts and CI: \u003Ccode>claude setup-token\u003C\u002Fcode> makes a long-lived token for non-interactive use, and it can only make model requests (no Remote Control, no claude.ai connectors).\u003C\u002Fp>\n\u003Ch2 id=\"which-account-does-each-project-use\">\u003Ca class=\"anchor\" href=\"#which-account-does-each-project-use\" aria-label=\"Link to this section\">#\u003C\u002Fa>Which account does each project use?\u003C\u002Fh2>\n\u003Cp>Claude Code does not pick an account from the repository. It picks it from how you launched it. To make it automatic, use a launcher: an alias per account, or a tool like direnv that exports \u003Ccode>CLAUDE_CONFIG_DIR\u003C\u002Fcode> when you enter a folder:\u003C\u002Fp>\n\u003Cpre class=\"code\" data-lang=\"sh\">\u003Ccode># .envrc in ~\u002Fwork\u002F (direnv)\nexport CLAUDE_CONFIG_DIR=~\u002F.claude-work\u003C\u002Fcode>\u003C\u002Fpre>\n\u003Cp>Then \u003Ccode>claude\u003C\u002Fcode> anywhere under \u003Ccode>~\u002Fwork\u003C\u002Fcode> uses the work login. Keep this explicit. Mixing a personal account into a client repository, or the reverse, is the mistake worth designing around.\u003C\u002Fp>\n\u003Ch2 id=\"troubleshooting\">\u003Ca class=\"anchor\" href=\"#troubleshooting\" aria-label=\"Link to this section\">#\u003C\u002Fa>Troubleshooting\u003C\u002Fh2>\n\u003Cul>\n\u003Cli>\u003Cstrong>&quot;Login expired&quot; or constant login prompts in one directory.\u003C\u002Fstrong> Run \u003Ccode>\u002Flogin\u003C\u002Fcode> there. Claude Code warns three days before a login expires; unattended sessions stop when it does.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Settings missing in the second account.\u003C\u002Fstrong> Expected: it is a clean directory. Copy \u003Ccode>settings.json\u003C\u002Fcode> and symlink shared folders.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Remote Control or connectors missing.\u003C\u002Fstrong> Both need a claude.ai login, not a token or API key.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Two accounts, one repository.\u003C\u002Fstrong> Fine, but sessions are listed per config directory. Resume with the same alias you started with.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Ch2 id=\"in-relais\">\u003Ca class=\"anchor\" href=\"#in-relais\" aria-label=\"Link to this section\">#\u003C\u002Fa>In Relais\u003C\u002Fh2>\n\u003Cp>Relais has this built in. In Settings › Accounts you add your own plan, a team seat or another organization, sign each in once, and order them. Behind the scenes each is a Claude Code profile with its own \u003Ccode>CLAUDE_CONFIG_DIR\u003C\u002Fcode>, sharing your settings, skills, commands and session folder; only the login differs. New sessions start on the first account with room. When one hits its usage limit, the session carries on in the next, mid-task, and each still counts toward its own plan&#39;s limits. Because sessions stay real Claude Code sessions, \u003Ccode>claude --resume\u003C\u002Fcode> still works on them. Details on \u003Ca href=\"\u002Ffeatures\">features\u003C\u002Fa> and in the \u003Ca href=\"\u002Ffaq\">FAQ\u003C\u002Fa>.\u003C\u002Fp>\n",[15,18,21,24,27,30,33],{"id":16,"text":17},"when-do-you-actually-need-more-than-one-account","When do you actually need more than one account?",{"id":19,"text":20},"how-do-i-stay-signed-in-to-two-accounts-with-claude-config-dir","How do I stay signed in to two accounts with CLAUDE_CONFIG_DIR?",{"id":22,"text":23},"how-do-i-check-which-account-is-active","How do I check which account is active?",{"id":25,"text":26},"why-does-claude-code-keep-using-the-wrong-credential","Why does Claude Code keep using the wrong credential?",{"id":28,"text":29},"which-account-does-each-project-use","Which account does each project use?",{"id":31,"text":32},"troubleshooting","Troubleshooting",{"id":34,"text":35},"in-relais","In Relais",[37,43,48],{"slug":38,"title":39,"description":40,"category":7,"categoryId":8,"keyword":41,"date":10,"minutes":42},"claude-code-usage-limits","Claude Code usage limits: the 5-hour window and weekly cap","How Claude Code's 5-hour window and weekly limit work, what makes you hit them, how to check usage, and what to do the moment Claude Code stops.","claude code usage limits",5,{"slug":44,"title":45,"description":46,"category":7,"categoryId":8,"keyword":47,"date":10,"minutes":42},"claude-code-context-window","Claude Code's context window: why it fills up and what to do","Why Claude Code's context window fills up, what loads before you type, and the commands (\u002Fcontext, \u002Fcompact, \u002Fclear) that stop you running out mid-task.","claude code context window",{"slug":49,"title":50,"description":51,"category":7,"categoryId":8,"keyword":52,"date":10,"minutes":42},"claude-code-pro-vs-max","Claude Pro or Max for Claude Code: which plan fits you?","Claude Pro or Max for Claude Code? How to decide from your own usage: how often you hit the limit, how many sessions you run, and what else you could do.","claude pro vs max claude code",1794931098788]