# Cursor Hooks On Windows

**URL:** <https://forum.cursor.com/t/cursor-hooks-on-windows/140293>\
**Category:** Bug Reports\
**Created:** [October 31, 2025, 7:20pm UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293 "2025-10-31T19:20:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_James](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_James](https://forum.cursor.com/u/Daniel_James)\
**Post date:** [October 31, 2025, 7:20pm UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/1 "2025-10-31T19:20:34Z")

</div>

### Where does the bug appear (feature/product)?

Cursor IDE

### Describe the Bug

On Windows, any hook command defined in ~/.cursor/hooks.json fails before it runs.

Even the minimal command echo ‘{“continue”:true,“permission”:“allow”}’ exits with --: line 1: 3: Bad file descriptor (stderr) and produces no stdout.

Hooks work when executed manually in a terminal, so the failure happens inside Cursor’s launcher.

### Steps to Reproduce

1. Save the following minimal config to C:\Users\<user\>.cursor\hooks.json:

```auto
 {
     "version": 1,
     "hooks": {
       "beforeSubmitPrompt": [
         { "command": "echo '{\"continue\":true,\"permission\":\"allow\"}'" }
       ]
     }
   }

```

1. Restart Cursor (or reload the window) so the new config is loaded.
2. Open any non-empty workspace and submit a simple prompt (e.g., “test”).
3. Open **Output → Hooks** and check the `beforeSubmitPrompt` entry.

**Observed**  
The command never runs; the Hooks panel shows:

```auto
Command: echo '{"continue":true,"permission":"allow"}'
Output: (no output)
Error Output:
--: line 1: 3: Bad file descriptor
--: line 1: 4: Bad file descriptor
exit code: 1

```

### Expected Behavior

Cursor should execute the hook command exactly as defined (in this case, emitting the JSON string so the hook can allow the action). Instead, the Windows launcher fails first, so no hook logic runs.

### Screenshots / Screen Recordings

 ![Screenshot 2025-10-31 151943.png](https://us1.discourse-cdn.com/cursor1/original/3X/4/c/4c2983b85b8f35aa673763e2090182c908e3206b.png)

### Operating System

Windows 10/11

### Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.0.38  
VSCode Version: 1.93.1  
Commit: 24f65d77200b32ab2c45d21b582a4589051f443c

### Additional Information

- Running the same command manually in PowerShell or CMD succeeds; only Cursor’s launcher fails.
- The same failure occurs for `beforeShellExecution`.

### Does this stop you from using Cursor

No - Cursor works, but with this issue

---

<div class="post-metadata">

**Author:** ![Gdany](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/gdany/32/85636_2.png) [@Gdany](https://forum.cursor.com/u/Gdany)\
**Post date:** [November 3, 2025, 7:22am UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/2 "2025-11-03T07:22:48Z")

</div>

Same

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

---

<div class="post-metadata">

**Author:** ![Daniel\_James](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_James](https://forum.cursor.com/u/Daniel_James)\
**Post date:** [November 20, 2025, 5:16pm UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/3 "2025-11-20T17:16:03Z")

</div>

Just pinging this.

---

<div class="post-metadata">

**Author:** ![Ogglas](https://avatars.discourse-cdn.com/v4/letter/o/eb8c5e/32.png) [@Ogglas](https://forum.cursor.com/u/Ogglas)\
**Post date:** [December 2, 2025, 10:29am UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/4 "2025-12-02T10:29:39Z")

</div>

I don’t have the `--: line 1: 3: Bad file descriptor` error but I get `OUTPUT: (empty)` in Hooks Output and `(no output)` in Hooks Execution log. I’m using version 2.1.46 and this used to work.

Colleagues on Mac does not have this error so it seems Windows Specific.

```auto
"beforeSubmitPrompt": \[
  {
    "command": "New-Item -Path \"C:\\Temp\\myfile.txt\" -ItemType File"
  }

```

Tried running simple commands that used to work but now they simply fail. Also tried `"echo \"{ \"continue\": true, \"user_message\": \"It Works\" }\""` but nothing works anymore.

---

<div class="post-metadata">

**Author:** ![Daniel\_James](https://avatars.discourse-cdn.com/v4/letter/d/51bf81/32.png) [@Daniel\_James](https://forum.cursor.com/u/Daniel_James)\
**Post date:** [December 3, 2025, 4:47pm UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/5 "2025-12-03T16:47:50Z")

</div>

**Hi there — just checking in.**

It’s been about a month without any acknowledgment on this thread, and I wanted to surface it again because Hooks is a core feature for many of us testing Cursor’s newer capabilities.

I completely understand if this is in the backlog or awaiting prioritization, but even a quick confirmation that it’s on the team’s radar would be super helpful.

Cursor has been shipping a lot and growing fast, and we’re running thousands of dollars in prompts through the system each month — so having clarity on issues like this really matters for planning and trust in the platform.

Thanks in advance for any update or even just a status check.

---

<div class="post-metadata">

**Author:** ![Knne\_Villegas](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Knne\_Villegas](https://forum.cursor.com/u/Knne_Villegas)\
**Post date:** [December 10, 2025, 3:39am UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/6 "2025-12-10T03:39:57Z")

</div>

新版本钩子不生效的问题，啥时候解决啊，我在2.1.26版本使用正常

---

<div class="post-metadata">

**Author:** ![Robert\_Clark](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/robert_clark/32/79376_2.png) [@Robert\_Clark](https://forum.cursor.com/u/Robert_Clark)\
**Post date:** [December 29, 2025, 8:13am UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/7 "2025-12-29T08:13:45Z")

</div>

Is it still broke on windows?

---

<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:** [January 20, 2026, 8:14am UTC](https://forum.cursor.com/t/cursor-hooks-on-windows/140293/8 "2026-01-20T08:14:02Z")

</div>

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