fix: make ponytail mode changes visible to the user on Claude Code (#648) - #649
Open
halindrome wants to merge 1 commit into
Open
fix: make ponytail mode changes visible to the user on Claude Code (#648)#649halindrome wants to merge 1 commit into
halindrome wants to merge 1 commit into
Conversation
…ietrichGebert#648) On native Claude a UserPromptSubmit hook's stdout becomes additionalContext, so every mode message ponytail wrote — the bare-/ponytail level report, switch confirmations, off, and default-set — reached the model and never the user. Codex already had a systemMessage channel; the native branch had none. Add an optional userMessage argument to writeHookOutput and pass it from the four call sites the user explicitly asked for output from. Everything else, including the SessionStart ruleset injection, stays raw stdout. Off names the default it reverts to, since clearMode() is session-scoped and the next SessionStart re-activates at the configured default. Also bring the hints back in line with the README: `off` was missing from argument-hint and the Switch lines, and `/ponytail default <mode>` (DietrichGebert#541) was documented nowhere. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LB67PomyrsP1EJnH4PeVad
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.
Fixes #648.
The bug
On native Claude Code,
writeHookOutputends athooks/ponytail-runtime.js:74with
process.stdout.write(context). Claude Code reads aUserPromptSubmithook's stdout as
additionalContextand injects it into the assistant'sconversation, so every message ponytail wrote about mode went to the model and
never to the user:
/ponytail— the level report, the one command whose only job is telling the user something/ponytail lite|full|ultra— switch confirmations/ponytail offand "stop ponytail"/ponytail default <mode>The Codex branch (
:44) already had asystemMessagechannel. The nativebranch had none, so on Claude Code the mode system had no observable state at
all unless the shipped status line was installed — and a user who has replaced
their status line (common) loses that too, silently.
The fix
writeHookOutputtakes an optional fourth argument,userMessage. When set, thenative branch emits
{ systemMessage, hookSpecificOutput: { additionalContext } }so the user sees it and the model still gets its context. When unset — every
other caller, including the SessionStart ruleset injection — behaviour is
byte-identical to before.
Only the four call sites where the user explicitly asked for output pass it.
offnames the default it will revert to:That one is deliberate rather than minimal.
clearMode()only drops the flagfile, so the next
SessionStartre-activates at the configured default; withoutnaming it, a user who turned ponytail off yesterday reads today's active session
as the plugin ignoring them. That is exactly how #648 got filed. The level
report and switch confirmations mention the default only when it differs from
the live level, so the common case stays short.
Docs
The README was already right; the Claude-side strings had drifted from it.
offadded toargument-hintand the threeSwitch:lines (skills/ponytail/SKILL.md,hooks/ponytail-instructions.js,.openclaw/skills/ponytail/SKILL.md)/ponytail default <mode>(feat: add /ponytail default <mode> to persist the default (#329) #541) documented — it appeared in no hint, no skill body, no README row, no help card, despite being the only way to turn ponytail off durably.openclaw/copies regenerated withscripts/build-openclaw-skills.jsRuntime strings are English-only across the codebase, so nothing else needed
translating.
Tests
node --test tests/*.test.js— 82 pass, 0 fail.Added to
tests/hooks.test.js: each of report / switch / off / default emits asystemMessage, off names the default, the bare report does not change the mode,and the SessionStart ruleset stays raw stdout rather than being wrapped in an
envelope.
Not included
#639 (bare
/ponytailsetting the mode on pi and OpenCode) is untouched —different platforms, different call path, and it needs a product decision this
PR should not make for you.
Happy to adjust the wording or narrow the scope to report/off only if you would
rather switch confirmations stayed quiet.