fix(windows): install Claude Code hook shims as .cmd wrappers#926
fix(windows): install Claude Code hook shims as .cmd wrappers#926jseramn wants to merge 1 commit into
Conversation
|
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. |
|
The substance here is right and needed — extensionless bash shims genuinely dead-end on Windows ("Open with" dialog on every PreToolUse), the
Happy to re-review after the rebase — this fixes a real priority/high Windows pain. |
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 regression plus smoke-test coverage for the Windows hook path. - Rebase on main: adopt Grep|Glob|Read matcher (DeusData#963) - Fix smoke 8e: match MINGW*/MSYS*/CYGWIN* uname suffixes - Harden .cmd shim: reject % in binary_path (cmd.exe expansion) - clang-format src/cli/cli.c Signed-off-by: Jose Ramon <jrgarciadr29@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
befa2f8 to
8d1ee1c
Compare
|
Addressed all review blockers in 8d1ee1c:
CI should be green on the next run — happy to iterate if anything else surfaces. |
Summary
~/.claude/hooks/trigger the "Open with" dialog and block workflows (especially on every Grep/Glob PreToolUse hook)..cmdwrappers on Windows and wiresettings.jsonto the absolute.cmdpath so CreateProcess can execute hooks directly.tests/windows/test_hook_scripts.pyregression test and enable smoke-test coverage for Windows (previously skipped).Root cause
cbm_install_hook_gate_script()always wrote#!/usr/bin/env bashscripts 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 patchwindows-latestNotes
Existing Unix installs are unchanged. Re-running
codebase-memory-mcp install -yon Windows migrates settings to the.cmdpath.