Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
I’m testing a minimal local Cursor plugin with a sessionStart hook and no external dependencies.
Setup:
- local plugin in ~/.cursor/plugins/local/test-sessionstart-plugin
- user hook config in ~/.cursor/hooks.json
- fresh empty workspace
- Cursor 3.0.12 on macOS
The sessionStart hook returns valid JSON with injected context:
{
“additional_context”: “<test_memories>Use pytest and Vitest. Prefer minimal diffs.</test_memories>”
}
Cursor appears to accept it:
- the plugin loads in Settings > Plugins
- the hook appears in Settings > Hooks
- the hook log shows:
- Hook step requested: sessionStart
- Hook 1 executed successfully and returned valid response
- Merged 1 valid response(s) for step sessionStart
But Agent Window does not use the injected context.
Steps to Reproduce
-
Create a local plugin at:
~/.cursor/plugins/local/test-sessionstart-plugin -
Add this plugin manifest at:
~/.cursor/plugins/local/test-sessionstart-plugin/.cursor-plugin/plugin.json
{
“name”: “test-sessionstart-plugin”,
“displayName”: “Test SessionStart Plugin”,
“version”: “0.0.1”,
“description”: “Minimal local plugin repro for sessionStart context injection.”,
“author”: { “name”: “Local Repro” },
“license”: “MIT”,
“category”: “developer-tools”,
“tags”: [“hooks”, “testing”]
}
- Add this hook script at:
~/.cursor/plugins/local/test-sessionstart-plugin/scripts/session_start.py
#!/usr/bin/env python3
import json
print(json.dumps({
“additional_context”: “<test_memories>Use pytest and Vitest. Prefer minimal diffs.</test_memories>”
}))
- Add this user hooks config at:
~/.cursor/hooks.json
{
“version”: 1,
“hooks”: {
“sessionStart”: [
{
“command”: “python3 "/Users/dikshantpradhan/.cursor/plugins/local/test-sessionstart-plugin/scripts/session_start.py"”,
“timeout”: 15
}
]
}
}
-
Fully quit and reopen Cursor.
-
Confirm:
- the plugin appears in Settings > Plugins
- the hook appears in Settings > Hooks
-
Open a fresh empty workspace.
-
Start a new Agent Window session.
-
Ask:
“What testing frameworks and coding preferences should you follow?”
Expected Behavior
The model should answer from the injected sessionStart context and mention pytest, Vitest, and minimal diffs.
Screenshots / Screen Recordings
Operating System
MacOS
Version Information
IDE: Cursor 3.0.12
For AI issues: which model did you use?
Default model in Agent Window
For AI issues: add Request ID with privacy disabled
Relevant docs / references:
The hook runs and Cursor logs the returned JSON as valid and merged, but the Agent Window answer still behaves as if the context was never injected.
This looks like either:
- a runtime bug in how sessionStart additional_context is surfaced to Agent Window, or
- a docs/runtime mismatch about whether sessionStart additional_context is supposed to be model-visible there.
Does this stop you from using Cursor
No - Cursor works, but with this issue
