Skip to content

fix: strip brackets from Skill-invoked /ponytail args#614

Open
EduardoRubio73 wants to merge 1 commit into
DietrichGebert:mainfrom
EduardoRubio73:fix/bracket-wrapped-skill-args
Open

fix: strip brackets from Skill-invoked /ponytail args#614
EduardoRubio73 wants to merge 1 commit into
DietrichGebert:mainfrom
EduardoRubio73:fix/bracket-wrapped-skill-args

Conversation

@EduardoRubio73

Copy link
Copy Markdown

Summary

  • Claude Code's Skill invocation (as opposed to a plain slash command) relays the mode argument wrapped in literal brackets, e.g. the prompt text becomes ponytail:ponytail [lite] rather than /ponytail lite.
  • ponytail-mode-tracker.js split the prompt on whitespace and compared the raw token directly against 'lite'/'full'/'ultra'/'off'. The bracketed token ("[lite]") never matched, so the else branch fired and silently fell back to getDefaultMode() — meaning /ponytail lite run as a Skill left the session on full with no error, no matter what mode was requested.
  • Fix strips leading/trailing brackets from the extracted arg before comparing.

Confirmed by reproducing directly: piping {"prompt": "/ponytail:ponytail [lite]"} into the hook produced PONYTAIL MODE CHANGED — level: full before the fix, level: lite after.

Test plan

  • Added a regression test to tests/hooks.test.js asserting a bracket-wrapped arg switches mode correctly.
  • Verified the new test fails on the pre-fix hook (via git stash) and passes after.
  • node --test tests/hooks.test.js tests/hooks-windows.test.js — all 7 pass.

Claude Code's Skill invocation relays the mode argument wrapped in
literal brackets (e.g. "ponytail:ponytail [lite]"), unlike a plain
slash command ("/ponytail lite"). ponytail-mode-tracker.js compared
the raw token against 'lite'/'full'/'ultra'/'off', so the bracketed
form never matched and silently fell back to the default mode instead
of switching — /ponytail lite run as a Skill left the session on full.

Co-Authored-By: Claude Sonnet 5 <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.

1 participant