Claude Code Work and Personal Accounts
Save your work and personal Claude Code accounts as two named aisw profiles, claude work and claude personal, switch with aisw use claude <name> before starting Claude Code, and bind work repositories to a work context so aisw warns or blocks when the personal account is active. Both accounts stay saved locally, so switching usually avoids signing in again; provider storage limitations can still require the native sign-in flow.
If you use Claude Code for both a day job and personal projects on the same computer, the accounts usually need to stay separate: different billing, different organization, sometimes a different usage policy. Logging out and back in with /login every time you change repository is slow and easy to get wrong. aisw saves both accounts as named profiles, so the boundary is the profile you select, the process that picks it up, and a repository rule that checks the choice.
aisw doesn’t create Claude accounts or proxy requests. It stores each profile locally and applies the state Claude Code expects when you select it.
Before you start
You’ll need Claude Code signed into at least one of the two accounts already, so aisw can capture it live instead of running a fresh sign-in.
CLI method
1. Capture the account you’re currently signed into.
aisw initIf Claude Code is signed in, init shows the live credentials it found and asks Import these credentials into aisw? [Y/n], then Profile name [default]:. Type work (or personal) at that prompt. Pressing Enter keeps the name default, and aisw init --yes always uses default. If the import ended up as default, rename it rather than importing again:
aisw rename claude default workIf you skipped the import, or you already ran init on this machine and just need to add the account you’re signed into now, capture it explicitly:
aisw add claude work --from-live2. Add the second account.
aisw add claude personalThis runs Claude Code’s sign-in for the second account and continues in your browser. Sign in with the other account there. If you’d rather use an API key for one of them:
aisw add claude personal --api-key "$ANTHROPIC_API_KEY"Check that both are saved:
aisw list claudeClaude Code ○ personal [api-key] ○ work [api-key]3. Switch before you start a session.
Select the account that matches the repository, confirm it, then start Claude Code:
aisw use claude workaisw status --tool claudeclaudeLater, for personal work:
aisw use claude personalclaudeSwitching affects the next Claude Code process, not one that’s already running. If Claude Code still shows the previous account, exit it and start claude again from a fresh terminal. The same applies to the VS Code integrated terminal.
4. Local state is separated by default; sharing it is the opt-in.
aisw’s default state mode is isolated: activating a profile points Claude Code at that profile’s own config directory, so history, settings, and extensions stay separate. That’s usually what you want for a work and personal split. The shell hook from aisw init is what applies the isolated directory to the shell you launch claude from.
If you’d rather the two accounts share local configuration and only swap credentials, opt into shared mode instead:
aisw use claude work --state-mode sharedSome Claude Code installs on macOS keep OAuth credentials in a single shared Keychain entry rather than one per config directory. aisw detects that and tells you shared mode is the supported path for that profile; take its advice rather than forcing isolated mode.
Bind work repositories to the work account
Switching by hand works until the day you forget. A workspace binding gives Claude Code a second check: the repository names the context it expects, and the shell hook compares it with the active profile before claude starts.
aisw context create work --claude workcd ~/src/company-appaisw workspace bind . --context workaisw workspace guard --mode warnThe binding is written to .git/info/aisw.json, so it is never committed. With the personal profile active, launching claude in that repository prints:
Workspace guard warning: expected context 'work', current state 'claude personal, codex none, gemini none, agy none' (mismatch). Run 'aisw context use work' before launching Claude Code.Warn mode lets the launch continue, which is useful while you check your bindings. Once they’re right, switch to strict mode for work and client repositories that should never run under a personal account:
aisw workspace guard --mode strictError: workspace guard refused to launch Claude Code. Expected context: 'work' Current state: 'claude personal, codex none, gemini none, agy none' Status: mismatch Run 'aisw context use work'.Run aisw context use work, then claude starts normally. The check only runs when the shell hook is installed. For binding by Git remote or a whole folder of repositories, see one Claude Code account per repository.
Windows and VS Code
The workflow is the same on Windows. Run the commands in PowerShell or the VS Code integrated terminal, then start a new Claude Code process. To keep aisw’s copy of each profile’s credentials in Windows Credential Manager instead of files, add them with the system keyring backend:
aisw add claude work --credential-backend system-keyringaisw add claude personal --credential-backend system-keyringaisw use claude workaisw verify--credential-backend controls where aisw stores the profile, not how Claude Code itself stores its live sign-in. For Windows-specific shell hook and credential-store details, read Claude Code accounts on Windows; for the editor side, see switching Claude Code accounts in VS Code.
Desktop method
The current public AI Switcher Desktop release covers macOS, Windows x64, and Linux x64. Download the matching build, then follow the same profile workflow below.

- Open Profiles and find the Claude Code section.
- Add both accounts, import the live one first, then add the second through Add Profile → Sign in.
- Rename each profile from the inspector so they’re clearly labeled (
work,personal). - Switch from Overview or Quick Switch (⌘K) whenever you change context.
Verify the result
Before a work session, check what’s active and whether the live state matches it:
aisw status --contextaisw verifystatus --context shows which Claude Code profile is active and which context it matches. verify compares aisw’s recorded profile with the live state Claude Code will read and prints the fix command when they disagree. If the old account is still active after a switch, follow Claude Code switch account not working.
Frequently asked questions
Can I use a work and a personal Claude Code account on one computer?
Yes. Save each account as a named aisw profile, select the right one with aisw use claude <name> before you start Claude Code, and bind work repositories to a work context so a mismatch is caught before launch.
Do I need two Claude Code installs to keep work and personal separate?
No. One Claude Code install is enough. aisw swaps the credentials and config directory it reads, so a single installation can represent as many accounts as you have profiles.
Does switching change a Claude Code session that's already running?
No. aisw use changes what the next Claude Code process reads. A session that is already open keeps the account it started with, so exit it and start claude again after switching.
How do I stop Claude Code starting with my personal account in a work repository?
Create a work context, bind the repository to it with aisw workspace bind . --context work, and install the shell hook. In warn mode aisw prints a warning before claude launches; in strict mode it refuses to launch and tells you to run aisw context use work.
What if my work and personal accounts use different plans?
That's fine. aisw stores whatever credentials each account actually has; it doesn't require matching plan types, and Claude Code behaves exactly as it would if you'd logged in with that account directly.