Aident AI

How to Use Work and Personal Claude Code Accounts Safely
The safest way to use separate work and personal Claude Code accounts on one computer is to launch Claude Code with a different CLAUDE_CONFIG_DIR for each account, then authenticate each clean profile through Claude Code's official /login flow. Anthropic documents that this variable moves the complete user configuration root, including credentials, settings, session history, and plugins.
Do not copy OAuth tokens between profiles or install an account switcher that stores raw credentials for you. A clean profile plus official login gives each account its own state without turning credential files into a shared secret.
What This Setup Separates
A Claude Code profile contains more than a login:
Authentication state
User settings and permissions
Session history
Plugins, skills, commands, hooks, and memory
Project-level files under a repository's .claude/ directory remain tied to that project. That is useful for reviewed team configuration, but it also means a work repository can still supply instructions or hooks when opened from a personal profile. Profile separation controls user state. It does not replace repository review, Git identity checks, or your employer's data policy.
This guide is for legitimate personal and organization accounts. It is not a way to evade usage limits, billing rules, or account policies.
Prerequisites
You need:
A current Claude Code installation.
Authorized access to the personal and work accounts you intend to use.
A shell profile you can edit.
A plan for which repositories may be opened with each account.
Before changing anything, see whether another credential source can override interactive login. On macOS or Linux, print names only so secret values do not reach your terminal history:
On PowerShell:
Expected result: no unexpected API key, OAuth token, or cloud-provider override. If one appears, find where it is set before relying on /login. Anthropic warns that an ANTHROPIC_API_KEY can silently take precedence over subscription login.
Step 1: Create Two Empty Profile Directories
On macOS or Linux:
Expected result:
Both directories exist and are accessible only to your user. Keep them empty for the first login. Do not copy ~/.claude wholesale, because that would also copy credentials, history, and potentially unreviewed plugins.
On Windows, Claude Code stores the default profile beneath %USERPROFILE%\.claude. The commands below create alternative roots automatically when they first run.
Step 2: Add Explicit Launchers
For zsh, add these aliases to ~/.zshrc. For bash, add them to ~/.bashrc:
Reload the file:
Use source "$HOME/.bashrc" on bash. Expected result: type reports two aliases with different absolute profile directories.
For PowerShell, put one shared helper and two small launchers in your $PROFILE:
Reload the profile and verify the commands:
The helper keeps the directory contract in one place and restores the calling shell's prior value after Claude Code exits.
Step 3: Authenticate Each Profile Through /login
Start the personal profile:
Inside Claude Code:
Run
/login.Choose the Claude account with subscription option.
Authorize the personal account.
Run
/status.Confirm the displayed account or organization, then exit.
Repeat for work:
Choose the authorized Team or Enterprise organization and verify it with /status.
If your personal and organization workspaces share one email address, Anthropic also supports switching between them from the Claude account menu. The separate configuration roots remain useful for terminal sessions because they keep the local credentials, history, settings, and plugins from collapsing back into one profile.
Step 4: Prove the Profiles Are Actually Separate
Run each launcher and check /status. The account or organization must match the launcher name.
Then inspect only the top-level file names:
Expected result: two independently populated directories. Do not diff or print credential contents.
Create a harmless test session in each profile, exit, then use Claude Code's session picker from the matching launcher. A personal session should not appear in the work profile, and a work session should not appear in the personal profile.
That check matters because a launcher can look correct while a parent environment, wrapper, or copied credential file still points both commands at the same state.
Step 5: Decide What Should Be Shared
Keep account-specific material inside its profile:
Credentials and subscription state
Personal session history
User-level plugins and hooks
User-level settings that expose local paths or services
Share only reviewed project configuration through the repository's .claude/ directory. Anthropic documents that project files can define team instructions, settings, skills, commands, and hooks. Treat executable hooks and plugin configuration like code.
If both profiles need the same harmless setting, reproduce the small setting intentionally. Do not solve configuration drift by symlinking entire profile directories, because that defeats the isolation boundary.
Step 6: Keep Provider Credentials Outside Both Profiles
Claude account separation does not protect GitHub, Slack, database, deployment, or billing tokens that you paste into prompts, shell profiles, or MCP configuration.
Aident Loadout keeps connected provider credentials in Vault and exposes task-scoped Actions instead of raw keys. Install or update the public aident CLI once, then verify the broker independently of either Claude profile:
Copy one exact read-only Action name from search, inspect its schema, and preflight a narrow input:
Expected result: both Claude profiles can request the same brokered capability without a provider token being copied into either Claude configuration directory. For the broader pattern, see How to Give AI Agents API Access Without Exposing Keys.
Common Failure Modes
What you see | Likely cause | Fix |
|---|---|---|
Both launchers show the same account | The two launchers resolve to the same directory, or credentials were copied | Check |
| An API key, OAuth token, or cloud-provider environment variable takes precedence | List variable names without printing values, remove the unintended override from its source, restart the shell, and log in again |
Work plugins or history are missing |
| Add only the reviewed settings or plugins that the work profile needs |
Personal history appears in work | The same configuration root is being reused | Exit immediately, inspect the launcher definitions, and verify that the two directories are distinct |
A repository changes Claude behavior in both profiles | Project-level | Review the repository configuration and hooks before opening it with either account |
Git commits use the wrong email | Git identity is independent of Claude account selection | Check |
Why This Works
CLAUDE_CONFIG_DIR changes the root Claude Code uses for credentials, settings, history, and plugins. Starting each directory empty and authenticating through /login creates two independent local identities. /status verifies the effective remote account, while directory inspection verifies the local boundary.
The setup stays safe because it does not move raw tokens between profiles. Project configuration is shared only where you can review it, and external provider access can remain behind a credential broker.
Ready to verify the full boundary? Set up Aident Loadout, preflight one read-only Action, and confirm that neither Claude profile contains the provider token.
Sources
Environment variables, Anthropic, accessed August 1, 2026
Explore the
.claudedirectory, Anthropic, accessed August 1, 2026Use Claude Code with your Team or Enterprise plan, Anthropic, updated June 11, 2026
Move your personal Claude account to a Team or Enterprise organization, Anthropic, accessed August 1, 2026
Claude Code user FAQ, Anthropic, accessed August 1, 2026
Switching between personal and work Claude Code accounts is abysmal, GitHub issue, February 3, 2026
Show HN: claude-account, Hacker News, July 30, 2026
Cómo usar 2 cuentas de Claude Code en el MISMO PC, YouTube, July 30, 2026
Switching between work and personal Claude Code just got painless, X, July 31, 2026


