{"version":"2.1.269","anchor":"new-prompt-admission-tracking-guards-promptsubmit-style","canonical_anchor":"prompt-submission-hooks-can-now-rewrite-the-submitted-text","heading":"prompt.submit hook pipeline reworked with rewriting, an 'enter' phase, and better diagnostics","tier":"notice","area":"SDK","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269\/e\/new-prompt-admission-tracking-guards-promptsubmit-style","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.269","markdown":"### prompt.submit hook pipeline reworked with rewriting, an 'enter' phase, and better diagnostics\n\nThe prompt.submit hook pipeline was rebuilt to let hooks rewrite prompts, add an enter phase, and report drops and queued prompts more clearly\n\n**What**\n\n- Hooks that run on `prompt.submit` can now rewrite the text of the prompt before it is committed; this is logged as \"prompt.submit: text rewritten by a hook\".\n\n- The pipeline gained a new `enter` stage\/callback. When it fires, Claude Code now records telemetry event `prompt_queued` and the prompt is queued rather than run immediately.\n\n- When a hook drops a prompt, Claude Code now logs a reason (\"prompt.submit: dropped\") and can show a distinct \"Prompt not submitted\" message alongside the existing \"Prompt dropped by a hook\" message.\n\n- If a plugin's `prompt.submit` hook attaches extra context to its result *after* it has already called `next()`, that is now detected and a warning is logged that the entries were dropped, instead of the entries being silently lost.\n\n- Internally, both the interactive and SDK\/headless prompt-processing paths now open a disposable tracker before processing input and mark it \"handed off\" once the new messages are pushed into the conversation; if the tracker is disposed before hand-off, any waiter is rejected instead of hanging.\n\n- The SDK's error message for `$.prompt.submit` (thrown when text starts with `\/`) now tells the caller to use `$.command.run` instead.\n\n**Why** These changes make the prompt-submission path more capable (hooks can now edit prompts, not just allow or block them) and easier to debug, since drops, rewrites, and queued prompts are now logged and reported distinctly instead of failing silently or hanging.\n\n- Area: SDK\n- Tier: You'll notice\n- Useful: 3\/5\n- Signal: 3\/5"}