Skip to content

fix(cursor): run sessionStart via run-hook.cmd on Windows#1280

Closed
hhalperin wants to merge 1 commit into
obra:devfrom
hhalperin:fix/cursor-sessionstart-run-hook-cmd
Closed

fix(cursor): run sessionStart via run-hook.cmd on Windows#1280
hhalperin wants to merge 1 commit into
obra:devfrom
hhalperin:fix/cursor-sessionstart-run-hook-cmd

Conversation

@hhalperin
Copy link
Copy Markdown

Problem

On Windows, \hooks-cursor.json\ pointed at the extensionless bash \session-start\ script. The OS/Cursor hook runner often does not execute it as bash, so the file is opened in the default app (editor) or triggers an Open with dialog on each new Agent chat (\sessionStart).

Change

Use the existing
un-hook.cmd\ dispatcher (same as Claude Code \hooks.json) so Git Bash runs \session-start\ and prints JSON as intended.

Verification

  • Ran
    un-hook.cmd session-start\ with \CURSOR_PLUGIN_ROOT\ set; stdout is valid JSON with \�dditional_context.

Made with Cursor

Cursor hooks pointed at the extensionless bash session-start script; on Windows the handler often opens the file in an editor or shows Open with on each new Agent session. Delegates to the existing run-hook.cmd dispatcher (same as Claude Code hooks) so Git Bash runs the script.

Made-with: Cursor
@obra obra added hooks Hook system (SessionStart, Stop, etc.) windows cursor Cursor IDE integration pr-template-rules-ignored PR filed after template was added but didn't use it labels Apr 27, 2026
@arittr arittr changed the base branch from main to dev April 28, 2026 18:21
@arittr
Copy link
Copy Markdown
Collaborator

arittr commented Apr 28, 2026

Thanks for sending this. This is the same Cursor Windows SessionStart fix as #1054, and #1054 has now been merged into dev with the clean one-line hooks-cursor.json change, so I'm closing this as superseded/duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cursor Cursor IDE integration hooks Hook system (SessionStart, Stop, etc.) pr-template-rules-ignored PR filed after template was added but didn't use it windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants