# Hooks are confusing

**URL:** <https://forum.cursor.com/t/hooks-are-confusing/149043>\
**Category:** Help\
**Tags:** csharp, hooks\
**Created:** [January 16, 2026, 4:37am UTC](https://forum.cursor.com/t/hooks-are-confusing/149043 "2026-01-16T04:37:01Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Cox](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/peter_cox/32/100910_2.png) [@Peter\_Cox](https://forum.cursor.com/u/Peter_Cox)\
**Post date:** [January 16, 2026, 4:37am UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/1 "2026-01-16T04:37:01Z")

</div>

I still can’t understand how to get hooks to work.

Once the agent is finished, I always want it to run .NET build at the end. The agent should tell me whether or not the build succeeds or fails. Looking at the logs the hook runs, but the agent doesn’t do anything with the result

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/5/3/53771d1252897933425db2e2258d359687a2f2d3.png)

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/e/d/ed4600896e6547442dd3e84c53a5b1f4cb6f71f0.png)

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/1/f/1f8041475aae90b98d27164dad870da4d612b7ba.png)

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/1/2/129098686dd8f325fa0d97889646da05e70240e9.png)

---

<div class="post-metadata">

**Author:** ![sanjeed5](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/sanjeed5/32/9610_2.png) [@sanjeed5](https://forum.cursor.com/u/sanjeed5)\
**Post date:** [January 19, 2026, 1:10pm UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/3 "2026-01-19T13:10:42Z")

</div>

Looking at your screenshots, your hook setup looks correct and is running successfully. In your `stop.sh` script, `followup_message` is only sent when `$BUILD_SUCCESS = false` (line 47-48), so when the build succeeds, no message is sent back to the agent.

If you want the agent to _always_ be notified of the build result (success or failure), move the `followup_message` output outside the conditional so it’s echoed for both cases - for example, include a success message like `"followup_message": "Build completed successfully."` in the success branch too.

Does that help clarify the behavior?

---

<div class="post-metadata">

**Author:** ![Peter\_Cox](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/peter_cox/32/100910_2.png) [@Peter\_Cox](https://forum.cursor.com/u/Peter_Cox)\
**Post date:** [January 19, 2026, 1:15pm UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/4 "2026-01-19T13:15:43Z")

</div>

![image](https://us1.discourse-cdn.com/cursor1/original/3X/7/8/7833001a4d1f58bf3cf6cafefab20d8df1fcae01.png)Thank you so much!! Yes thats why.

The docs need a better POC I have no idea how anyone figures hooks out the documentation is far too abstract and needs concrete examples in a github repo or something

Thanks @sanjeed5

---

<div class="post-metadata">

**Author:** ![sanjeed5](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/sanjeed5/32/9610_2.png) [@sanjeed5](https://forum.cursor.com/u/sanjeed5)\
**Post date:** [January 19, 2026, 1:41pm UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/5 "2026-01-19T13:41:59Z")

</div>

Do these examples help? [Hooks | Cursor Docs](https://cursor.com/docs/agent/hooks#examples)

If not, can you tell what would help more?

---

<div class="post-metadata">

**Author:** ![Peter\_Cox](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/peter_cox/32/100910_2.png) [@Peter\_Cox](https://forum.cursor.com/u/Peter_Cox)\
**Post date:** [January 19, 2026, 1:49pm UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/6 "2026-01-19T13:49:25Z")

</div>

In my view, they are comprehensive in the way that Material UI might for instance describe the API of each of their components, but not straight-forward example or POC e.g. how to create a Card.

For instance there is a GIF on the page which is great but the minimal hooks code to replicate is not provided.

I note that there is an example for “block-git.sh” but I don’t find it a particularly useful example and the tab kind of obfuscates it.

 ![image](https://us1.discourse-cdn.com/cursor1/original/3X/f/e/fef4373b11956bb4224273926d48637af5c35d5c.png)

I think for a lot of people (maybe speaking for others) is simply “does this compile or not” - if not fix it basically like my example. Or running prettier or similar.

My 2c anyway thanks again

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [April 19, 2026, 1:50pm UTC](https://forum.cursor.com/t/hooks-are-confusing/149043/7 "2026-04-19T13:50:09Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
