# Add additional\_context to beforeSubmitPrompt hook output

**URL:** <https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231>\
**Category:** Feature Requests\
**Tags:** hooks\
**Created:** [April 9, 2026, 8:49pm UTC](https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231 "2026-04-09T20:49:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mibogo](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mibogo](https://forum.cursor.com/u/mibogo)\
**Post date:** [April 9, 2026, 8:49pm UTC](https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231/1 "2026-04-09T20:49:28Z")

</div>

### Feature request for product/service

Cursor IDE

### Describe the request

Add an additional\_context to the beforeSubmitPrompt hook output similar to sessionStart and postToolUse hooks to allow for injecting additional context on each user prompt submission. Potential use cases for this is to have a script inject certain context whenever the user prompt contains certain strings, commands, or attachments.

My immediate use for this would be to have a hook script automatically run necessary scripts (creating git diff file and setting up review directory) for my /code-review command and output the results to the agent in order to reduce agent turns from having the agent execute them. This could also be achieved by adding a beforeCommand hook but I figure this field would be lower friction since the hook already exists and opens up more potential use cases.

---

<div class="post-metadata">

**Author:** ![Bogdan\_Parhomenko](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@Bogdan\_Parhomenko](https://forum.cursor.com/u/Bogdan_Parhomenko)\
**Post date:** [April 29, 2026, 8:39am UTC](https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231/3 "2026-04-29T08:39:39Z")

</div>

Great feature request! Having `additional_context` available on `beforeSubmitPrompt` would indeed open up a lot of powerful workflow automations.

However, just a heads-up to @mibogo and the dev team: the `additional_context` functionality you mentioned for `postToolUse` is actually completely broken in the current builds (e.g., 3.1.15).

Currently, the `postToolUse` hook suffers from empty input payloads (no `stdin`, `argv`, or env vars), the output context is completely discarded and never reaches the model, and it fires very intermittently.

So while I completely support adding this to `beforeSubmitPrompt`, the engineering team urgently needs to fix the underlying hook infrastructure first. We are tracking the major bugs with the existing implementation here:

> [@Native postToolUse hooks accept and log additional\_context successfully, but the injected context is not surfaced to the model](https://forum.cursor.com/t/native-posttooluse-hooks-accept-and-log-additional-context-successfully-but-the-injected-context-is-not-surfaced-to-the-model/155689/11):
>
> Adding data points on Cursor 3.1.15 (macOS, 2026-04-21). The postToolUse input side also looks unpopulated, on the same path where the response is discarded — so even fixing the output plumbing wouldn’t be sufficient on its own. Hook script logs process.argv, CURSOR\_\* env vars, and stdin length on every invocation. Representative entries: [2026-04-21T21:53:59.071Z] spawn pid=25047 argv=[] env= [2026-04-21T21:53:59.077Z] stdin-end bytes=0 [2026-04-21T21:55:37.036Z] spawn pid=26394 argv=[] env…

Once the core plumbing is fixed, expanding it to `beforeSubmitPrompt` would be amazing!

---

<div class="post-metadata">

**Author:** ![qdrddr](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/qdrddr/32/113736_2.png) [@qdrddr](https://forum.cursor.com/u/qdrddr)\
**Post date:** [July 7, 2026, 7:08pm UTC](https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231/4 "2026-07-07T19:08:35Z")

</div>

@mohitjain, if I rely on the beforeSubmitPrompt hook to auto-generate a rule .mdc with always apply: true, will it be included in the prompt in the same turn before LLm call?

---

<div class="post-metadata">

**Author:** ![Benjamin\_Schulz](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@Benjamin\_Schulz](https://forum.cursor.com/u/Benjamin_Schulz)\
**Post date:** [July 14, 2026, 12:56pm UTC](https://forum.cursor.com/t/add-additional-context-to-beforesubmitprompt-hook-output/157231/5 "2026-07-14T12:56:17Z")

</div>

It would be really great to have additional\_context available. I use an MCP Server for Skill Discovery across several Agents. And here I want to force specific deterministic output based on the user prompt to be injected into the Context after every user prompt. In Claude and Codex this works really well, sadly Cursor is lacking behind here.
