Commit 8927759
committed
Fix Windows hook dispatch via explicit bash invocation; bump to 1.15.5
GitHub Copilot CLI on Windows installs plugin hooks under
~/.copilot/installed-plugins/<owner>/<plugin>/hooks/ and dispatches the
"command" string of each hooks.json entry through pwsh. With the bare-path
form ("${CLAUDE_PLUGIN_ROOT}/hooks/<name>.sh"), Windows' OS-level dispatch
hands the .sh to the registered editor (typically VS Code) instead of
executing it, because Windows has no native handler for the .sh extension.
The visible symptom is that every plugin hook source file pops open as a
tab in the editor at session start and on each tool use.
Switch each hook entry from a bare path to "bash <path>". On hosts that
shell-execute the command field, this resolves bash via PATH (Git for
Windows on Windows; system bash on macOS/Linux) and runs the script
explicitly. The change is backwards-compatible: macOS/Linux Claude Code
already shell-executed the bare-path form via the kernel's shebang
resolution to /bin/bash; making the invocation explicit removes one layer
of OS-level dispatch ambiguity without changing the effective dispatch
chain on POSIX hosts.
Verified empirically:
- Windows Copilot CLI v1.0.36-1: full Humanize gen-plan + start-rlcr-loop
workflow runs end-to-end under autopilot mode with no .sh tabs popping
up; PreToolUse, PostToolUse, and Stop hooks all fire silently.
- Windows Claude Code: PreToolUse Write hook fires correctly and emits
"Wrong Round Contract Location" when given an out-of-loop contract path,
proving bash actually executes the .sh body (not silent failure).
Also fix hooks/lib/loop-common.sh::is_in_humanize_loop_dir to normalize
backslashes to forward slashes before grepping for ".humanize/rlcr/".
Without this, every Windows-form path (C:\...\.humanize\rlcr\...) that
Claude Code's Write tool passes to the hook fails the substring match,
which makes the write-validator misclassify any in-loop contract or
summary write as outside the loop directory and reject it with "Wrong
Round Contract Location" even when the path is correct. The fix is a
one-line bash parameter expansion that is a no-op on POSIX hosts.
Version bump per the main-branch version-bump rule.1 parent c980d94 commit 8927759
5 files changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
901 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
902 | 904 | | |
903 | 905 | | |
904 | 906 | | |
| |||
0 commit comments