Project-Level Hooks Fail to Execute on Windows

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Project-level hooks (e.g., pre-commit, pre-push) are not functioning on Windows. Although the Cursor hooks system recognizes the hook files and attempts to run them (as evidenced in the logs), the intended commands within the hooks do not actually execute.

The hooks log indicates that the hook was processed but yielded no output, resulting in the system moving to the next hook (or completing the action without the hook’s intervention).

Key Log Entry:

[2025-12-02T02:26:05.295Z] Hook 1 produced no output, continuing to next hook
Steps to Reproduce

Steps to Reproduce

On a Windows machine, open a Git repository containing a project-level pre-commit hook (e.g., .cursor/hooks/pre-commit).
The hook script is designed to run a command (e.g., node json-to-xmind.js) whenever a specific data.json file is staged for commit.
Modify the data.json file and stage the change in Cursor.
Attempt to commit the change.
Observed Result: The commit succeeds, but no XMind file is generated. The conversion script was never invoked.
Check the Hooks log. The log will show the hook was called but “produced no output.”

Expected Behavior

When committing changes to data.json, the pre-commit hook should automatically execute the json-to-xmind.js script, generating a new XMind file before the commit is finalized.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.1.42 (system setup)
VSCode Version: 1.105.1
Commit: 2e353c5f5b30150ff7b874dee5a87660693d9de0
Date: 2025-12-01T02:18:26.377Z
Electron: 37.7.0
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.19044

For AI issues: which model did you use?

Composer 1

Does this stop you from using Cursor

Yes - Cursor is unusable

No hook of any kind are working sometime since 2.1.25

and they were not working properly before then either…

Hey, thanks for the report. Important note on “pre-commit”: Cursor doesn’t have a pre-commit event. Project hooks only trigger on supported events from the spec (afterFileEdit, beforeShellExecution, beforeReadFile, afterFileEdit, etc.), and they work in trusted workspaces. Documentation: Hooks | Cursor Docs

How to solve your pre-commit generation task:

  • If data.json changes, attach the script run to afterFileEdit
  • If the commit runs through the agent/terminal, intercept the git command in beforeShellExecution. Commits through the built-in SCM UI aren’t intercepted by hooks.

Could you please share:

  • .cursor/hooks.json (full) and the contents of the called script
  • Full log from View > Output > Cursor > Hooks at the time of reproduction (around the “Hook N produced no output” entry)
  • Screenshot of Settings > Hooks and confirmation that the workspace is marked as Trusted
  • Errors from Help > Toggle Developer Tools > Console (looking for spawn/ENOENT/EPERM/ExecutionPolicy)

Similar issue: [REGRESSION] Hook response fields user_message / agent_message still ignored in Windows v2.0.77 - they describe the current hooks problem on Windows.

Please provide this data and I’ll pass it to the team.

Even though I didn’t place the script in the corresponding path, it still showed that the hook executed normally. My hook worked fine in version 2.1.15, but after upgrading to version 2.1.42 today, it stopped working.

{
    "version": 1,
    "hooks": {
        "beforeReadFile": [
            {
                "command": "powershell -ExecutionPolicy Bypass -File .cursor/hooks/xmind-to-json-sync.ps1"
            }
        ],
        "afterFileEdit": [
            {
                "command": "powershell -ExecutionPolicy Bypass -File .cursor/hooks/json-to-xmind-sync.ps1"
            }
        ]
    }
}

Thanks for the info, I confirm that hooks are completely broken from version 2.1.25+. Last working version: 2.1.25.

Your case is identical: PowerShell scripts afterFileEdit and beforeReadFile run, but Cursor doesn’t see their output. From your screenshot, it’s clear “Hook 2 produced no output, continuing to next hook”.

Passing this to the team. This is a critical regression for Windows - hooks are completely non-functional from 2.1.25+.

Could you share the request ID? Private mode should be turned off.

Sorry. Our team has Privacy Mode enabled by default, which limits my ability to share a request ID. To help move this forward, I’ve found that the issue is easily reproducible by testing the hooks.json setup from Cursor’s documentation. The provided script there does not seem to be functioning at all.

1 Like

hooks get called again in 2.2.46+ but the agent_message responses are still not being relayed back to the agent