Let a `stop` hook run end-of-turn work without rendering below the final answer

Feature request for product/service

Cursor IDE

Describe the request

Problem

A stop hook’s only output is followup_message, which auto-submits a new user turn. That turn renders below the agent’s final answer. So any hook doing useful end-of-turn work — capturing notes, logging, generating a post-run summary, continuing an iteration loop — pushes the answer out of the viewport. On a small screen the last thing the user sees is the hook’s bookkeeping, not the answer they asked for.

There’s no userland workaround, because every other hook is disqualified:

Hook Why it can’t solve this
stop / subagentStop followup_message always renders as a fresh user turn below the answer.
afterAgentResponse Fires after the final message but returns nothing — observe-only, can’t reposition.
beforeSubmitPrompt Fires on user input, not before the agent’s final generation — wrong end of the turn.
postToolUse Can inject additional_context, but fires after every tool with no “last tool before the agent answers” signal.

Request

Either of:

  1. A background/collapsed render flag for stop continuations (preferred + sufficient) — let a stop hook mark its followup_message as a side effect so the TUI collapses/backgrounds it, leaving the agent’s answer as the last visible block. The work still runs and still lands in the transcript; it just doesn’t occupy the viewport.
  2. A pre-finalization hook — an event that fires when the agent is about to emit its final message, whose output is handled before that message generates, so a hook can complete side-effect work ahead of the answer within the same turn.

Use case

A stop hook captures durable notes after a task touches real code (a common memory/knowledge-tooling pattern). On a 13" laptop the agent answers, then the hook forces a capture turn that renders below and scrolls the answer out of view. With a background/collapsed flag the capture runs and is recorded but stays out of the viewport.

Note

This is a shared limitation of current agent-hook models, not Cursor-specific — the identical primitive was requested for Claude Code at anthropics/claude-code#76721. Filing here so the same fix has a home on Cursor’s side.

Hey, thanks for the detailed request. The table breaking down why the other hooks don’t solve the issue really helps. It’s all on point.

You correctly described the current behavior. stop only has one output which is followup_message and it always gets submitted as a new user turn below the final response. afterAgentResponse is observe-only so there’s no userland workaround right now.

Both suggestions make sense. The collapse/background flag for stop continuations and a separate pre-finalization hook. I’ve noted it down and will pass it to the team that handles hooks for them to consider. I can’t give a timeline or promises on implementation but the request is logged and votes or interest in the thread will help with prioritization.

If you have a specific config example or scenario where this hurts especially besides the memory/notes case drop it here. It will add context.

Thanks for the response, honestly, right now the only case is capturing notes, but it could really be anything, like a verification checkpoint to see that the agent has completed the task by satisfying all the required criteria. I haven’t really faced any other issues apart from the actual problem i described above.

Same need from knowcards: end-of-turn reflect must keep this session’s message prefix for KV cache, without a user-visible followup_message. Today stop only auto-submits a user turn (loop_limit: 1). Please add additional_context (system reminder, not a user bubble) and an idle-wake so that work can run after the answer, on the same session_id.