How to switch Claude accounts in VS Code

You have more than one Claude account, say work and personal, and you want Claude Code in VS Code to use the right one. Here are the two built-in ways to switch, what to check when the wrong account answers, and a one-click option.

Short answer

In the Claude Code panel, type /login and sign in with the other account. You stay on one account at a time. To stay signed in to several, give each account its own settings folder with CLAUDE_CONFIG_DIR, then pick the folder in VS Code's claudeCode.environmentVariables setting, as an absolute path. The free Layers extension switches between those folders in one click.

Switch accounts by signing in again

Claude Code's own way to change accounts is to sign in again. Anthropic's quickstart says: "To switch accounts later or re-authenticate, type /login inside the running session." In VS Code that takes three steps.

  1. Open Switch account. In the Claude Code panel, type /login. You can also type / and pick Switch account from the command menu.
  2. Sign in with the other account. Finish in your browser with the account you want, the same way as the first time you signed in.
  3. Check which account you're on. Type /status to see the account, or /usage to open Account & usage, which shows your signed-in account and usage bars for its plan's limits.

This is the quickest way, but it keeps you on one account at a time, so going back means signing in again. To sign out without picking another account, choose Sign out in the command menu or type /logout. In the terminal, /login works the same way.

Stay signed in to multiple accounts: one settings folder each

To keep two accounts signed in at once, such as work and personal, Anthropic's docs say to "give each account its own configuration directory" and choose it with the CLAUDE_CONFIG_DIR environment variable. "Each directory has its own settings, session history, and claude.ai login or API key." Claude Code keeps each folder's sign-in apart (on a Mac, in its own Keychain entry), so one doesn't replace the other.

Your current account stays in ~/.claude, the default folder. The second account gets a new one, such as ~/.claude-work.

In the VS Code panel

  1. Get the folder's full path. The panel needs an absolute path, because "the extension doesn't expand ~ and ignores a relative value." On a Mac or Linux, echo $HOME/.claude-work in a terminal prints it.
  2. Add it to your user settings. Open the Command Palette (Cmd+Shift+P on a Mac, Ctrl+Shift+P on Windows and Linux), run Preferences: Open User Settings (JSON) and add this inside the outer braces, with your own path. On Windows, write each backslash twice.
    "claudeCode.environmentVariables": [
      { "name": "CLAUDE_CONFIG_DIR", "value": "/home/you/.claude-work" }
    ]
  3. Start a new chat and sign in. The new folder has no sign-in yet, so Claude Code asks for one. Sign in with the second account. If the sign-in screen doesn't appear, run Developer: Reload Window from the Command Palette, as the docs suggest.
  4. Check it, and switch back when you need to. /status shows the account a chat uses. To go back, delete the entry, so Claude Code uses ~/.claude again, or change the value to another folder's full path. Then start a new chat.

In the terminal

For the command line, the docs give this alias for Bash or Zsh. Add it to ~/.zshrc or ~/.bashrc. Here ~ is fine, because your shell expands it.

alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'

Open a new terminal and run claude-work. The first time, Claude Code walks you through signing in for the new folder. After that, claude-work uses your work account and claude keeps your other one. Point the panel at the same folder and it uses the same sign-in. One catch: typing claude in a terminal needs Claude Code's standalone install, because the VS Code extension doesn't add it to your PATH.

Things to know before you switch

Switch Claude accounts in one click with Layers

I make Layers, a free extension that sits on top of Claude Code in VS Code. It's unofficial: Anthropic doesn't make, endorse or support it. Layers builds on the folders above. Each Claude settings folder in your home folder counts as one account: ~/.claude shows as Main, and a folder such as ~/.claude-work shows under its own name. When you switch, Layers sets claudeCode.environmentVariables for you.

The Layers Accounts tab with sample data. A Best right now card says the current account, Work, has the most room of 4 accounts, with 75% left, and shows a bar for each account. Below are cards for Work, marked Current, and Personal, marked Near limit, each with rings for what's left of the 5-hour and weekly limits and the time until each resets.
The Accounts tab in the Layers sidebar: Best right now, then a card for each account. The accounts and numbers are sample data.
Claude Code's chat in VS Code with the Layers button in the message box, reading Work 18%, opened into a panel with sample data: Work's 5-hour usage at 18% with 82% left and its weekly usage at 25%, each with the time until it resets, then a list of accounts named Personal, Side project, Team and Work with each one's 5-hour and weekly use, and an Add account button.
The Layers button, opened in Claude's message box. The accounts and numbers are sample data.

The Layers button in Claude's message box shows the account you're on and its 5-hour usage. Click it to see every account and switch. New chats use the new account right away. If a chat that was already open still shows the old account, reload the window.

Layers changes Claude Code's installed files only after asking, and keeps a backup. Layers: Remove the layer (restore Claude Code's files) puts them back, and uninstalling does the same the next time VS Code restarts. Layers has no servers, no sign-up and no tracking. Layers needs VS Code 1.100 or newer, and VS Code installs Claude Code along with it. It works in VS Code, not in the terminal, the desktop app or claude.ai. It's tested on macOS; Windows and Linux are untested so far. You can install it from the VS Code Marketplace.

Use accounts that are yours

Anthropic's docs use work and personal accounts as the example, and that's the setup this page is about: your employer's account for your job, your own subscription for your own projects.

Questions

Can I use two Claude accounts in VS Code at the same time?

You can stay signed in to both, with one settings folder each. The panel uses the folder that claudeCode.environmentVariables names, or ~/.claude without it. To use the other account alongside it, run it in VS Code's terminal with an alias such as claude-work, which needs the standalone install.

Why does Claude Code still use my old account after I switch?

Type /status to see the account and which sign-in is in use. The usual causes: an approved ANTHROPIC_API_KEY or a CLAUDE_CODE_OAUTH_TOKEN, which wins over any folder's login; or a CLAUDE_CONFIG_DIR value with ~ or a relative path, which the panel ignores. If a chat still shows the old account, start a new chat or run Developer: Reload Window.

Do I lose my chats when I switch accounts?

No. Switching folders doesn't delete anything. Each folder keeps its own session history, so the chat list shows the chats of the folder in use. Switch back and the others are there. Layers switches the same way: it changes one VS Code setting.

Is Layers made by Anthropic?

No. I make Layers on my own. It's free and unofficial, and Anthropic doesn't make, endorse or support it. It works on top of Anthropic's Claude Code extension, which VS Code installs along with it.

Sources

I checked every source below on 23 October 2026.

Try Layers. It's free.

Install in VS Code

Or open VS Code, press ⌘P (Ctrl+P on Windows and Linux), paste it and press Enter.

Or get it from the VS Code Marketplace.