showAuth/showAuthUser render nothing with a custom CLAUDE_CONFIG_DIR
Summary
showAuth/showAuthUser silently render nothing whenever CLAUDE_CONFIG_DIR
is set to anything other than the default ~/.claude. No error is shown —
the HUD just omits the auth segment.
getClaudeConfigJsonPath() in src/claude-config-dir.ts computes the
account/state JSON path by string-concatenating .json onto the resolved
config dir:
export function getClaudeConfigJsonPath(homeDir: string): string {
return `${getClaudeConfigDir(homeDir)}.json`;
}For the default profile (no env var set), getClaudeConfigDir returns
homeDir/.claude, and the concatenation happens to produce the real file —
Claude Code stores the default profile's state as a sibling of the
.claude directory (~/.claude.json), not nested inside it.
But when CLAUDE_CONFIG_DIR is set to a custom directory (e.g.
~/.claude-work), Claude Code actually nests that profile's state file
inside the directory (~/.claude-work/.claude.json), not as a sibling.
The concatenation instead guesses a nonexistent path
(~/.claude-work.json). readAuthInfo()'s fs.statSync throws ENOENT on
that path, the catch swallows it, and the function returns
{ method: null, user: null } with no diagnostic.
This affects anyone running Claude Code with a custom CLAUDE_CONFIG_DIR.
Steps to Reproduce
export CLAUDE_CONFIG_DIR=~/.claude-work(any custom, non-default path that has already been used to log in via Claude Code, so~/.claude-work/.claude.jsonexists with a realoauthAccount)- Enable
display.showAuthUser: truein claude-hud's config - Run the status line
Expected Behavior
The HUD shows the logged-in account (e.g. alice), same as it does for the
default ~/.claude profile.
Actual Behavior
The auth segment is silently omitted — no account, no error.
Environment
- OS: macOS (Darwin 25.5.0)
- Node/Bun version: v22.23.2
- Claude Code version: 2.1.258
Logs or Screenshots
N/A — the failure is silent (caught ENOENT, no log output). Confirmed via a
one-off script calling readAuthInfo() directly with CLAUDE_CONFIG_DIR
pointed at a real custom profile: returns { method: null, user: null }
despite a valid oauthAccount sitting in
$CLAUDE_CONFIG_DIR/.claude.json.
A fix + tests are ready; PR incoming.
Source: jarrodwatts/claude-hud