Hooks in 2.4.7 are still not working properly

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Cursor 2.4.7 (Current - 2026-01-21)

Hook Event Fires? agent_message reaches AI? followup_message works? user_message shown? Notes
beforeSubmitPrompt :white_check_mark: Yes :cross_mark: NO N/A :red_question_mark: Unknown Fires on user/followup messages
beforeShellExecution :white_check_mark: Yes :cross_mark: NO N/A :red_question_mark: Unknown
beforeMCPExecution :hourglass_not_done: Untested :hourglass_not_done: Untested N/A :red_question_mark: Unknown Need MCP call
beforeReadFile :white_check_mark: Yes :cross_mark: NO N/A :red_question_mark: Unknown Undocumented!
afterShellExecution :white_check_mark: Yes :cross_mark: NO N/A N/A
afterMCPExecution :hourglass_not_done: Untested :hourglass_not_done: Untested N/A N/A Need MCP call
afterFileEdit :white_check_mark: Yes :cross_mark: NO N/A N/A
afterAgentResponse :white_check_mark: Yes :cross_mark: NO N/A N/A Fired at 13:44:21
afterAgentThought :hourglass_not_done: Untested :hourglass_not_done: Untested N/A N/A Need thinking model
stop :white_check_mark: Yes :cross_mark: NO :white_check_mark: CONFIRMED 13:44:22 N/A ONLY working AI comm channel!
beforeTabFileRead :hourglass_not_done: Untested :hourglass_not_done: Untested N/A N/A Tab-specific
afterTabFileEdit :hourglass_not_done: Untested :hourglass_not_done: Untested N/A N/A Tab-specific

Steps to Reproduce

activate hooks that obey your hook spec

Expected Behavior

should do what your doc says, instead of only half-doing it!

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.4.7 (user setup)
VSCode Version: 1.105.1
Commit: ca0f9bf806f235ea014a22712cbcbf5e88ca77e0
Date: 2026-01-20T20:52:38.077Z
Build Type: Stable
Release Track: Early Access
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Windows_NT x64 10.0.26100

For AI issues: which model did you use?

Opus-4.5

Additional Information

I need this to work for my project - please escalate this to your dev team for fixing - they should be fixing bugs as top-priority, not adding new features and making new releases!

Does this stop you from using Cursor

Yes - Cursor is unusable

2 Likes

Hey, thanks for the report. This is the same bug we talked about in the previous thread. Hooks do fire, but agent_message and user_message don’t get included in the model context.

The team is aware and working on it as a priority. Sorry this is taking so long. Once the fix is ready, it’ll ship in an update.

Thanks - I just thought you should know, since this is a new release, and still a problem…

1 Like

followup_message never works for me.
It seemed to work in 2.3 and now doesnt work in 2.4

I’m on 2.4.21



# DotNet hook - runs .NET build after agent completion and reports status

# Must read JSON input from stdin and output JSON to stdout

# Read JSON input from stdin (required by hooks protocol)

json_input=$(cat)




# Extract status from input

status=$(echo "$json_input" | grep -o '"status":"[^"]*' | cut -d'"' -f4 || echo "unknown")




# Get the project root directory (assuming hooks.json is in .cursor/)

PROJECT_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"

BACKEND_DIR="$PROJECT_ROOT/backend"




# Run .NET build and capture output

BUILD_OUTPUT=""

BUILD_SUCCESS=false




if [ -d "$BACKEND_DIR" ]; then

cd "$BACKEND_DIR"

BUILD_OUTPUT=$(dotnet build 2>&1)

BUILD_EXIT_CODE=$?

if [ $BUILD_EXIT_CODE -eq 0 ]; then

echo "✅ .NET BUILD SUCCEEDED" >&2

echo "Build completed successfully - all code compiled without errors." >&2

echo "Agent status: $status" >&2

BUILD_SUCCESS=true

else

echo "❌ .NET BUILD FAILED" >&2

echo "Build errors detected. The project does not compile." >&2

echo "Agent status: $status" >&2

echo "" >&2

echo "Build output:" >&2

echo "$BUILD_OUTPUT" >&2

BUILD_SUCCESS=false

fi

else

echo "⚠️  Backend directory not found at $BACKEND_DIR" >&2

BUILD_SUCCESS=false

fi




# Output valid JSON (empty object for dotnet hook)

# Can optionally include followup_message to notify the agent

# This message will be sent to the agent if the build fails

# The followup_message enables automatic retry/notification

if [ "$BUILD_SUCCESS" = false ]; then

echo "THIS SHOULD FAIL NOW" >&2

echo "{\"followup_message\": \"The .NET build failed. Please review and fix the compilation errors.\"}"

else

echo "{}"

fi




# Exit with appropriate code

if [ "$BUILD_SUCCESS" = true ]; then

exit 0

else

exit 1

fi