You have two Claude subscriptions. Claude Code has one login.
Log in for work, and your side project bills the company. Log in for yourself, and the work repo runs on a personal account. Switching means logging out, logging back in, and remembering which one you are on — every time you change directory.
cprof makes the directory decide.
Each profile is its own Claude config directory with its own credentials, so the accounts never touch. A default covers most of your work, a directory rule routes a whole tree, and a per-repository pin overrides both.
$ cprof list
PROFILE PLAN ACCOUNT 5H 7D FLAGS
work team you@acme.com ▓▓▓▓░░░░░░ 42% ▓▓░░░░░░░░ 18% native
personal max you@personal.dev ▓▓▓▓▓▓▓▓▓░ 91% ▓▓▓▓▓▓░░░░ 60% (default) (active)
$ cd ~/dev/acme/api && cprof which
work native (keychain) rule ~/dev/acmebrew install dcotelo/tap/cprofOr without Homebrew — no sudo, installs to ~/.local, needs jq on PATH.
Download the installer, read it, then run it:
curl -fsSLO https://raw.githubusercontent.com/dcotelo/cprof/main/install.sh && less install.shthen, once it reads right:
bash install.shThen one line in your shell config, and you are done:
claude() { eval "$(cprof env)"; command claude "$@"; }The Claude Code plugin is optional and adds the ambient parts — a warning when
you walk into a directory expecting a different account, /profile, and the
statusline — the account, the model, the directory and its branch, and bars
for the context window and the usage window:
claude plugin marketplace add dcotelo/cprof
claude plugin install cprof@dcoteloQuickstart walks the whole setup — profiles, rules, default —
in about two minutes. Requires macOS; Homebrew pulls in jq, and usage data
needs curl, which macOS ships. Install details covers
the plugin-only path and updating.
- Nothing is moved, nothing is re-authenticated. Your existing login stays
exactly where it is, as a
nativeprofile. Addingcprofto a working setup changes nothing about that setup. - Your customisations follow you. A Claude config directory holds plugins,
skills, settings and
CLAUDE.mdas well as credentials — so a naive profile switch would silently switch away everything you have installed.cproflinks them, and never links the files that identify you. - It cannot lose your account.
loginsnapshots the keychain first and restores it if a profile login writes to the shared item.envnever exits non-zero, so a broken config degrades to stock Claude Code rather than a broken shell. - You can see it at a glance. Every profile has a colour, hashed from its name so two profiles differ with no configuration at all — and you can pick your own:
Docs · Routing · Install details · Commands · Statusline · Usage and fallback · Safety
Five steps, about two minutes. Needs macOS.
# 1. install the CLI (jq comes with it), and the plugin for the ambient parts
brew install dcotelo/tap/cprof
claude plugin marketplace add dcotelo/cprof
claude plugin install cprof@dcotelo
# 2. route `claude` through it
cat >> ~/.zshrc <<'RC'
claude() { eval "$(cprof env)"; command claude "$@"; }
RC
exec zsh
# 3. keep the account you already use, then add a second one
cprof add work --native # adopts your current keychain login
cprof add personal # ~/.claude-profiles/personal, sharing
# your plugins, skills and settings
cprof login personal # interactive, opens a browser
# 4. choose the default profile, and route one tree to the other
cprof default personal
cprof rule add ~/dev/<company> work
# 5. confirm
cprof list
cprof which$ cprof list
PROFILE PLAN ACCOUNT 5H 7D FLAGS
work team you@<company>.com ▓▓▓▓░░░░░░ 42% ▓▓░░░░░░░░ 18% native
personal max you@personal.dev ▓▓▓▓▓▓▓▓▓░ 91% ▓▓▓▓▓▓░░░░ 60% (default) (active)
$ cd ~/dev/<company>/api && cprof which
work native (keychain) rule ~/dev/<company>That is the whole setup. From here claude picks the account for you; the only
rule to remember is that a change takes effect on the next claude launch,
never in a running session, because credentials are read at process start.
Nothing was moved or re-signed-in along the way: --native adopts your existing
login where it already lives, and step 3's login writes only inside the new
profile's own directory.
Two accounts means two rate limits, and the one you are about to hit is rarely
the one you are looking at. cprof list carries each profile's 5-hour and 7-day
windows as a bar; cprof usage <name> adds the per-model weekly limits and when
each window resets.
A profile that runs out can hand the session to a fallback account instead of stopping.
One line inside the session: the account, the model, the directory and its branch, then bars for the context window and the usage window.
Which segments appear, how they are laid out, the bar glyphs and width, the
warning thresholds and every colour are configurable — and cprof doctor names
any setting it rejects rather than failing quietly. See
Statusline.
| Doc | What is in it |
|---|---|
| Routing | How a directory decides the account: defaults, rules, repository pins, resolution order, importing a directory you already use |
| Install details | The plugin-only path, what the installer writes, updating, uninstalling |
| Commands | Every subcommand and what it does |
| Statusline | Segments, layout, bars, thresholds, the colour palette, and what cprof doctor reports |
| Usage and fallback | Usage headroom, the 5-hour and 7-day windows, and fallback accounts |
| Safety | Keychain snapshots, what cprof never touches, and the security assessment |
| Contributing | Development setup, conventions, dependency policy, releasing |
Found a bug? Open an issue — templates are provided. Security problems go through private vulnerability reporting instead; see SECURITY.md. Contributions: CONTRIBUTING.md.
MIT — see LICENSE.
Maintained by @dcotelo · dcotelo.dev


