How to Use Multiple Claude Code Accounts on Windows
On Windows, install aisw with Cargo or the release .exe, load its PowerShell hook from the $PROFILE your terminal actually reads, and save each Claude Code login as a named profile. Claude Code keeps its login in .credentials.json on Windows, so isolated per-profile switching works without the Keychain caveats macOS has.
The profile model is the same on every platform, and how to switch Claude Code accounts covers it step by step. This page is only about what is different on Windows: how to install aisw without Homebrew, which PowerShell profile file the hook goes in, where Claude Code's login lives, and what Windows Credential Manager does and does not change.
Install aisw on Windows
There is no Homebrew, winget or Scoop package for aisw on Windows. Use one of the two paths that exist. With a Rust toolchain installed, Cargo builds it and puts aisw.exe in %USERPROFILE%\.cargo\bin:
cargo install aisw
aisw --versionWithout Rust, download aisw-x86_64-pc-windows-msvc.exe and its .sha256 file from the aisw download page. Compare the hashes, rename the binary to aisw.exe so the shell hook can find it by name, and put it on your user PATH:
(Get-FileHash .\aisw-x86_64-pc-windows-msvc.exe -Algorithm SHA256).Hash
Get-Content .\aisw-x86_64-pc-windows-msvc.exe.sha256
New-Item -ItemType Directory -Force "$HOME\bin"
Move-Item .\aisw-x86_64-pc-windows-msvc.exe "$HOME\bin\aisw.exe"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$HOME\bin", "User")Open a new terminal after changing PATH. aisw keeps its own store in %USERPROFILE%\.aisw unless AISW_HOME points somewhere else.
Put the PowerShell hook in the right $PROFILE
aisw init recognises PowerShell (it checks PSModulePath when SHELL is not set, and treats powershell.exe as pwsh) and offers to append the hook to %USERPROFILE%\Documents\PowerShell\Microsoft.PowerShell_profile.ps1. That is the PowerShell 7 profile. Windows PowerShell 5.1 reads a different file under Documents\WindowsPowerShell, and a Documents folder redirected to OneDrive moves both. Ask the shell you will actually use:
$PROFILE
Test-Path $PROFILEIf that path is not the one aisw init wrote to, add the hook yourself, reload, and confirm it is active:
New-Item -ItemType File -Force $PROFILE
Add-Content $PROFILE "`naisw shell-hook pwsh | Out-String | Invoke-Expression"
. $PROFILE
$env:AISW_SHELL_HOOKThe last line should print 1. Only run New-Item when Test-Path returned False; with -Force it replaces an existing profile. If PowerShell refuses to load the profile with "running scripts is disabled on this system", the execution policy is blocking it; Set-ExecutionPolicy -Scope CurrentUser RemoteSigned allows local scripts for your account only. aisw doctor also reports whether the hook is installed.
The hook sets $env:AISW_SHELL = 'pwsh' and defines three things: an aisw function that evaluates --emit-env output for aisw use and aisw context use, a claude function that runs aisw workspace check --tool claude before starting the real claude, and a wrapped prompt that checks the workspace binding when you change directory. That last part is how a repository bound to a Claude Code account warns you in PowerShell the same way it does in zsh.
Switch accounts in PowerShell
With the hook loaded, the switch is the same command as anywhere else:
aisw use claude work --state-mode isolated
aisw status --tool claude
aisw verify
claudeMost guides show the hook-less form as eval "$(aisw use ... --emit-env)", which is POSIX shell and fails in PowerShell. Without the hook, --emit-env also prints POSIX lines such as unset CLAUDE_CONFIG_DIR. Set AISW_SHELL first and pipe the output to Invoke-Expression, then run the switch itself, which is what the hook does for you:
$env:AISW_SHELL = 'pwsh'
aisw use claude work --state-mode isolated --emit-env | Out-String | Invoke-Expression
aisw use claude work --state-mode isolatedIn PowerShell mode a shared-mode switch prints Remove-Item Env:CLAUDE_CONFIG_DIR -ErrorAction SilentlyContinue, and an isolated switch prints a $env:CLAUDE_CONFIG_DIR = '...' assignment pointing at %USERPROFILE%\.aisw\profiles\claude\work.
Paths with spaces and apostrophes
Windows user folders often contain spaces, and sometimes an apostrophe. aisw wraps every value it emits for PowerShell in single quotes and doubles any embedded single quote, so a profile under C:\Users\Jane O'Brien comes out as 'C:\Users\Jane O''Brien\.aisw\profiles\claude\work' and survives Invoke-Expression. Quote your own paths the same way: single quotes for literal paths, double quotes only when you need $HOME or $env: expanded.
$env:AISW_HOME = 'D:\Dev Tools\aisw'
Set-Location 'C:\Users\Jane Doe\src\client-app'
aisw workspace bind . --context workSetting AISW_HOME this way lasts for the current session only; put the line in $PROFILE above the hook line if you want it every time.
Where Claude Code keeps credentials on Windows
This is the biggest difference from macOS. On a Mac, Claude Code can keep its OAuth login in the macOS Keychain, and some installs use one shared Keychain entry that CLAUDE_CONFIG_DIR cannot separate. On Windows, Claude Code reads a file:
| What | Windows location |
|---|---|
| Live login | %USERPROFILE%\.claude\.credentials.json |
Live login with CLAUDE_CONFIG_DIR set | $env:CLAUDE_CONFIG_DIR\.credentials.json |
| Account name and organisation | %USERPROFILE%\.claude.json (oauthAccount) |
| aisw profiles | %USERPROFILE%\.aisw\profiles\claude\<name> |
Because the credential file follows CLAUDE_CONFIG_DIR, isolated mode is durable for OAuth logins on Windows, including Pro and Max sign-ins. When you run aisw add claude personal, aisw starts claude auth login with CLAUDE_CONFIG_DIR set to the new profile's folder, so the second login never overwrites the first. You will not see the Keychain prompt or the "shared Keychain" warning that macOS users get. To check what is live from PowerShell:
$env:CLAUDE_CONFIG_DIR
Test-Path "$HOME\.claude\.credentials.json"
aisw status --tool claudeCredential backends: file or Windows Credential Manager
--credential-backend decides where aisw keeps its saved copy of each profile. On Windows, system-keyring means Windows Credential Manager and file means a file under %USERPROFILE%\.aisw\profiles. It does not change Claude Code: on aisw use, the selected credentials are still written to the .credentials.json Claude Code reads.
The defaults differ by how you add the profile:
aisw add claude personal(a fresh login) stores the profile in Credential Manager when it is usable, and in a file otherwise.aisw add claude work --from-livecaptures the existing file login and stores it as a file.--api-keyprofiles default tofile.
On macOS and Linux, aisw restricts file-backed profiles to mode 0600. That step does not exist on Windows; a file-backed profile is protected only by the permissions on your user folder. If you want every Claude profile in Credential Manager, say so explicitly:
aisw add claude work --from-live --credential-backend system-keyring
aisw add claude personal --credential-backend system-keyring
aisw list claudeThe Backend line in aisw status --tool claude shows which store the active profile uses. The security page covers what aisw stores and where.
Switching in the VS Code terminal on Windows
VS Code on Windows can open Windows PowerShell 5.1, PowerShell 7, Command Prompt or Git Bash, and the PowerShell ones each read their own $PROFILE. If switching works in Windows Terminal but not in VS Code, check the integrated terminal itself:
$PSVersionTable.PSVersion
$PROFILE
$env:AISW_SHELL_HOOKAn empty AISW_SHELL_HOOK means this terminal never loaded the hook. Add the hook to the path it printed, or pick PowerShell 7 with Terminal: Select Default Profile. Command Prompt has no aisw hook; use it only with aisw use in shared mode, where no environment variable needs setting.
A Claude Code process that is already running keeps the environment it started with. After switching, close that terminal tab, open a new one, verify, and start claude again. The aisw VS Code and Cursor extension does not target Windows yet, so on Windows the integrated terminal (or AI Switcher Desktop) is the way to switch. For the editor-side workflow that applies on every platform, read switching Claude Code accounts in VS Code.
If the old account is still active
Run aisw verify in the same terminal that will start Claude Code. On Windows the usual causes are a terminal that did not load the hook (so CLAUDE_CONFIG_DIR was never set), a claude process started before the switch, or a CLAUDE_CONFIG_DIR left in your user environment variables that overrides the profile. [Environment]::GetEnvironmentVariable("CLAUDE_CONFIG_DIR", "User") shows the last one. The general checklist is in Claude Code switch account not working.
Keep Windows account switching deliberate
Use the CLI from PowerShell, or see the active profile at a glance in AI Switcher Desktop for Windows.