Skip to content

fix: statusline honors CLAUDE_CONFIG_DIR (completes #34)#154

Open
Lakshya77089 wants to merge 1 commit into
DietrichGebert:mainfrom
Lakshya77089:fix/statusline-honor-claude-config-dir
Open

fix: statusline honors CLAUDE_CONFIG_DIR (completes #34)#154
Lakshya77089 wants to merge 1 commit into
DietrichGebert:mainfrom
Lakshya77089:fix/statusline-honor-claude-config-dir

Conversation

@Lakshya77089

@Lakshya77089 Lakshya77089 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Closes #153.

Summary

Issue #34 made the hooks honor CLAUDE_CONFIG_DIR when writing the mode flag, and tests/hooks.test.js enforces it lands in $CLAUDE_CONFIG_DIR/.ponytail-active. But both statusline scripts still read a hardcoded $HOME/.claude/.ponytail-active:

So for any user with CLAUDE_CONFIG_DIR set, the write side and read side point at different files: the badge shows nothing, or a stale mode from a pre-migration ~/.claude flag that never updates. The write half of #34 was fixed; the read half was missed.

Fix

Resolve the flag in both scripts exactly as getClaudeDir() does — prefer CLAUDE_CONFIG_DIR, fall back to ~/.claude:

flag="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.ponytail-active"
$ClaudeDir = if ($env:CLAUDE_CONFIG_DIR) { $env:CLAUDE_CONFIG_DIR } else { Join-Path $HOME ".claude" }
$Flag = Join-Path $ClaudeDir ".ponytail-active"

The fallback branch is byte-for-byte the previous behavior, so users without the env var are unaffected. Also corrects the now-inaccurate path comment in the activation hook header.

Verification

  • bash -n and PowerShell parser both pass.
  • Functionally checked both scripts: with CLAUDE_CONFIG_DIR set they read the custom dir ([PONYTAIL:ULTRA]); unset, they read ~/.claude ([PONYTAIL:LITE]).
  • Full suite green: node --test tests/*.test.js → 51/51, and node scripts/check-rule-copies.js passes.

…DietrichGebert#34 follow-up)

Issue DietrichGebert#34 made the hooks honor CLAUDE_CONFIG_DIR when writing the mode flag
($CLAUDE_CONFIG_DIR/.ponytail-active), enforced by tests/hooks.test.js. But
both statusline scripts still hardcoded $HOME/.claude/.ponytail-active, so any
user with CLAUDE_CONFIG_DIR set gets no badge — or a stale mode from a
pre-migration ~/.claude flag that never updates again.

Make both scripts resolve the flag the same way getClaudeDir() does: prefer
CLAUDE_CONFIG_DIR, fall back to ~/.claude. The fallback branch is identical to
the previous behavior, so unset-env users are unaffected. Also corrects the
now-inaccurate path comment in the activation hook header.
@Lakshya77089 Lakshya77089 force-pushed the fix/statusline-honor-claude-config-dir branch from 4ccf023 to 406f66a Compare June 18, 2026 10:55

@huzaif-fahad huzaif-fahad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

Statusline badge ignores CLAUDE_CONFIG_DIR — shows nothing or a stale mode for non-default config homes

2 participants