fix: statusline honors CLAUDE_CONFIG_DIR (completes #34)#154
Open
Lakshya77089 wants to merge 1 commit into
Open
fix: statusline honors CLAUDE_CONFIG_DIR (completes #34)#154Lakshya77089 wants to merge 1 commit into
Lakshya77089 wants to merge 1 commit into
Conversation
…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.
4ccf023 to
406f66a
Compare
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.
Closes #153.
Summary
Issue #34 made the hooks honor
CLAUDE_CONFIG_DIRwhen 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_DIRset, the write side and read side point at different files: the badge shows nothing, or a stale mode from a pre-migration~/.claudeflag 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 — preferCLAUDE_CONFIG_DIR, fall back to~/.claude:flag="${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.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 -nand PowerShell parser both pass.CLAUDE_CONFIG_DIRset they read the custom dir ([PONYTAIL:ULTRA]); unset, they read~/.claude([PONYTAIL:LITE]).node --test tests/*.test.js→ 51/51, andnode scripts/check-rule-copies.jspasses.