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)
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)
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.
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+.
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.