Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
As of Cursor 3.15.6, committing from the Source Control panel silently skips all git hooks. pre-commit, commit-msg, Husky, and anything else in .git/hooks never runs. There is no error, no warning, and no --no-verify on the command line — the commit just succeeds as if the hooks did not exist. Committing the same staged changes from the integrated terminal runs the hooks correctly.
This is a serious silent-failure: linting, formatting, generated-file checks, and secret scanning are all bypassed, and the user has no indication anything was skipped. In my case a code-generation hook that keeps generated files in sync with a source CSV was bypassed, and I committed an inconsistent tree several times before noticing.
Root cause: the bundled git extension injects a hardcoded set of config overrides into the environment of every git process it spawns. In /Applications/Cursor.app/Contents/Resources/app/extensions/git/dist/main.js:
var La = [
["safe.bareRepository", "explicit"],
["core.fsmonitor", "false"],
["core.hooksPath", Jo.devNull], // os.devNull → /dev/null
["core.attributesFile", Jo.devNull]
];
These are appended as GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n pairs (with GIT_CONFIG_COUNT bumped) by the env-building function, which also overwrites any of these keys the caller had already set. Because core.hooksPath points at /dev/null, git finds no hooks.
Applying these overrides to background/read-only operations is reasonable, but they are also applied to commit, which defeats hooks entirely.
None of these four keys exist anywhere in upstream microsoft/vscode’s git extension (extensions/git/src/git.ts, main.ts, util.ts), so this is Cursor-specific.
This is also invisible to normal debugging: because the override arrives via the environment rather than a config file, git config --show-origin --get-all core.hooksPath reports nothing, and .git/hooks/pre-commit is present and executable.
Steps to Reproduce
- In any repo, install a hook that always fails:
printf '#!/bin/sh\nexit 1\n' > .git/hooks/pre-commit && chmod +x .git/hooks/pre-commit - Stage any change.
- Commit from the Source Control panel. The commit succeeds.
- Undo it (
git reset --soft HEAD~) and rungit commit -m testin the integrated terminal. The commit is correctly blocked.
To confirm the mechanism, this reproduces the exact behaviour from a shell:
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/dev/null \
git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
Logs
The Git output channel shows no --no-verify, and the timing makes the regression obvious. From my own Git.log history in the same repo with the same hooks:
2026-07-17 16:48:51 > git ... commit --quiet --allow-empty-message --file - [1108ms]
2026-07-20 13:11:39 > git ... commit --quiet --allow-empty-message --file - [1690ms]
2026-07-26 13:00:16 > git ... commit --quiet --allow-empty-message --file - [2130ms]
2026-08-05 13:27:40 > git ... commit --quiet --allow-empty-message --file - [1286ms]
2026-08-06 16:36:44 > git ... commit --quiet --allow-empty-message --file - [1398ms] <-- last good
2026-08-07 10:33:17 > git ... commit --quiet --allow-empty-message --file - [69ms] <-- first bad
2026-08-07 13:44:03 > git ... commit --quiet --allow-empty-message --file - [74ms]
2026-08-07 13:57:53 > git ... commit --quiet --allow-empty-message --file - [86ms]
Every commit from July 17 to Aug 6 took 800–2100 ms (hooks running). Every commit from Aug 7 onward takes 62–86 ms (hooks skipped). The identical command run from a terminal takes ~955 ms and correctly fails on the hook.
The 3.15.6 bundle was written to disk on Aug 6 at 02:14, but my Cursor session had been running since Jul 27, so the old build stayed active all through Aug 6. The log session directory 20260807T095326 shows Cursor restarted at 09:53 on Aug 7 — and the very next commit, at 10:33, was the first to skip hooks.
Expected Behavior
Commits made from the Source Control panel should run git hooks, exactly as git commit does from a terminal, unless the user explicitly chooses a “Commit (No Verify)” command. If hooks must be suppressed for the extension’s internal/background git calls, the override should be scoped to those calls and not applied to commit, merge, rebase, or push.
Operating System
MacOS
Version Information
Version: 3.15.6
Commit: a1f686545fd0ce8917bbd2449f733551a9bce420
Date: 2026-08-06T01:41:03.876Z
VS Code Version: 1.128.0
Also: git 2.50.1 (Apple Git-155), pre-commit 4.5.0. Not Remote SSH or WSL — plain local workspace.
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor