Skip to content

hooks/ponytail-mode-tracker.js: colon syntax /ponytail:review silently falls through to getDefaultMode() #417

Description

@nanaubusiness

File: hooks/ponytail-mode-tracker.js

Lines: 17-32

Bug: When a user invokes /ponytail:review (colon syntax), the command string is parsed as a single token with no space, so arg is empty. The code checks conditions like cmd === '/ponytail-review' but never checks for /ponytail:review. As a result, the command falls through to getDefaultMode() instead of activating review mode.

Root cause: The regex /^[/@$]ponytail/ and the subsequent split(/\s+/) only handles space-delimited arguments. Colon-delimited subcommands (e.g., /ponytail:review, /ponytail:ponytail) are treated as a single command string with no argument.

Trace for /ponytail:review:

  1. prompt.split(/\s+/)['/ponytail:review'\]
  2. parts[0] = /ponytail:review, arg = '' (empty, no second token)
  3. Line 24: cmd === '/ponytail-review' → false, cmd === '/ponytail:ponytail-review' → false
  4. Line 26: cmd === '/ponytail' → false (cmd is /ponytail:review)
  5. Falls through to getDefaultMode() — WRONG, user wanted review mode

Impact: Users invoking Ponytail with colon syntax get silently wrong behavior instead of an error or correct mode activation.

Reproduction:

# In Claude Code:
/ponytail:review   # Should activate review mode, but falls through to default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions