# How to switch Claude Code accounts without logging out

URL: https://agentvera.dev/en/blog/switch-claude-code-accounts/ · Published: 2026-10-24

Switch Claude Code and Codex accounts without logging out: separate config folders, one account per agent, and account chains that move on at the usage limit.

**In short:**

- Claude Code keeps its login in a config folder. Pointing CLAUDE_CONFIG_DIR at a different folder gives you a second account without logging the first one out; Codex does the same with CODEX_HOME.
- AgentVera does this for you: add accounts in Settings → Accounts, then pick one per agent when you create it. Changing an agent’s account later restarts it with a new conversation.
- With an account chain (Pro and Team), agents move to the next account when the limit gets low and can carry the conversation over.

**To switch Claude Code accounts without logging out, give each account its own config folder and start each agent with the folder of the account you want.** Claude Code reads that folder from `CLAUDE_CONFIG_DIR`, and Codex reads its own from `CODEX_HOME`. AgentVera does this for you: you add accounts once in Settings → Accounts, pick one for each agent, and can let an account chain move agents to the next account when the usage limit gets low.

This guide covers the manual way first, so you know what is happening under the hood. Then it shows the same thing in AgentVera: adding accounts, choosing one per agent, changing it later, and setting up an account chain that switches automatically.

## Why logging out and back in is a poor way to switch

The obvious way to switch is `/logout`, then `/login` with the other account. It works, but it has three problems:

- **Only one account is active at a time.** Every Claude Code session on the computer uses the same login, so you can’t run a work agent and a personal agent side by side.
- **You are interrupted at the worst moment.** You usually switch because a limit ran out in the middle of a task.
- **The conversation stays behind.** Claude Code stores conversations in the config folder of the account that ran them.

Separate config folders fix the first problem. Account chains fix the other two.

## The manual way: one config folder per account

Claude Code keeps its settings, login and conversation history in a config folder. If you set `CLAUDE_CONFIG_DIR` before starting it, it uses that folder instead of the default one.

```bash
# Default account: uses the usual folder
claude

# Second account: its own folder, logged in once
CLAUDE_CONFIG_DIR=~/.claude-work claude
```

The first time you start Claude Code with a new folder, it asks you to log in. After that, both accounts stay logged in, and each terminal uses the account whose folder it was started with. Codex works the same way with `CODEX_HOME`:

```bash
CODEX_HOME=~/.codex-personal codex login
CODEX_HOME=~/.codex-personal codex
```

This is fine for two accounts in two terminals. It gets harder when you run several agents, want to see each account’s remaining limit, or want to move a running agent to another account without losing its place.

## Step 1: add your accounts in AgentVera

Open **Settings → Accounts** (“Claude and Codex logins”).

1. Your existing login is already listed and tagged **this computer**. It is the default account.
2. Click **Add Claude account** or **Add Codex account**.
3. Give it a name, for example “Work account” or “Personal ChatGPT”.
4. Choose **Add and sign in**. AgentVera runs the CLI’s own sign-in (`claude auth login` or `codex login`) in a separate config folder for this account. If a code is requested after you approve in the browser, paste it into the terminal shown in the dialog.

Each extra account uses its own config folder, so your default login is never touched. The list shows whether each account is signed in. **Sign in**, **Sign out**, **Refresh status** and **Delete account** are on each row. Deleting an account signs it out and deletes its local config folder. Agents that used it switch to the default account.

Cursor, Gemini, Copilot and the other agent CLIs have their own section, **Accounts of other agents**, under the same tab. Most of them sign in with the CLI’s own sign-in in a separate folder, and some run on API keys.

## Step 2: pick an account per agent

When you create an agent with **New agent**, the **Account** field lists the accounts for that tool with their status, **Signed in** or **Signed out**. Pick one and start the agent.

This is how you run a work agent and a personal agent side by side in the same project, each on its own plan, each with its own limits. If you choose a signed-out account, the dialog warns you that the agent will ask you to sign in on first launch.

## Step 3: change the account of an existing agent

To move one agent to another account by hand, open **Edit** in its pane header and pick a different **Account**. The dialog warns you before you save: “The tool or account changed, so the agent will restart with a new conversation.”

So a manual change is a fresh start. That is fine for a new task. For a task in progress, an account chain is the better tool, because it can take the conversation along.

## Step 4: set up an account chain for automatic switching

Account chains are on the Pro and Team plans. Open **Settings → Account switching** (“Next account when a limit is hit”).

1. Turn on the **Claude account chain** or **Codex account chain**. Each provider has its own chain.
2. Add accounts to the chain with the chips under it, then order them with **Move up** and **Move down**. **Remove** takes one out. The chain needs at least two accounts.
3. Set the **Threshold**. It is the share of the 5-hour or weekly limit left at which agents move on. The default is 3%, and the slider goes up to 30%.
4. Decide on **Move the conversation to the new account**. When it is on, the conversation record is copied to the new account’s folder and the agent picks up where it left off. When it is off, the switch starts a new conversation.

From then on, when an account has the threshold or less left on its 5-hour or weekly limit, or the CLI reports a limit, agents using it move to the next available account. After the last account, the chain wraps around and skips accounts that are out of quota.

## What happens during a switch

| Situation | What AgentVera does |
| --- | --- |
| Remaining limit falls to the threshold | Moves the agent to the next account in the chain |
| The CLI prints a limit message | Reacts right away, without waiting for the next check |
| An account’s login is rejected or expired | Skips it and tries the next working account |
| An account is signed out | Shows “Signed out – skipped” in the chain |
| Every account is out of quota | Warns you, and the agent continues when one opens up |
| The agent runs on an SSH server | Not switched; chains cover local agents |

If the conversation moves along and the agent had unfinished work, AgentVera tells it what happened in its message box. It says the previous account hit its usage limit, that the agent was moved to the next account with the same conversation, and that it should continue where it left off.

A few details keep switching calm. Usage is checked every 90 seconds. A single agent doesn’t switch again within five minutes. An account that hit its limit is remembered as unavailable until its window resets.

## Watch the limits before they hit

The status bar shows each account’s 5-hour and weekly usage, so you can see a limit coming. **Settings → Usage limits** shows the remaining quota and reset times. For Claude, AgentVera reads limits from Anthropic’s usage service. For Codex, it reads them per account from `codex app-server`. Neither is a stable public API, so treat the numbers as a guide.

If you use Telegram with AgentVera, you can also get account and limit alerts on your phone. See [Telegram control](/en/features/telegram-control/).

## Troubleshooting

| Problem | Fix |
| --- | --- |
| The chain never switches | Check that it has at least two signed-in accounts and that the chain is turned on |
| An agent started a new conversation after a switch | Turn on **Move the conversation to the new account** |
| An account shows signed out | Use **Sign in** on its row in Settings → Accounts |
| A manual account change lost the conversation | Expected: a manual change restarts the agent. Use a chain for tasks in progress |
| Limits look out of date | Click **Refresh limits** in the status bar |

## Use more accounts, but within the rules

Several accounts are common for good reasons: a company account and a personal one, or separate accounts for separate clients. Whether a given setup is allowed depends on your provider’s terms, so check them before adding accounts just to get more quota. Making the quota you have last longer is the other half of the job. [Claude Code usage limits](/en/blog/claude-code-usage-limits/) and [Claude Code token usage](/en/blog/claude-code-token-usage/) cover that.

## Wrapping up

Switching Claude Code accounts doesn’t have to mean logging out. One config folder per account gives you several logins at once. AgentVera adds those folders for you, lets you pick an account per agent, and with an account chain, moves agents to the next account at the limit while they keep their conversation. If you run long jobs, [How to run Claude Code overnight](/en/blog/run-claude-code-overnight/) shows how chains fit into an unattended run. The [account switching page](/en/features/account-switching/) has the full feature list.

## Frequently asked questions

**Can I be logged in to two Claude Code accounts at once?** Yes, if each account uses its own config folder. Claude Code reads the folder from CLAUDE_CONFIG_DIR, so two folders mean two logins. AgentVera gives every extra account its own folder, and the default account stays as it is.

**Do I lose the conversation when an agent switches accounts?** With an account chain and “Move the conversation to the new account” on, no: the conversation is copied to the new account’s folder and the agent continues. If you change an agent’s account by hand in Edit, it restarts with a new conversation.

**Is automatic account switching free?** Adding accounts and choosing one per agent is free. Automatic switching with account chains is on the Pro and Team plans and needs you to sign in to your AgentVera account.

**What happens when every account in the chain is out of quota?** AgentVera doesn’t keep trying. It warns you, and when one of the accounts opens up again, the agent continues where it stopped.

**Is using several accounts allowed?** That depends on your provider’s terms, not on AgentVera. Use extra accounts only in ways those terms allow, for example separate work and personal accounts.

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan has unlimited agents. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
