Skip to content

Windows: Manual settings.json hook works without WSL #2503

Closed

Description

@vbadonskidev-gif

Hey, just wanted to share a finding that might help
improve the Windows docs.

Your installer correctly falls back to CLAUDE.md mode
on native Windows since it can't run the .sh hook script.

However, I found that manually adding the PreToolUse hook
directly to ~/.claude/settings.json works perfectly on
native Windows (PowerShell 7.6.3) without WSL:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Bash",
      "hooks": [{ 
        "type": "command",
        "command": "rtk hook claude"
      }]
    }]
  }
}

Tested and confirmed working. Maybe worth adding to the
Windows installation docs as an alternative to WSL?

Activity

  1. added
    documentation
    good first issue
    on Jun 25, 2026
  2. pszymkowiak commented on Jun 25, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    📋 Category docs
    🟢 Priority low
    🎯 Confidence 91%

    Summary

    User confirmed manual settings.json hook works on native Windows (no WSL); suggests documenting this as an alternative installation path in Windows docs.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • docs/installation/windows.md

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. mvanhorn commented on Jun 28, 2026

    @mvanhorn
    Contributor

    Submitted a fix in #2704.

  4. alexya commented on Jul 4, 2026

    @alexya

    I don't know why, but when I run rtk init -g or manually add as the @vbadonskidev-gif mentioned, my claude can't read the rtk.
    e.g.

    
     ▐▛███▜▌   Claude Code v2.1.201
    ▝▜█████▛▘  Haiku 4.5 · API Usage Billing
      ▘▘ ▝▝    E:\src\myweb
    
    
    > git status
    
      Ran 1 shell command
    PreToolUse:Bash hook error
    Failed with non-blocking status code: /usr/bin/bash: line 1: rtk: command not found
    

    I am on windows 11, powershell (not WSL).

    where rtk
    C:\Users\alexya\.cargo\bin\rtk.exe
    C:\Users\alexya\.local\bin\rtk.exe
    
    rtk --version
    rtk 0.42.4
    
  5. KuSh commented on Nov 23, 2026

    @KuSh
    Collaborator

    The troubleshooting page has described the native rtk hook claude hook in settings.json, which needs no WSL, since v0.52.0. The Windows section of the installation guide has said so since v1.0.0, and both pages say that rtk init -g installs that hook on Windows. If the docs still miss something for your setup on the latest version, please comment or reopen.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docsdocumentationgood first issueplatform:windowspriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions