Project-level hooks fail on Windows with Git Bash due to PowerShell injection

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

On Windows, Cursor uses a PowerShell snippet to decode hook metadata and pass it to hook scripts. When the integrated terminal’s default profile is set to Git Bash, this PowerShell snippet is sent to Bash and causes a syntax error because Bash cannot parse PowerShell constructs like [Convert]::FromBase64String. As a result, project-level hooks fail to execute and the hook script is not run. The terminal shows an error such as:

--: eval: line 1: syntax error near unexpected token '[Convert]::FromBase64String'

Steps to Reproduce

  1. Set terminal.integrated.defaultProfile.windows to “Git Bash” in Cursor settings.

  2. Create a .cursor/hooks.json file that defines a project-level hook (for example, a stop hook) that points to a .sh script.

  3. Trigger the hook (e.g., by invoking the stop hook via Cursor).

  4. The integrated terminal opens in Git Bash and immediately prints an error:

    --: eval: line 1: syntax error near unexpected token '[Convert]::FromBase64String'

    The hook does not run.

Expected Behavior

Hooks should execute successfully regardless of the user’s default shell. Cursor should pass hook metadata to scripts using a cross-platform method rather than injecting a PowerShell-only snippet. When Git Bash is the default terminal on Windows, the hook should still run without syntax errors and properly receive the metadata.

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.3.21 (system setup)
VSCode Version: 1.105.1
Commit: 68e0a0385b87408d050869ea543e3778ad53f780
Date: 2026-01-02T23:46:13.381Z
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.26200

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Hey, thanks for the report.

This is a known issue. Hooks use PowerShell syntax to decode base64, which isn’t compatible with Bash. The team is aware and is working on improving the hooks system.

A similar issue was discussed here: Hook Processing Fails on Windows with Git Bash Terminal