feat(hooks): honor hideStatus for the Claude Code statusline badge (#659) - #710
Open
ousamabenyounes wants to merge 1 commit into
Open
feat(hooks): honor hideStatus for the Claude Code statusline badge (#659)#710ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
…ietrichGebert#659) getHideStatus() lived in the shared hooks/ponytail-config.js but only pi-extension read it; the native Claude/Codex statusline scripts ignored PONYTAIL_HIDE_STATUS / config.hideStatus and always drew the badge. The statusline scripts are shell/PowerShell that only stat .ponytail-active, so rather than teach them to parse config, ponytail-activate.js resolves getHideStatus() once at SessionStart and drops (or clears) a sibling .ponytail-hidden marker. Both statusline scripts bail when they see it. The marker is rewritten every session start, so unsetting the value brings the badge back on its own. uninstall.js clears the marker too. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Fix #659
getHideStatus()(readingPONYTAIL_HIDE_STATUS/config.hideStatus) lives in the sharedhooks/ponytail-config.js, but onlypi-extensionreads it. On native Claude Code / Codex the statusline scripts ignore it and always draw the[PONYTAIL]badge — the reporter set the variable and nothing happened.The statusline scripts are shell / PowerShell that only
stat.ponytail-active, so teaching them to parse config would be the wrong layer. Instead, following the reporter's suggestion:ponytail-activate.jsalready reads the config at SessionStart. It now resolvesgetHideStatus()once and drops (or clears) a sibling.ponytail-hiddenmarker via a new best-effortsetHidden()inponytail-runtime.js(written next to the mode flag, soCLAUDE_CONFIG_DIRstays consistent).ponytail-statusline.shandponytail-statusline.ps1bail out (exit 0, no output) when the marker is present.scripts/uninstall.jsremoves the marker too.No config parsing added to the per-render shell scripts (they still just
statfiles), no new dependency.Test verification (RED → GREEN)
New
tests/statusline-hide.test.jsdrives the real hook:activatethenstatusline.sh, covering env var,config.hideStatus, and toggle-back-on.tests/uninstall.test.jsgains an assertion that the marker is removed.RED — prod reverted, new tests present:
GREEN — with the fix:
Full suite (
node --test tests/*.test.js pi-extension/test/*.test.js), iso-or-better vsmain:node scripts/check-rule-copies.jsstays green.Files changed
hooks/ponytail-runtime.js.ponytail-hiddenmarker + best-effortsetHidden()hooks/ponytail-activate.jsgetHideStatus()at SessionStarthooks/ponytail-statusline.shhooks/ponytail-statusline.ps1scripts/uninstall.jstests/statusline-hide.test.jstests/uninstall.test.js