Where does the bug appear (feature/product)?
Cursor CLI
Describe the Bug
Stop hook followups fail to land after waiting for background tasks.
Steps to Reproduce
- When a CLI agent waits for background tasks, a stop hook is fired, and leads to a followup message queued. (Figure 1)
- When the background tasks finished and the agent really stopped (idle), the queued message is still in queue (follow-ups) and failed to input as a prompt. (Figure 2)
Expected Behavior
When the agent goes idle, the follow-up message should land as a user prompt.
Operating System
Linux
Version Information
About Cursor CLI
CLI Version 2026.05.16-0338208
Model GPT-5.4 272K Medium
Subscription Tier Enterprise
OS linux (x64)
Terminal vscode
Shell zsh
For AI issues: which model did you use?
Any
Does this stop you from using Cursor
Yes - Cursor is unusable
Figure 1:
Figure 2:
In addition, any further followups are blocked. The followup queue seems broken after this behavior.
Thanks for the detailed report and screenshots. I attempted to reproduce this on both macOS and Linux with a stop hook that introduces a deliberate delay and returns a followup_message, combined with a short background shell task. Across multiple attempts with varying timing windows (2s–8s hook delays), the followup consistently landed as expected.
A few things that would help narrow this down:
-
Could you share your stop hook script? Your screenshots show the followup originates from a monitor_script hook. Understanding the hook’s logic (especially any file I/O, transcript reads, or network calls) would help me reproduce the exact timing conditions.
-
Could you check the Hooks Execution Log? Go to Cursor Settings > Hooks > Execution Log — this shows whether the hook fired, what payload it received, and the response it returned. A screenshot or copy of the log entries around the time of the stuck followup would confirm whether the hook executed correctly on Cursor’s side.
-
Is this reproducible on every session, or intermittent? If intermittent, roughly how often does it trigger (1 in 3 sessions? 1 in 10?)?
-
Are there other hooks configured besides the stop hook? If you have afterFileEdit, sessionStart, or other hooks that interact with the same state (edit markers, transcript files), the combination may affect timing.
This would help us pin down the specific conditions that trigger the race.