-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Description
Summary
On Windows, hooks/hooks-cursor.json runs ./hooks/session-start directly. Depending on how Cursor spawns the hook, the resolved bash may come from PATH. The first bash on PATH is often C:\Windows\System32\bash.exe (WSL launcher). If WSL is missing or misconfigured, the hook fails and SessionStart does not inject additional_context.
Environment
- Windows 10/11
- Cursor + Superpowers (
.cursor-pluginwithhooks/hooks-cursor.json) - Git for Windows installed (
C:\Program Files\Git\bin\bash.exe)
Expected
SessionStart should reliably execute session-start on Windows without requiring users to reorder PATH or disable WSL shims.
Actual
From PowerShell, bash .\hooks\session-start (PATH bash) can fail with WSL errors such as:
execvpe(/bin/bash) failed: No such file or directory
Running the same script with Git’s bash explicitly succeeds (exit 0) and prints valid JSON with additional_context when CURSOR_PLUGIN_ROOT is set to the plugin root.
Proposed fix
Mirror the Claude Code path in hooks.json: invoke hooks/run-hook.cmd session-start from Cursor’s hook config (with plugin-root substitution if supported, e.g. analogous to "${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd" session-start).
run-hook.cmd already prefers Git for Windows bash in standard install locations, then falls back to where bash.
Related
- Release notes v5.0.3: Cursor hooks + PR Fix sessionStart hook for Cursor #709