fix(plugins): Add cross-platform hook wrappers for Windows compatibility #23562
+280
−3
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
.cmdwrappers to 3 official plugins (explanatory-output-style,learning-output-style,ralph-wiggum) that ensure hook.shscripts execute correctly on Windows when WSL is installedhooks.jsonin each plugin to route through the wrapper instead of calling.shscripts directlyplugin-devskill (SKILL.md, patterns.md) with a copyable example for plugin developersProblem
On Windows with WSL installed (extremely common due to Docker Desktop),
bashin PATH resolves toC:\Windows\System32\bash.exe(WSL) instead of Git Bash. Claude Code detects.shin hook commands and auto-prependsbash, causing all plugin hooks to fail:Claude Code correctly identifies Git Bash at startup (
Using bash path: "C:\Program Files\Git\bin\bash.exe") but uses genericbashfor hook execution.Solution
A polyglot
.cmdfile that works in both cmd.exe and bash::;are labels in cmd.exe (ignored) and no-ops in bashexecs the target.shscript nativelywhere gitNo changes to the core binary needed. Existing
.shscripts remain unchanged.Test Plan
.cmdwrapper viacmd /con Windows — produces valid JSON output.cmdwrapper viabashon Unix-like shell — passes through correctlyReferences
.cmdwrapper — narrow scope, same approach)