Skip to content

Commit 8927759

Browse files
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

File tree

.claude-plugin/marketplace.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"name": "humanize",
99
"source": "./",
1010
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
11-
"version": "1.15.4"
11+
"version": "1.15.5"
1212
}
1313
]
1414
}

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "humanize",
33
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
4-
"version": "1.15.4",
4+
"version": "1.15.5",
55
"author": {
66
"name": "PolyArch"
77
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Humanize
22

3-
**Current Version: 1.15.4**
3+
**Current Version: 1.15.5**
44

55
> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.
66

hooks/hooks.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"hooks": [
77
{
88
"type": "command",
9-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-plan-file-validator.sh"
9+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-plan-file-validator.sh\""
1010
}
1111
]
1212
}
@@ -17,7 +17,7 @@
1717
"hooks": [
1818
{
1919
"type": "command",
20-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-write-validator.sh"
20+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-write-validator.sh\""
2121
}
2222
]
2323
},
@@ -26,7 +26,7 @@
2626
"hooks": [
2727
{
2828
"type": "command",
29-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-edit-validator.sh"
29+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-edit-validator.sh\""
3030
}
3131
]
3232
},
@@ -35,7 +35,7 @@
3535
"hooks": [
3636
{
3737
"type": "command",
38-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-read-validator.sh"
38+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-read-validator.sh\""
3939
}
4040
]
4141
},
@@ -44,7 +44,7 @@
4444
"hooks": [
4545
{
4646
"type": "command",
47-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-bash-validator.sh"
47+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-bash-validator.sh\""
4848
}
4949
]
5050
}
@@ -55,7 +55,7 @@
5555
"hooks": [
5656
{
5757
"type": "command",
58-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-post-bash-hook.sh"
58+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-post-bash-hook.sh\""
5959
}
6060
]
6161
}
@@ -65,12 +65,12 @@
6565
"hooks": [
6666
{
6767
"type": "command",
68-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/loop-codex-stop-hook.sh",
68+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/loop-codex-stop-hook.sh\"",
6969
"timeout": 7200
7070
},
7171
{
7272
"type": "command",
73-
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/pr-loop-stop-hook.sh",
73+
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/pr-loop-stop-hook.sh\"",
7474
"timeout": 7200
7575
}
7676
]

hooks/lib/loop-common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,9 @@ is_cancel_authorized() {
898898
# Check if a path is inside .humanize/rlcr directory
899899
is_in_humanize_loop_dir() {
900900
local path="$1"
901-
echo "$path" | grep -q '\.humanize/rlcr/'
901+
# Normalize backslashes to forward slashes so Windows paths (C:\...\.humanize\rlcr\...)
902+
# match the POSIX pattern the rest of the hook tree expects.
903+
echo "${path//\\//}" | grep -q '\.humanize/rlcr/'
902904
}
903905

904906
# ========================================

0 commit comments

Comments
 (0)