Skip to content

[Bug]: WSL Claude sessions run the Windows-only claude-hook.cmd hooks from Windows ~/.claude/settings.json #26290

Open

Description

@MWG-Logan

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, with stderr: /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.json gets 13 hooks as claude-hook.cmd || echo {} (seen in settings.json.bak)
  • Sep 28 13:51: WSL backend/bridge set up
  • Oct 5 09:26: Windows settings.json rewritten to the bare claude-hook.cmd path (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?

  1. 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.
  2. Let Orca install its Claude hooks so Windows C:\Users\<user>\.claude\settings.json has the bare C:/Users/<user>/.orca/agent-hooks/claude-hook.cmd entries.
  3. 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.
  4. 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:

Activity

  1. added theissue type on Oct 7, 2026
  2. changed the title [-][Bug]:[/-] [+][Bug]: WSL Claude sessions run the Windows-only `claude-hook.cmd` hooks from Windows ~/.claude/settings.json[/+] on Oct 7, 2026
  3. AmethystLiang commented on Oct 8, 2026

    @AmethystLiang
    Contributor

    Thanks for reporting. Looking into it

  4. MWG-Logan commented on Oct 8, 2026

    @MWG-Logan
    Author

    I dont think anything in 1.4.222 was targeting this, but for good measure, tested on the newest update, and was still able to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions