Hooks > Can't seem to get more than 1 working

It only seems to run one hook at a time is my hooks.json valid syntax? It should be running the react one as well as the dotnet one.

Hey, thanks for the report. This is a known bug. Only the first hook in the array runs.

Workaround: use a wrapper script:

#!/bin/bash
# stop-all.sh
/Users/pcox/dev/SideQuest/.cursor/hooks/dotnet.sh
/Users/pcox/dev/SideQuest/.cursor/hooks/react.sh
exit 0
{
  "version": 1,
  "hooks": {
    "stop": [
      { "command": "/Users/pcox/dev/SideQuest/.cursor/hooks/stop-all.sh" }
    ]
  }
}

The team is aware of the issue, but there’s no timeline yet.

1 Like

This personally didn’t work for me - as itll never give an output for the agent to use.
Running either one works fine - I’ll just try combining the scripts into one to use which will suffice.

I see you’re on 2.3.41. Try updating to 2.4, it should be fixed there. Let me know if the issue still happens.

The .NET one no longer works for me once I upgraded - it was working before in 2.3

I can’t definitely say I’ve changed anything but I have spent a bunch of tokens using Composer-1 trying to fix the shell scripts.

To help out I’ve made a minimum repro here GitHub - PeterWCox/hooks-test: Minimal .NET backend and React frontend app to test Cursor hooks

The monorepo runs dotnet build and react. There’s some compiler errors to help test the hooks

It would really help out a lot of people who want to use the basics of hooks to have a simple POC like this somewhere in the docs

Edit: Is this the way I’m supposed to send the followup message? You can see the “This should fail now” log shows, the message should be sent to the agent.

bumping

Hi @deanrie any update on this ?

I’m on Ultra and pay a lot of good money for Cursor for this, as well as time and credits debugging this.

If no ETA please recommend a workaround eg an alternative hook to do what I want or remove it from the docs

In general cursor is a good product but I can’t recommend it based on my current experience with it and what I see around the forum. I hope this changes I know it’s only January still

Hey, sorry for the delay, it looks like the hooks regression took a while. The bug where followup_message and agent_message don’t make it to the model is known, and the team is aware.

Unfortunately, right now the only reliable way to communicate with the agent via hooks is the stop hook with followup_message, but based on reports from other users, even that is unstable in 2.4.

The current working workaround is to merge the logic into a single script (like you did) and use stderr for logs and stdout for the JSON response. But if followup_message isn’t triggering the agent, that’s exactly this bug.

Thanks for the repro repo, it really helps. I’ll share the link with the team along with this thread. I’ll post an update here when there’s a fix.

1 Like