Skip to content

Hook does not work on Windows (bash dependency) #1

@christiannancy

Description

@christiannancy

Hi,

The UserPromptSubmit hook is a bash script, which means it doesn't run on Windows where bash isn't available by default. Claude Code on Windows (via winget) is a supported platform, but the hook silently fails there — claude-router init completes without error, but no routing directives are ever injected.

The jq dependency is documented in the README and is a reasonable requirement on Unix systems. The core issue is the bash interpreter itself, not jq specifically.

I have a fix ready if you'd like a PR: a Node.js rewrite of the hook that behaves identically on Windows, macOS, and Linux (using JSON.parse() instead of jq, os.tmpdir() instead of /tmp/).

I did a complete backward compatible rewrite of the code to be fully in Node.js and my rewrite also includes a provider abstraction (to support AWS Bedrock) and cross-platform launch command I built on top of it.

I can submit a PR for just the hook fix, or submit all my changes in one PR. Happy to follow your preference.

Thanks!
Christian

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions