You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cursor (Windows): hooks-cursor.json should use run-hook.cmd for session-start #871
On Windows 11, Cursor loads hooks/hooks-cursor.json which currently runs ./hooks/session-start. That file is extensionless (intentionally, per run-hook.cmd comments, so Claude Code does not prepend bash to .sh). Windows does not execute it as a program; the user gets the system Open with dialog instead of the SessionStart hook.
Thanks — this makes sense. On Windows the extensionless ./hooks/session-start won’t execute directly, so Cursor ends up showing the “Open with” dialog.
I’ll send a PR that updates hooks/hooks-cursor.json to run the SessionStart hook via run-hook.cmd (same approach as hooks.json), i.e.:
from: ./hooks/session-start
to: ./hooks/run-hook.cmd session-start
That should make the Cursor hook behave consistently on Windows while keeping the extensionless hook script for Claude Code compatibility.
The above is the current hook file. Because the format of Copilot Hooks differs slightly from that of Claude Hooks, the value of the shell field (set to bash by default) is ignored in Windows environments.
The string in the command field is processed by PowerShell. To execute a file in PowerShell, you need the "Call operator (&)".
However, since I do not have a Claude subscription, I cannot verify whether this hook causes errors in Claude Code
If you want to make hooks.json compliant with the Claude Hook specifications, you need to change run-hook.cmd to a PowerShell/bash polyglot and rename it to run-hook.ps1.
Just chiming in to confirm this is still reproducible on superpowers 5.0.7 + Cursor on Windows 11 — every new agent session pops up the Windows "Select an app to open 'session-start'" dialog, which is pretty disruptive.
Applied the one-line fix locally (swapping ./hooks/session-start → ./hooks/run-hook.cmd session-start in hooks/hooks-cursor.json) and it works perfectly: dialog gone, SessionStart hook runs silently through Git Bash as expected.
Since the fix is tiny, already proven by the parity with hooks.json, and this affects every Windows + Cursor user on install, would it be possible to prioritize merging it? Happy to open a PR if that helps move things along.
Fixed by #1054, now merged into dev. Cursor on Windows now invokes SessionStart via ./hooks/run-hook.cmd session-start instead of executing the extensionless ./hooks/session-start directly.
Activity
gilangjavier commentedon Mar 22, 2026
Thanks — this makes sense. On Windows the extensionless
./hooks/session-startwon’t execute directly, so Cursor ends up showing the “Open with” dialog.I’ll send a PR that updates
hooks/hooks-cursor.jsonto run the SessionStart hook viarun-hook.cmd(same approach ashooks.json), i.e.:./hooks/session-start./hooks/run-hook.cmd session-startThat should make the Cursor hook behave consistently on Windows while keeping the extensionless hook script for Claude Code compatibility.
RatmmmhSquishyRat commentedon Apr 7, 2026
still trigger it today, need fix~~
Batarbin commentedon Apr 7, 2026
I encountered similar warning about the
session-startwhen using Copilot in VS Code (I don't know about the CLI)The underline is slightly misaligned there... That's where it should be:
AJpon commentedon Apr 15, 2026
@Batarbin
superpowers/hooks/hooks.json
Lines 1 to 16 in f9b088f
The above is the current hook file. Because the format of Copilot Hooks differs slightly from that of Claude Hooks, the value of the
shellfield (set tobashby default) is ignored in Windows environments.The string in the command field is processed by PowerShell. To execute a file in PowerShell, you need the "Call operator (
&)".Example:
& "${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd" session-startGiven the existence of shells other than PowerShell, using this operator is not practical.
In addition to the command field, the following additional fields are available in Copilot Hooks:
When using this in VS Code, the Hook will work without issues if you rewrite it as follows:
{ "hooks": { "SessionStart": [ { "matcher": "startup|clear|compact", "hooks": [ { "type": "command", "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start", "windows": "cmd /c \"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start", "async": false } ] } ] } }However, since I do not have a Claude subscription, I cannot verify whether this hook causes errors in Claude Code
If you want to make
hooks.jsoncompliant with the Claude Hook specifications, you need to change run-hook.cmd to a PowerShell/bash polyglot and rename it to run-hook.ps1.qiyuey commentedon Apr 20, 2026
Just chiming in to confirm this is still reproducible on superpowers 5.0.7 + Cursor on Windows 11 — every new agent session pops up the Windows "Select an app to open 'session-start'" dialog, which is pretty disruptive.
Applied the one-line fix locally (swapping
./hooks/session-start→./hooks/run-hook.cmd session-startinhooks/hooks-cursor.json) and it works perfectly: dialog gone, SessionStart hook runs silently through Git Bash as expected.Since the fix is tiny, already proven by the parity with
hooks.json, and this affects every Windows + Cursor user on install, would it be possible to prioritize merging it? Happy to open a PR if that helps move things along.Thanks a lot for maintaining the project!
ThatGuyJacobee commentedon Apr 28, 2026
Our team can reproduce this here:
Just wanted to bump when you have a chance - thank you for the project!
arittr commentedon Apr 28, 2026
Fixed by #1054, now merged into dev. Cursor on Windows now invokes SessionStart via
./hooks/run-hook.cmd session-startinstead of executing the extensionless./hooks/session-startdirectly.fix(install): forward-slash-normalize Windows paths in hook commands
ggirard07 commentedon Aug 12, 2026
I am still hitting the same issue on vscode + github copilot. I am using the plugin integration from vscode.