A field tool for Claude Code
One account per terminal, switched with a keystroke
Personal in one terminal, work in another, a client in a third, all signed in at the same time. Switching takes one command. Your current login is already the defaultprofile, so there's nothing to set up.
$ ccenv list ● default johndoe@gmail.com max work me@company.com team client not signed in ● = active in this shell
The problem
Switching accounts meant logging out, which clobbers the one login you had.
Claude Code keeps one active login. Add a work account or a client and you're signing in and out all day, losing the session you were in. ccenv makes accounts concurrent, not just switchable: every terminal stays on its own account, with no interference.
What it does
Two terminals. Two live accounts. Zero clobbering.
A · Per-shell isolation
Each terminal is its own account.
use changes only the current shell. run scopes a single session and leaves the shell untouched after.
Each profile keeps its own credential-store entry. Sessions running side by side never touch each other's tokens.
B · Credential handling
Tokens stay in the OS keychain.
ccenv doesn't store secrets. Tokens live in macOS Keychain (or a per-profile credentials file on Linux and Windows), managed by Claude Code through claude auth.
~/.ccenv is 0700, config copies are 0600. Nothing phones home, nothing lands in a flat file.
$ ccenv use work $ claude # runs as work
$ ccenv use default $ claude # runs as personal
$ ccenv run client \ -- -p "summarize this repo" # shell untouched
How it works
One config dir per account. That's the whole trick.
- i
Each profile gets its own config directory; ccenv points Claude Code at it through the CLAUDE_CONFIG_DIR environment variable.
- ii
Because Claude Code keys credentials by config dir, two terminals on two profiles are two fully live accounts, with no clobbering.
- iii
Your plugins, skills, commands, hooks and CLAUDE.md are symlinked into every profile; mutable config is copied so concurrent accounts never race.
- iv
Your existing ~/.claude is the default profile. There's nothing to migrate.
Reference
A small CLI you'll remember.
| ccenv use <name> | Rebind the current shell to an account (needs shell integration). |
| ccenv default [name] | Auto-use an account in every new shell; --clear resets it. |
| ccenv pin <name> [dir] | Attach an account to a folder; terminals there auto-use it (default: cwd). |
| ccenv unpin [dir] | Remove a folder pin (defaults to the current directory). |
| ccenv pins | List every directory pin; flags stale ones. |
| ccenv run <name> | Launch a one-off session on an account. |
| ccenv list | Show every profile; ● marks the active shell. |
| ccenv current | Print the account this shell is on. |
| ccenv create <name> | Make a new profile; it inherits your setup. |
| ccenv login <name> | Sign a profile in via claude auth. |
| ccenv sync <name> | Re-copy settings.json / mcp_config.json and re-link any missing shared assets. |
| ccenv doctor | Health-check the CLI, credential store and integration. |
| ccenv rename <a> <b> | Rename a profile (guarded). |
| ccenv remove <name> | Delete a profile (guarded; refuses default). |
| ccenv update | Fetch the latest build from ccenv.dev and swap it in. |
| ccenv uninstall | Remove ccenv itself; --purge also deletes every profile. |
use and unuse run through the shell integration the installer adds to your rc; open a new terminal (or re-source it) once after installing. ccenv help full prints the complete reference, including create options like --isolated and --no-login.
Claude Desktop · macOS
The same idea for the desktop app. Bundled, nothing extra to install.
ccdesktop runs multiple Claude Desktop accounts at once, each in its own window. The desktop app has no CLAUDE_CONFIG_DIR, so every account gets its own Chromium --user-data-dir: a separate login and a separate MCP config, running side by side. It installs with ccenv on macOS and rides the same ccenv update.
A · A window per account
Two accounts, two windows.
ccdesktop open work launches a second instance with its own session; your everyday app keeps running untouched as default.
B · No secrets stored
The login stays in the app.
ccdesktop holds no tokens. The session lives inside the profile directory, encrypted by the app's own macOS Keychain key. Removing a profile never signs you out elsewhere.
$ ccdesktop list ● work running personal stopped $ ccdesktop open personal # opens its own window, signed in separately
| ccdesktop open <name> | Launch the Claude Desktop app as an account — its own window and session. |
| ccdesktop create <name> | Make a profile and launch it to sign in; --isolated skips seeding. |
| ccdesktop list | Every profile; ● marks the ones running right now. |
| ccdesktop running | Show running profiles with their process ids. |
| ccdesktop stop <name> | Quit one profile's instance (never touches the base app). |
| ccdesktop remove <name> | Delete a profile (guarded; refuses the default app). |
| ccdesktop doctor | Health-check the app, base dir and running profiles. |
macOS only, bundled with ccenv — nothing extra to install, and ccenv update keeps it current. ccdesktop help prints the full reference.
Security
It holds none of your secrets.
Stores zero secrets
Auth is delegated entirely to claude auth. Tokens stay in the OS credential store; ccenv never reads, writes or holds them.
Guarded removal
A profile path must be a real directory under $HOME, with no .. and no symlinks, before anything is deleted. default is never removable.
Injection-safe setup
Shell-rc edits are upserted atomically and profile names are restricted. Implementation: rc lines are built with printf %q; new dirs are created 0700, files 0600.
Tells you what's wrong
doctor checks the claude CLI, the credential store, shell integration, per-profile sign-in and broken links.
Install
One line. Done.
Your current login becomes the default profile automatically. Create a second profile, open another terminal, and both accounts run side by side.
$ curl -fsSL https://ccenv.dev/install.sh | bashNo clone, no build step. Needs Claude Code and curl on your PATH. macOS, Linux, Windows via Git Bash or WSL. Per-user, no sudo; re-run any time to update.