Where does the bug appear (feature/product)?
Background Agent (GitHub, Slack, Web, Linear)
Describe the Bug
Summary
Husky is a commonly used tool for Git hook management, but this issue is not specific to Husky—it will affect any tool that manages Git hooks via core.hooksPath. Cursor Cloud overrides core.hooksPath to its own dispatcher directory (~/.cursor/agent-hooks//), but does not reliably interoperate with external hook managers. This creates a conflict where either Cursor hooks or external hooks are skipped depending on which system last modified core.hooksPath.
Environment
Cursor Cloud (agent-enabled workspace)
Husky (via “prepare”: “husky” in package.json)
Git hooks: pre-commit, pre-push, etc.
Observed Behavior
Cursor sets:
core.hooksPath = ~/.cursor/agent-hooks//
This overrides any existing hook manager (e.g. Husky), which typically sets:
core.hooksPath = .husky/_
Cursor attempts to chain to the original hooks path via:
.cursor-original-hooks-path
But this is a directory that only contains sample files as Husky uses core.hooksPath as well
Result: dispatcher is never invoked for some hooks (e.g. pre-push)
Key Problems
- Cursor overrides external hook managers (e.g. Husky), causing critical checks to be skipped
When Cursor sets core.hooksPath, it takes exclusive control of Git hooks
This results in commit/push checks (tests, linting, policy enforcement) being silently skipped. These checks are especially important for gating AI-generated code, so skipping them is high risk.
- Husky taking over Cursor hooks
Husky runs via “prepare”: “husky” during npm install. If the agent ever runs this command during its lifecycle, it resets.
core.hooksPath = .husky/_
After this, Cursor’s dispatcher is no longer used, and Cursor-specific hooks (.cursor) do not run at all
Result: Cursor functionality becomes inconsistent depending on whether npm install has been executed
Steps to Reproduce
Create a simple node project with husky installed, and a single pre-push hook
Expected Behavior
I would expect Cursor to check that core.hooksPath has been set and act accordingly with forwarding. I think this check may happen, but it likely runs before the agent setup script. In our case, this is when we run npm install, which is when the core.hooksPath
Operating System
MacOS
Version Information
Cloud Agent
Does this stop you from using Cursor
No - Cursor works, but with this issue