From 3519d035ecb99c654c4ed23fcfbd9cf6d7f81f9f Mon Sep 17 00:00:00 2001 From: Daria Zeynalnia Date: Sun, 18 Jan 2026 02:39:59 -0500 Subject: [PATCH] fix: handle WSL bash as default shell on Windows When WSL's bash.exe is in PATH (either alone or before Git's bash.exe), Claude Code passes Windows-style paths that WSL bash cannot resolve, causing "No such file or directory" errors. The fix attempts to convert paths using wslpath first, falling back to the original path for non-WSL environments (native Linux/macOS or Windows with Git Bash). To reproduce the original issue: - PATH contains only WSL's bash.exe path, OR - PATH contains both WSL and Git bash.exe paths but WSL comes first Fixes #275 Co-Authored-By: Claude Opus 4.5 --- hooks/hooks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/hooks.json b/hooks/hooks.json index d1745650c..0dd0763db 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh" + "command": "\"$(wslpath -u '${CLAUDE_PLUGIN_ROOT}')/hooks/run-hook.cmd\" session-start.sh || \"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start.sh" } ] }