Repository navigation
Description
Operating system
Windows
Orca version
1.4.221
Details
Short summary:
With the WSL backend, a Claude Code session running in WSL with its working directory set to the Windows home folder (/mnt/c/Users/<user>) loads the Windows user settings file C:\Users\<user>\.claude\settings.json as project settings (<cwd>/.claude/settings.json). Orca writes 13 Windows-native hooks to that file, each with the bare command C:/Users/<user>/.orca/agent-hooks/claude-hook.cmd. WSL's /bin/sh can't resolve a C:/ path or run a .cmd, so every hook event fails and Claude Code shows an error on every tool call:
PreToolUse:Bash hook error
Failed with non-blocking status code: /bin/sh: 1: C:/Users/<user>/.orca/agent-hooks/claude-hook.cmd: not found
This has been failing since the WSL backend was set up, but #23944 (the fix for #21514 / #23877) made it visible. From Claude Code session transcripts on my machine:
- Before the migration (Oct 2): 123 hook runs recorded as
hook_success,exitCode: 0, withstderr: /bin/sh: 1: .../claude-hook.cmd: not found. The old|| echo {}fallback hid the failure. - After Orca rewrote the entries to the bare path (Oct 5 09:26 local): 542 runs recorded as
hook_non_blocking_error,exitCode: 127, starting with the first session after the rewrite.
Status reporting isn't actually broken. The managed WSL account settings (~/.local/share/orca/claude-accounts/<id>/auth/settings.json) have the cross-platform hook, which correctly runs ~/.orca/agent-hooks/claude-hook.sh, and ORCA_AGENT_HOOK_PORT / ORCA_AGENT_HOOK_TOKEN / ORCA_PANE_KEY are set in the session. The Windows-file hooks are redundant duplicates in WSL (or at least incorrectly referenced). They only produce errors.
What happened?
Timeline from file timestamps:
- Sep 28 13:21: Orca installed (Windows)
- Sep 28 13:48: Windows
~/.claude/settings.jsongets 13 hooks asclaude-hook.cmd || echo {}(seen insettings.json.bak) - Sep 28 13:51: WSL backend/bridge set up
- Oct 5 09:26: Windows
settings.jsonrewritten to the bareclaude-hook.cmdpath (fix(claude): run Windows hooks without shell operators #23944 migration); visible errors start in WSL sessions
The Windows-file hooks are still managed by Orca (the Oct 5 rewrite shows that), so deleting or wrapping them by hand probably won't last past the next Orca startup.
How can we reproduce it?
- Windows with Orca 1.4.221, WSL backend enabled (Ubuntu 24.04), Claude Code 2.1.292 running in WSL via a managed Orca Claude account.
- Let Orca install its Claude hooks so Windows
C:\Users\<user>\.claude\settings.jsonhas the bareC:/Users/<user>/.orca/agent-hooks/claude-hook.cmdentries. - Open a Claude pane in WSL with working directory
/mnt/c/Users/<user>(exactly the Windows home folder). I did this with the floating workspace. - Have Claude run any tool (e.g. a Bash command). Each PreToolUse/PostToolUse shows
/bin/sh: 1: C:/Users/<user>/.orca/agent-hooks/claude-hook.cmd: not found.
Scope: it only affects sessions whose working directory is exactly the Windows home folder. Across my transcripts, 11/11 sessions in /mnt/c/Users/<user> hit it, while 0/24 sessions in subfolders (/mnt/c/Users/<user>/source/repos/*) and 0/4 in WSL-native paths did, including sessions after the Oct 5 migration.
Anything else that might help:
- The managed account-level hook command already handles this. It branches on
OSTYPEand runsclaude-hook.shon Linux. The Windows user-settings entries have no such guard. - Workaround: don't use the Windows home folder as the working directory for WSL Claude panes.
- Possible fixes (keeping [Bug]: [Windows] Claude Code agent hooks are written as "<path> || echo {}", which Windows PowerShell 5.1 fails to parse — every hook event fails #23877's PowerShell 5.1 constraint in mind, so no shell operators in the Windows entry): have the WSL account settings override or disable the inherited project hooks, warn when a WSL pane's working directory is the Windows home folder, or document the workaround.
- Related: [Bug]: Windows: Claude hook command
claude-hook.cmd || echo {}is silently dead whenbashresolves to WSL (Git Bash not on PATH,CLAUDE_CODE_GIT_BASH_PATHunset) #21514, [Bug]: [Windows] Claude Code agent hooks are written as "<path> || echo {}", which Windows PowerShell 5.1 fails to parse — every hook event fails #23877, fix(claude): run Windows hooks without shell operators #23944, fix(hooks): register the Claude hook script directly on Windows (#18875) #18905, [Bug]: External settings.json rewriters (e.g. CC Switch provider switching) silently wipe Orca's managed Claude hooks — agent progress stalls until the next Orca restart #16771.
Activity
[-][Bug]:[/-][+][Bug]: WSL Claude sessions run the Windows-only `claude-hook.cmd` hooks from Windows ~/.claude/settings.json[/+]AmethystLiang commentedon Oct 8, 2026
Thanks for reporting. Looking into it
MWG-Logan commentedon Oct 8, 2026
I dont think anything in
1.4.222was targeting this, but for good measure, tested on the newest update, and was still able to reproduce