SessionStart hook should fire after compact

Feature request for product/service

Cursor CLI

Describe the request

After a session is compacted, Cursor should trigger the SessionStart hook again for the continued session.

Claude Code supports firing its session-start hook after compact, which is useful for re-injecting persistent or required context into the newly compacted conversation. Cursor currently appears not to do this, which means important hook-provided context can be lost in long-running sessions.

Requested behavior:

Fire SessionStart after compact, not just at the beginning of a brand new session.
Make the hook output available to the post-compact session so persistent instructions/context can be restored.
Ideally include a reason/source in the event metadata so hooks can distinguish between fresh session start vs post-compact restart if needed.
Why this matters:

Preserves necessary context across compaction boundaries.
Makes long-running agent workflows more reliable.
Helps teams inject stable instructions, environment context, and other persistent guidance after compact.
If you want, I can also rewrite this into a more GitHub-style issue template with Problem / Expected behavior / Use case.

Operating System (if it applies)

Linux

Thanks @Shurui_Gui!

I’ve tested it, and the additional_context injected by sessionStart hooks survives compaction, preserving the first user message (where the additional_context is placed)! Do you have any evidence that it isn’t working this way?

Thanks for your reply, Colin! I got this info from the official doc: Hooks | Cursor Docs , where we did not mention this behavior. Let me have a try. ; )

Great proposal. I completely agree, and this highlights yet another gap in how Cursor handles hook lifecycles and context retention.

I want to point out that this shouldn’t be looked at in isolation, as the entire hooks ecosystem currently has major systemic issues. For instance, while you are losing context across compaction boundaries, the postToolUse hook is failing to inject context entirely (it suffers from empty input payloads, completely discarded output, and intermittent firing).

Losing persistent instructions during compaction just adds to the friction of trying to build reliable agent workflows in Cursor right now. I highly recommend the engineering team look at this feature request alongside the severe bugs currently breaking other hooks.

For visibility, here is the thread detailing the complete breakdown of the postToolUse hook. It all seems tied to the same underlying context pipeline:

Hi Colin, as I tried, there was no SessionStart hook fired after preCompact. How did you test the additional_context? Is it automatically injected by the compacter and not through a SessionStart hook?

Hi @Shurui_Gui,

On my end, I have tools that let me see exactly what’s being sent to the model. Using these, I can confirm that the context is indeed preserved after compaction.

I realize this isn’t ideal from a visibility standpoint, you’ll have to take my word for it, but I wanted to assure you that the context is being retained.