Claude Code troubleshooting · September 10, 2026

Claude Code Account Switch Not Working? Check the Active Profile

If Claude Code still shows the old account after a switch, use /login for the provider's native authentication flow or inspect the active aisw profile, verify the live credential, and start a new Claude Code process. An existing session does not automatically inherit a changed aisw environment.

The usual Claude Code account-switching failure is a state mismatch, not a failed profile selection. The CLI may have selected the right profile while an already-running Claude process, terminal, or editor task still holds the previous environment.

1. Check the Claude Code profile that aisw selected

Run the tool-specific status check and the full verification check from the same terminal where you plan to launch Claude Code. The first command shows the Claude-specific active profile; the second checks whether the live credentials match the saved state.

aisw status --tool claude
aisw verify

If the active profile is not the one you intended, select it by name and verify again:

aisw use claude work
aisw status --tool claude
aisw verify

2. Start a new Claude Code process

Account switching is a boundary for new processes. Save or close the current Claude Code session, then relaunch it after the profile check. This applies when switching in a terminal, a VS Code integrated terminal, or another editor task that starts Claude Code.

aisw use claude personal
aisw verify
claude

3. If the terminal still carries the old environment

A shell hook applies profile-specific exports to the current shell. Open a fresh terminal after installing or updating the hook, then repeat the switch and verification commands. Without the hook, aisw use still writes the live credential state, but the current shell may not receive variables such as CLAUDE_CONFIG_DIR.

aisw shell-hook zsh >> ~/.zshrc
source ~/.zshrc
aisw use claude personal
aisw status --tool claude
claude

4. Check the Claude storage limitation

Claude Code installations differ in how OAuth state is stored. If the installed build uses a shared live Keychain credential, isolated profile state cannot claim to own that credential independently. aisw reports that limitation instead of masking it. Follow Claude Code's normal sign-in flow and use the supported storage mode for that install.

5. Switch Claude Code accounts in VS Code

Run the switch from VS Code's integrated terminal, then close and relaunch Claude Code. VS Code launches the agent from a shell environment, so the same profile and process rules apply. For a repository that must use a particular work or client account, bind it to a context and enable a workspace guard. The hook can warn or block before Claude Code starts under the wrong setup.

aisw context create client-acme --claude client-acme-claude
aisw workspace bind . --context client-acme
aisw workspace guard --mode strict

When the switch is working

The reliable sequence is: select the named profile, inspect its tool-specific status, verify the live state, and launch a new process. AI Switcher does not bypass Claude's authentication or usage limits; it makes the local account boundary visible and repeatable.

For the basic account-switching setup, read How to Switch Claude Code Accounts. For two accounts on one computer, see how to use multiple Claude Code accounts.

Make Claude Code account switching predictable

Install aisw for profile checks in the terminal, or inspect the active account in Desktop.

Claude Code switch troubleshooting questions

Direct answers for stale account state, native login, and aisw profile changes.

Why is Claude Code still using the old account after switching?

A running Claude Code process can keep its previous environment. Check aisw status --tool claude, verify the selected profile, then start a new Claude Code process or terminal.

How do I check which Claude Code account is active?

Run aisw status --tool claude and aisw verify. Review the active profile and whether the live credential matches it before opening the repository.

Can I switch Claude Code accounts in the middle of a session?

Claude Code's native `/login` flow can change its current login. An aisw profile switch changes the state used by a new process; save your work, exit the process, switch, verify, and relaunch so the updated environment is used.

How do I switch Claude Code accounts in VS Code?

Use Claude Code's native `/login` flow for a one-off login change, or select the named aisw profile in the integrated terminal, run aisw verify, close the existing process, and launch a new one. An aisw environment change does not rewrite a process that is already running.