Skip to content

fix: make ponytail mode changes visible to the user on Claude Code (#648) - #649

Open
halindrome wants to merge 1 commit into
DietrichGebert:mainfrom
halindrome:fix/claude-mode-feedback
Open

fix: make ponytail mode changes visible to the user on Claude Code (#648)#649
halindrome wants to merge 1 commit into
DietrichGebert:mainfrom
halindrome:fix/claude-mode-feedback

Conversation

@halindrome

Copy link
Copy Markdown
Contributor

Fixes #648.

The bug

On native Claude Code, writeHookOutput ends at hooks/ponytail-runtime.js:74
with process.stdout.write(context). Claude Code reads a UserPromptSubmit
hook's stdout as additionalContext and injects it into the assistant's
conversation, so every message ponytail wrote about mode went to the model and
never to the user:

  • bare /ponytail — the level report, the one command whose only job is telling the user something
  • /ponytail lite|full|ultra — switch confirmations
  • /ponytail off and "stop ponytail"
  • /ponytail default <mode>

The Codex branch (:44) already had a systemMessage channel. The native
branch 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

writeHookOutput takes an optional fourth argument, userMessage. When set, the
native 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.

off names the default it will revert to:

Ponytail off for this session — default is full, so a new session starts there.
`/ponytail default off` to persist.

That one is deliberate rather than minimal. clearMode() only drops the flag
file, so the next SessionStart re-activates at the configured default; without
naming 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.

  • off added to argument-hint and the three Switch: 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
  • Both README translations updated to match; .openclaw/ copies regenerated with scripts/build-openclaw-skills.js

Runtime 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 a
systemMessage, 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 /ponytail setting 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.

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

Claude Code: bare /ponytail and /ponytail off report to the model, not the user; hints omit off and default

2 participants