Skip to content

feat(hooks): honor hideStatus for the Claude Code statusline badge (#659) - #710

Open
ousamabenyounes wants to merge 1 commit into
DietrichGebert:mainfrom
ousamabenyounes:fix/issue-659
Open

feat(hooks): honor hideStatus for the Claude Code statusline badge (#659)#710
ousamabenyounes wants to merge 1 commit into
DietrichGebert:mainfrom
ousamabenyounes:fix/issue-659

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Summary

Fix #659

getHideStatus() (reading PONYTAIL_HIDE_STATUS / config.hideStatus) lives in the shared hooks/ponytail-config.js, but only pi-extension reads 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.js already reads the config at SessionStart. It now resolves getHideStatus() once and drops (or clears) a sibling .ponytail-hidden marker via a new best-effort setHidden() in ponytail-runtime.js (written next to the mode flag, so CLAUDE_CONFIG_DIR stays consistent).
  • ponytail-statusline.sh and ponytail-statusline.ps1 bail out (exit 0, no output) when the marker is present.
  • The marker is rewritten every session start, so unsetting the value brings the badge back on its own next session.
  • scripts/uninstall.js removes the marker too.

No config parsing added to the per-render shell scripts (they still just stat files), no new dependency.

Test verification (RED → GREEN)

New tests/statusline-hide.test.js drives the real hook: activate then statusline.sh, covering env var, config.hideStatus, and toggle-back-on. tests/uninstall.test.js gains an assertion that the marker is removed.

RED — prod reverted, new tests present:

not ok 1 - tests/statusline-hide.test.js
not ok 2 - tests/uninstall.test.js
# pass 0
# fail 2

GREEN — with the fix:

# tests 2
# pass 2
# fail 0

Full suite (node --test tests/*.test.js pi-extension/test/*.test.js), iso-or-better vs main:

main : # pass 106  # fail 1   (csv: correct pandas one-liner — pre-existing, pandas not installed)
fix  : # pass 107  # fail 1   (same pre-existing failure; +1 new passing test)

node scripts/check-rule-copies.js stays green.

Files changed

File Change
hooks/ponytail-runtime.js add .ponytail-hidden marker + best-effort setHidden()
hooks/ponytail-activate.js write/clear the marker from getHideStatus() at SessionStart
hooks/ponytail-statusline.sh bail when the marker is present
hooks/ponytail-statusline.ps1 bail when the marker is present
scripts/uninstall.js remove the marker on uninstall
tests/statusline-hide.test.js new round-trip test
tests/uninstall.test.js assert marker removed

…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>
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.

Feature: hide the Claude Code / Codex statusline badge (hideStatus parity with pi)

1 participant