Support multiple Claude profiles and CLAUDE_CONFIG_DIR - #34
Open
mhmzdev wants to merge 2 commits into
Open
Conversation
Install and uninstall now detect all ~/.claude* directories and operate on each one, so users with multiple profiles (e.g. .claude-work, .claude-personal) get the statusline everywhere without a manual re-run per profile. The statusline config command and the shell script itself now resolve the config directory via CLAUDE_CONFIG_DIR when set, falling back to ~/.claude — matching how Claude Code itself resolves its config path. This fixes credentials and settings lookups for non-default profiles.
Support multiple Claude profiles and CLAUDE_CONFIG_DIR
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.
Problem
Users running multiple Claude Code profiles (e.g.
.claude-work,.claude-personal, or a custom path viaCLAUDE_CONFIG_DIR) hit two issues:~/.claude— runninginstalloruninstallwith a non-default profile left that profile without the statusline, or left stale files behind.$HOME/.claude— on a non-default profile the script read the wrongsettings.json(wrong effort level), looked up credentials in the wrong place, and the injectedstatusLine.commandinsettings.jsonpointed to a path the active profile never executed.What changed
install.jsfindClaudeDirs()— discovers every~/.claude*directory under$HOME, or respectsCLAUDE_CONFIG_DIRwhen set, mirroring how Claude Code itself locates its config.run()(install) anduninstall()now loop over all discovered directories, so every profile gets the statusline installed/removed in one shot.statusLine.commandnow uses${CLAUDE_CONFIG_DIR:-$HOME/.claude}so each profile's Claude process resolves the correct script at runtime.statusline.shclaude_dirviaCLAUDE_CONFIG_DIRwith~/.claudefallback at the top of the relevant section.settings.json(effort level) and.credentials.json(OAuth token fallback) are now read from$claude_dirinstead of the hardcoded$HOME/.claudepath.Known issue
Tracked in #35 — the statusline doesn't refresh automatically on first load for a new profile and requires typing
/statusonce to trigger the initial render.