fix(windows): install Claude Code hook shims as .cmd wrappers#926
Open
jseramn wants to merge 1 commit into
Open
fix(windows): install Claude Code hook shims as .cmd wrappers#926jseramn wants to merge 1 commit into
jseramn wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.