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.
# 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:
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”).
- Your existing login is already listed and tagged this computer. It is the default account.
- Click Add Claude account or Add Codex account.
- Give it a name, for example “Work account” or “Personal ChatGPT”.
- Choose Add and sign in. AgentVera runs the CLI’s own sign-in (
claude auth loginorcodex 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”).
- Turn on the Claude account chain or Codex account chain. Each provider has its own chain.
- 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.
- 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%.
- 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.
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 and 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 shows how chains fit into an unattended run. The account switching page has the full feature list.