# Two Claude Code accounts on Windows (PowerShell, WSL)

> Claude Code keeps a Windows sign-in in .credentials.json inside its config folder. One PowerShell function per account gives each its own folder.

Source: https://shuriken.sh/guides/claude-code-multiple-accounts-windows

Give each account its own config folder, and start Claude Code from a PowerShell function or a .cmd file that points it at that folder. Each folder keeps its own .credentials.json, so both accounts stay signed in, and Claude Code inside WSL keeps a separate login of its own.

By Shuriken Updated 27 October 2026 7 min read

**Contents**

Claude Code on Windows keeps one sign-in per config folder, so running multiple accounts means giving each its own folder and starting claude with CLAUDE_CONFIG_DIR set to it. In PowerShell that is a five-line function in your profile; in Command Prompt, a four-line .cmd file. Both accounts stay signed in because each folder holds its own .credentials.json, and Claude Code inside WSL has a separate login already.

Anthropic's own example for this is a bash alias, and our [CLAUDE_CONFIG_DIR profiles guide](https://shuriken.sh/guides/claude-config-dir-profiles) is written for bash and zsh too. A PowerShell alias can't carry a variable or arguments, which is why the Windows version is a function. We checked every command against Anthropic's and Microsoft's docs on 24 October 2026.

## Where Claude Code keeps your login on Windows #

Anthropic's [authentication page](https://code.claude.com/docs/en/authentication) names the file: "On Windows, credentials are stored in %USERPROFILE%\.claude\.credentials.json", and that file inherits your user profile's access controls. A Mac keeps the same login in the Keychain. On Windows the whole sign-in is this one file, and that is what makes a second folder work.

The same page says what moves the file. With CLAUDE_CONFIG_DIR set, "Claude Code keeps the .credentials.json file under that directory instead". The [environment variable reference](https://code.claude.com/docs/en/env-vars) adds: "All settings, session history, and plugins are stored under this path", and calls it "useful for running multiple accounts side by side". So a second folder is a second, independent sign-in.

Two things stay outside the folder. A Claude Console sign-in made without an API key isn't kept apart, because Claude Code stores that kind outside the config directory; Pro, Max, Team and Enterprise logins are kept apart. And anything set in your environment, such as ANTHROPIC_API_KEY, reaches every folder alike (more on that below).

## Claude Code multiple accounts on Windows with PowerShell #

- Run Test-Path $PROFILE. PowerShell doesn't create a profile file for you, so False is a normal answer; make one with New-Item -ItemType File -Path $PROFILE -Force.
- Open it with notepad $PROFILE and paste one function per extra account. This one is for an account called work:

powershell
function claude-work {
$before = $env:CLAUDE_CONFIG_DIR
$env:CLAUDE_CONFIG_DIR = Join-Path $HOME '.claude-work'
try { claude @args } finally { $env:CLAUDE_CONFIG_DIR = $before }
}

- Save, then close PowerShell and open a new window, because the profile is only read when a session starts.
- Run claude-work. To Claude Code the new folder is a first run, so you get the login and setup screens; sign in with the second account in the browser.
- Type /status in that session. Its Email and Organization rows name the account the folder holds.

Plain claude keeps using %USERPROFILE%\.claude, so that stays your first account. @args passes on whatever you type after the name, which means claude-work --resume works. The finally line restores the variable when Claude Code exits; without it, the value would stay behind in the window and send your next plain claude to the work folder.

With both Windows PowerShell 5.1 and PowerShell 7 installed, the function goes in two files: 5.1 reads its profile from Documents\WindowsPowerShell and 7 from Documents\PowerShell.

### When PowerShell ignores your profile #

Microsoft's [about_Profiles page](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) says the Restricted execution policy "prevents all scripts from running, including the profiles". That is the usual reason claude-work comes back as "not recognized" in a new window. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser changes it for your account only, so it needs no administrator window. What RemoteSigned lets through, and the fix when Group Policy overrides it, are in [running scripts is disabled](https://shuriken.sh/guides/running-scripts-is-disabled-agent-cli).

## The same in Command Prompt #

There's no profile in Command Prompt to hold a function, so the function becomes a batch file, which PowerShell will run as well. Save these four lines as claude-work.cmd in a folder on your PATH:

bat
@echo off
setlocal
set "CLAUDE_CONFIG_DIR=%USERPROFILE%\.claude-work"
claude %*

setlocal keeps the variable inside the batch file. When Claude Code exits, the window you typed claude-work in has no CLAUDE_CONFIG_DIR, and plain claude there is still your first account.

For a one-off you can type set CLAUDE_CONFIG_DIR=%USERPROFILE%\.claude-work and then claude, but that set holds until you close the window, so every claude you run in it afterwards is the work account.

Unless you want every new terminal on the work folder, keep CLAUDE_CONFIG_DIR away from setx and [Environment]::SetEnvironmentVariable(..., "User"). Anthropic's docs show those two commands for variables that should apply to every session, and this variable decides which account plain claude signs in as.

## WSL and Windows: separate logins by default #

In WSL you install and run the Linux build of Claude Code inside the distro, as Anthropic's [setup page](https://code.claude.com/docs/en/setup) says. Its config folder is ~/.claude in your Linux home, and on Linux the login sits in ~/.claude/.credentials.json. It doesn't read %USERPROFILE%\.claude, so Claude Code in Windows and Claude Code in WSL are two sign-ins before you set any variable. Every distro also has its own home, and with it a login of its own.

For two accounts, then, WSL needs no setup at all: sign in with one in PowerShell and the other in Ubuntu. If WSL 2 can't hand the browser's callback back to Claude Code, Anthropic says the browser shows a code instead, and you paste it at the Paste code here if prompted prompt. A third account inside WSL takes the bash alias from the [profiles guide](https://shuriken.sh/guides/claude-config-dir-profiles), unchanged.

What you give up is that everything else is separate too. Settings, CLAUDE.md, skills and chat history live twice, on two file systems. Which side a project should run on is its own question, answered in [Claude Code on Windows: native or WSL?](https://shuriken.sh/guides/claude-code-windows-vs-wsl)

Shuriken moves a running chat to another of your own accounts when one reaches its limit, on every device.

[Download](https://shuriken.sh/download)

## Sharing skills and settings between folders #

Every folder starts empty. Your global CLAUDE.md, skills, agents and commands exist only in %USERPROFILE%\.claude until you copy or link them, and Windows has three kinds of link that don't need the same rights.

| Link | Works for | Needs |
| --- | --- | --- |
| Junction ( mklink /J ) | Folders on local drives | Nothing special |
| Symbolic link ( mklink , mklink /D ) | Files and folders | An administrator, or Developer Mode |
| Hard link ( mklink /H ) | Files on the same drive | Nothing special |

Microsoft's [Create symbolic links](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/create-symbolic-links) policy gives that right to Administrators by default. Since the Windows 10 Creators Update, [Developer Mode](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/) lets any user on the machine create symlinks without running as administrator, once an administrator turns it on.

Folders get junctions, because a junction needs no rights at all. These three PowerShell lines link skills, agents and commands from your first folder into the work one:

powershell
New-Item -ItemType Junction -Path "$HOME\.claude-work\skills" -Target "$HOME\.claude\skills"
New-Item -ItemType Junction -Path "$HOME\.claude-work\agents" -Target "$HOME\.claude\agents"
New-Item -ItemType Junction -Path "$HOME\.claude-work\commands" -Target "$HOME\.claude\commands"

CLAUDE.md and settings.json are files, and a junction can only point at a folder. Use a symbolic link if Developer Mode is on, or keep a copy in each folder. Microsoft's post names mklink as the command that works without elevation, so it runs in Command Prompt (from PowerShell, put cmd /c in front):

bat
mklink "%USERPROFILE%\.claude-work\CLAUDE.md" "%USERPROFILE%\.claude\CLAUDE.md"

A hard link also works, but it fails quietly. When a program saves the file by writing a new one in its place, the hard link keeps pointing at the old copy, and from then on the two files drift apart without a warning.

Make the links before the first claude-work run, or move that folder's own copy aside first: New-Item and mklink both stop with an error when the path already exists. .credentials.json is the one file that has to stay per folder, so never link it. Linking projects\ shares chat history between the accounts, and /resume in one profile then lists the other's chats too; leave it out if you want the histories apart.

## What can still put both profiles on one account #

- ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN saved as a Windows user variable. Every folder sees it, and Anthropic's precedence list ranks both above a /login sign-in, the API key once you approve it. [Environment]::SetEnvironmentVariable('ANTHROPIC_API_KEY', $null, 'User') deletes that variable; then open a new terminal.
- One email address in two organizations. Claude Code saves a claude.ai login together with its organization, which /status shows in the Organization row. If the address has both a Team seat and a personal plan, check that row in each profile after you sign in.
- /status read in the wrong window. Each session reports only its own folder's account, so run it in the session you are about to work in.

## Whose accounts these should be #

Anthropic's [Consumer Terms](https://www.anthropic.com/legal/consumer-terms) say you may not share your account login or credentials, or make your account available to anyone else. Two profiles are for accounts you own and are entitled to use, such as your own plan and your employer's Team seat. Never buy or borrow accounts to get around limits.

## How Shuriken does it on Windows #

Shuriken is a desktop app for Windows 10 and 11 (x64), and it keeps Claude sign-ins apart the same way these functions do. Each Claude account you add in Settings › Sources is a source with its own config folder, and Shuriken starts that account's Claude Code with CLAUDE_CONFIG_DIR pointing at it, so its .credentials.json lives there and nowhere else. If you already signed in to claude on that PC, Sources offers to add that account rather than making you log in again.

The linking is done for you as well. Chat history, agents, commands, skills and plugins come from your main .claude folder, joined with junctions on Windows, so no administrator or Developer Mode is needed. settings.json and CLAUDE.md are single files, so they're linked where Windows allows a symbolic link; where it doesn't, each source keeps its own files, apart from your main folder's. Sign-ins are never linked. Agents Shuriken starts also don't inherit ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN from your environment, so a forgotten user variable can't put a chat on the wrong account.

Then it switches between them, which the functions can't. We call it hot swapping: Shuriken moves your chats to another of your accounts or sources when one nears its limit (99% by default, or when Claude reports the limit). The by-hand alternatives are in [switching Claude accounts without logging out](https://shuriken.sh/guides/switch-claude-accounts-without-logging-out), and what the Windows build includes is in [Shuriken on Windows](https://shuriken.sh/blog/shuriken-on-windows). Free includes two sources, enough for a work and a personal account: [download Shuriken](https://shuriken.sh/download).

Share

[X](https://x.com/intent/post?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-multiple-accounts-windows&text=Two%20Claude%20Code%20accounts%20on%20Windows%20(PowerShell%2C%20WSL))[LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-multiple-accounts-windows)[Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-multiple-accounts-windows&t=Two%20Claude%20Code%20accounts%20on%20Windows%20(PowerShell%2C%20WSL))[Reddit](https://www.reddit.com/submit?url=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-multiple-accounts-windows&title=Two%20Claude%20Code%20accounts%20on%20Windows%20(PowerShell%2C%20WSL))[E-mail](mailto:?subject=Two%20Claude%20Code%20accounts%20on%20Windows%20(PowerShell%2C%20WSL)&body=https%3A%2F%2Fshuriken.sh%2Fguides%2Fclaude-code-multiple-accounts-windows)

## Sources

- [Claude Code docs: Authentication (log in with multiple accounts, credential management, precedence)](https://code.claude.com/docs/en/authentication) (accessed 24 October 2026)
- [Claude Code docs: Environment variables (CLAUDE_CONFIG_DIR, setting variables on Windows)](https://code.claude.com/docs/en/env-vars) (accessed 24 October 2026)
- [Claude Code docs: Explore the .claude directory](https://code.claude.com/docs/en/claude-directory) (accessed 24 October 2026)
- [Claude Code docs: Advanced setup (Windows and WSL)](https://code.claude.com/docs/en/setup) (accessed 24 October 2026)
- [about_Profiles (Microsoft Learn)](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles) (accessed 24 October 2026)
- [Hard links and junctions (Microsoft Learn)](https://learn.microsoft.com/en-us/windows/win32/fileio/hard-links-and-junctions) (accessed 24 October 2026)
- [mklink (Microsoft Learn)](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/mklink) (accessed 24 October 2026)
- [Create symbolic links, user right (Microsoft Learn)](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/security-policy-settings/create-symbolic-links) (accessed 24 October 2026)
- [Symlinks in Windows 10! (Windows Developer Blog, Developer Mode)](https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/) (accessed 24 October 2026)
- [Anthropic Consumer Terms of Service](https://www.anthropic.com/legal/consumer-terms) (accessed 24 October 2026)

## Frequently asked questions

**Where does Claude Code store its login on Windows?**

Anthropic's docs give %USERPROFILE%\.claude\.credentials.json, a file protected by your user profile's access controls. Set CLAUDE_CONFIG_DIR and Claude Code keeps .credentials.json in that folder instead, which is the whole trick behind two accounts.

**How do I set CLAUDE_CONFIG_DIR in PowerShell?**

$env:CLAUDE_CONFIG_DIR = "$HOME\.claude-work" followed by claude sets it for the current window only. To keep it, add a function per account to your PowerShell profile that sets the variable, runs claude @args and puts the old value back when Claude Code exits.

**Do Claude Code in WSL and on Windows share a login?**

No. WSL runs the Linux build of Claude Code, which keeps its login in ~/.claude/.credentials.json in the distro's home, while Windows uses %USERPROFILE%\.claude. You sign in once on each side, and once more in any other distro, because each distro has a home of its own.

**Can I share skills and CLAUDE.md between the two profiles on Windows?**

Yes, with links. Folders such as skills or agents can be junctions (mklink /J, or New-Item -ItemType Junction in PowerShell), and a junction needs no admin rights. CLAUDE.md is a single file, so it takes a symbolic link (Developer Mode or an administrator) or a copy in each folder, and .credentials.json is never linked.

**Why does my second profile still use the API key?**

An ANTHROPIC_API_KEY saved as a Windows user variable reaches every profile, and once you have approved it, Claude Code puts it ahead of the folder's login. Delete the variable, open a new terminal and run /status to see which account answers.

Source switching

One account runs dry. The next one takes over.

Add the Claude, Codex and Gemini accounts you own. At your switch point, your chats move to another of them and keep going.

[Download](https://shuriken.sh/download)

[Other platforms](https://shuriken.sh/download#main)

## Keep reading

- [Can you have multiple Claude accounts?: Guide 27 Oct 2026 8 min read Yes. Anthropic's terms set no cap on accounts per person, and its phone check allows three per number. Sharing a login and dodging a ban are not allowed.](https://shuriken.sh/guides/multiple-claude-accounts-rules)
- [Claude's 5-hour limit, explained: Guide 27 Oct 2026 6 min read Claude's 5-hour window starts with your first message and resets five hours later. An idle account has no window running, so it saves nothing up.](https://shuriken.sh/guides/claude-5-hour-limit-explained)
- [Claude usage limit reached? What to do next: Guide 27 Oct 2026 6 min read There's no early reset for Claude's 5-hour or weekly limit. Wait, pay for usage credits, switch to an API key, or carry on with another account you own.](https://shuriken.sh/guides/claude-limit-reached-what-to-do)
- [How to check your Claude Code usage: Guide 27 Oct 2026 6 min read To check Claude Code usage, type /usage or open Settings › Usage on claude.ai. Both read one pool: your 5-hour session and your weekly limit.](https://shuriken.sh/guides/check-claude-code-usage)
- [Codex usage limits explained (2026): Guide 27 Oct 2026 5 min read How Codex limits work on ChatGPT Plus and Pro: the 5-hour and weekly windows, the 2026 changes, checking yours with /status, and using several accounts.](https://shuriken.sh/guides/codex-usage-limits)

## Free tools

- [Claude limit reset tracker](https://shuriken.sh/tools/limit-resets/claude)
- [Codex limit reset tracker](https://shuriken.sh/tools/limit-resets/codex)
