Conversation
When using ccbox with multiple accounts (e.g. one on Vertex AI, one on
Anthropic), a single shared ~/.claude directory blends credentials,
session history, and /usage statistics across accounts.
The new --profile <name> flag stores account-specific state under
~/.claude-profiles/<name>/ instead: .credentials.json, .claude.json,
statsig/, stats-cache.json, caches, and the per-project data that
/usage reads (session transcripts, history). Customizations (settings,
keybindings, CLAUDE.md, hooks, commands, skills, agents, rules, themes,
workflows) remain shared across profiles.
Container names include the profile (ccbox-{project}-{hash}-{profile}-
{session-id}) so concurrent sessions from different profiles are
distinguishable; --list-sessions still matches all of them. Without
--profile, behavior is unchanged.
---
Signed-off-by: Guillaume Moutier <guimou@users.noreply.github.com>
Co-authored-by: Claude <claude@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When using ccbox with multiple accounts (e.g. one on Vertex AI, one on Anthropic), a single shared
~/.claudedirectory blends credentials, session history, and/usagestatistics across accounts —/usageis computed locally from session transcripts and the stats cache, so both accounts accumulate into one pool.This PR adds a
--profile <name>flag that keeps each account fully separate:~/.claude-profiles/<name>/):.credentials.json,.claude.json,statsig/,stats-cache.json, caches (file-history,paste-cache,cache,backups), and per-project data (ccbox-projects/— session transcripts, history, todos, plans, tasks, plugins). This is everything/usagereads, so each profile gets independent usage statistics.~/.claude): settings, keybindings, CLAUDE.md, hooks, commands, skills, agents, rules, themes, workflows — no duplication of customizations, no symlinks needed since ccbox mounts item-by-item.Details
ccbox-{project}-{hash}-{profile}-{session-id}, so--list-sessions(unchanged, prefix-based) shows which profile each session belongs to./loginor use provider env vars) and re-runs first-time onboarding once, since its.claude.jsonstarts empty.ensure_global_configis split into shared vs account-specific (ensure_account_config) halves; without--profileboth run against~/.claude, producing identical behavior to before.Testing
podmanand isolated$HOME:--profile vertex: profile tree created, all account-specific mounts sourced from~/.claude-profiles/vertex/, container name includes the profile.podman runmounts identical to current behavior.--profile "Bad Name") rejected with a clear error.--list-sessionsstill works and matches profile-suffixed containers.