Skip to content

fix(windows): install Claude Code hook shims as .cmd wrappers#926

Open
jseramn wants to merge 1 commit into
DeusData:mainfrom
jseramn:fix/windows-hook-cmd-wrappers
Open

fix(windows): install Claude Code hook shims as .cmd wrappers#926
jseramn wants to merge 1 commit into
DeusData:mainfrom
jseramn:fix/windows-hook-cmd-wrappers

Conversation

@jseramn

@jseramn jseramn commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • On Windows, Cursor and Claude Code spawn hook commands without a shell. Extensionless bash shims in ~/.claude/hooks/ trigger the "Open with" dialog and block workflows (especially on every Grep/Glob PreToolUse hook).
  • Install .cmd wrappers on Windows and wire settings.json to the absolute .cmd path so CreateProcess can execute hooks directly.
  • Add tests/windows/test_hook_scripts.py regression test and enable smoke-test coverage for Windows (previously skipped).

Root cause

cbm_install_hook_gate_script() always wrote #!/usr/bin/env bash scripts without a file extension. Windows has no default handler for extensionless files, so the OS prompts the user to pick an app. The smoke test explicitly skipped Windows (MINGW64_NT), so CI never caught this.

Test plan

  • python tests/windows/test_hook_scripts.py <binary> fails on current release, passes with this patch
  • CI smoke on windows-latest
  • Manual: install on Windows, run Grep in Cursor — no "Open with" dialog

Notes

Existing Unix installs are unchanged. Re-running codebase-memory-mcp install -y on Windows migrates settings to the .cmd path.

Extensionless bash hook scripts trigger Windows Open with dialogs when Cursor/Claude Code spawn PreToolUse/SessionStart commands without a shell. Write .cmd wrappers on Windows, point settings.json at the absolute .cmd path, and add a regression test plus smoke-test coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jseramn jseramn requested a review from DeusData as a code owner July 7, 2026 02:13
@DeusData DeusData added bug Something isn't working windows Windows-specific issues editor/integration Editor compatibility and CLI integration ux/behavior Display bugs, docs, adoption UX priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Jul 7, 2026
@DeusData

DeusData commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Thanks for the Windows hook-shim fix. Triage: high-priority Windows/editor integration bug.

Review will check that Windows gets executable .cmd wrappers wired by absolute path, Unix installs stay unchanged, and smoke coverage really exercises the Windows hook path that previously skipped. This is a sharp fix for #929.

@DeusData DeusData added this to the 0.9.1-rc milestone Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working editor/integration Editor compatibility and CLI integration priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. ux/behavior Display bugs, docs, adoption UX windows Windows-specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants