Skip to content

Support multiple Claude profiles and CLAUDE_CONFIG_DIR - #34

Open
mhmzdev wants to merge 2 commits into
nilbuild:mainfrom
mhmzdev:main
Open

Support multiple Claude profiles and CLAUDE_CONFIG_DIR#34
mhmzdev wants to merge 2 commits into
nilbuild:mainfrom
mhmzdev:main

Conversation

@mhmzdev

@mhmzdev mhmzdev commented Apr 29, 2026

Copy link
Copy Markdown

Problem

Users running multiple Claude Code profiles (e.g. .claude-work, .claude-personal, or a custom path via CLAUDE_CONFIG_DIR) hit two issues:

  1. Installer only targeted ~/.claude — running install or uninstall with a non-default profile left that profile without the statusline, or left stale files behind.
  2. The statusline script hardcoded $HOME/.claude — on a non-default profile the script read the wrong settings.json (wrong effort level), looked up credentials in the wrong place, and the injected statusLine.command in settings.json pointed to a path the active profile never executed.

What changed

install.js

  • Added findClaudeDirs() — discovers every ~/.claude* directory under $HOME, or respects CLAUDE_CONFIG_DIR when set, mirroring how Claude Code itself locates its config.
  • Both run() (install) and uninstall() now loop over all discovered directories, so every profile gets the statusline installed/removed in one shot.
  • The injected statusLine.command now uses ${CLAUDE_CONFIG_DIR:-$HOME/.claude} so each profile's Claude process resolves the correct script at runtime.

statusline.sh

  • Resolves claude_dir via CLAUDE_CONFIG_DIR with ~/.claude fallback at the top of the relevant section.
  • settings.json (effort level) and .credentials.json (OAuth token fallback) are now read from $claude_dir instead of the hardcoded $HOME/.claude path.

Known issue

Tracked in #35 — the statusline doesn't refresh automatically on first load for a new profile and requires typing /status once to trigger the initial render.

mhmzdev added 2 commits April 29, 2026 13:34
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant