[FEATURE REQUEST] Allow UserPromptSubmit hooks to rewrite user prompts

Resolved 💬 2 comments Opened Oct 1, 2025 by WarrenZhu050413 Closed Oct 1, 2025

What I'd like

The ability for UserPromptSubmit hooks to modify/rewrite the user's prompt dynamically, not just append additional context.

Why

Currently, hooks can only add context via additionalContext or block the prompt. This prevents implementing macro expansion and variable substitution in user prompts. Users could define custom variables that hooks expand inline, making prompts more concise and reusable.

Example

User types:

Hey, can you look at $style and see whether you follow it correctly?

Hook detects $style and rewrites to:

{
  "hookSpecificOutput": {
    "hookEventName": "UserPromptSubmit",
    "rewrittenPrompt": "Hey, can you look at [full style guide text here] and see whether you follow it correctly?"
  }
}

This enables macro systems where $style, $conventions, @templates, etc. can be expanded inline by hooks, rather than only being able to append context separately.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗