diff --git a/CHANGELOG.md b/CHANGELOG.md index d81a78d..b31eeaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to CCM (Claude Code Manager) will be documented in this file. +## [Unreleased] +### Fixed +- Statusline account line showed the globally-active account instead of the profile actually in use when a session ran inside an isolated profile (`ccm switch --isolated`). It read `oauthAccount.emailAddress` from `~/.claude/.claude.json` (or `~/.claude.json`) unconditionally, ignoring `CLAUDE_CONFIG_DIR`. It now prefers `$CLAUDE_CONFIG_DIR/.claude.json` when that variable is set, falling back to the global config otherwise. + ## [4.2.0] - 2026-04-25 ### Added - Statusline now shows the active model (display name) on its own line above the context bar. diff --git a/ccm.sh b/ccm.sh index 2d1be07..b6abd81 100755 --- a/ccm.sh +++ b/ccm.sh @@ -6573,8 +6573,17 @@ fi # ── CCM account data (direct file read + env var fallback) ── SEQ="$HOME/.claude-switch-backup/sequence.json" -CONF="$HOME/.claude/.claude.json" -[[ -f "$CONF" ]] || CONF="$HOME/.claude.json" +# Resolve the config file for the ACTIVE session. When running in an isolated +# profile, CLAUDE_CONFIG_DIR points at that profile's dir, whose .claude.json +# holds the real active account. Prefer it so the statusline reflects the +# profile in use rather than whatever account is globally active. +if [[ -n "$CLAUDE_CONFIG_DIR" ]] && [[ -f "$CLAUDE_CONFIG_DIR/.claude.json" ]]; then + CONF="$CLAUDE_CONFIG_DIR/.claude.json" +elif [[ -f "$HOME/.claude/.claude.json" ]]; then + CONF="$HOME/.claude/.claude.json" +else + CONF="$HOME/.claude.json" +fi ALIAS="" EMAIL_SHORT="" HEALTH="" TOTAL_ACCTS=0 if [[ -f "$SEQ" ]] && [[ -f "$CONF" ]]; then