Skip to content

Windows and GitHub Copilot #2424

Closed
Closed

Description

@BillChirico

I've installed everything for windows and GitHub Copilot and it does not seem to be using RTK at all. How can I get it to use RTK more to save tokens?

Image Image

I see this in the README.md, but unsure what it actually means: "On native Windows (cmd.exe / PowerShell), RTK filters work but the hook does not auto-rewrite commands"

Activity

  1. pszymkowiak commented on Jun 12, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    📋 Category question
    🟢 Priority low
    🎯 Confidence 78%

    Summary

    User asking how to configure RTK with GitHub Copilot on Windows; likely a usage/setup question referencing a known Windows hook limitation documented in the README

    📁 Relevant files
    • README.md

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

  2. romain-cureau commented on Jul 23, 2026

    @romain-cureau
    Contributor

    The README line you quoted has a concrete cause, at least for Copilot CLI on Windows: rtk hook copilot only recognizes the native Copilot payload when toolName == "bash", but Copilot CLI names its shell tool powershell on Windows. The payload therefore falls through to PassThrough and the native path never runs.

    Captured from a live session (Copilot CLI 1.0.73, Windows 11, RTK 0.43.0):

    {"sessionId":"...","cwd":"C:\Windows\System32","toolName":"powershell","toolArgs":"{\"command\":\"rtk gain\",...}"}

    toolArgs is already the JSON-encoded string RTK expects — only toolName differs.

    Details in #3178, one-line fix + regression test in #3179.

    Note that on Windows the rewrite does still happen today, through the Claude-compat PreToolUse entry that rtk init also writes — but that path emits permissionDecision: "ask", so you get an approval prompt on every single command (#3037). So depending on which entry answers, you either get no rewrite or a prompt every time.

  3. romain-cureau commented on Jul 27, 2026

    @romain-cureau
    Contributor

    Retracting the last paragraph of my comment above: I claimed the unrecognized toolName: "powershell" explains the README's "on native Windows the hook does not auto-rewrite commands". That is wrong for Copilot CLI — I've since tested it instead of inferring it.

    Copilot CLI fires both hook entries that rtk init --copilot registers. The camelCase one is indeed ignored on Windows (that part stands, #3178/#3179), but the PascalCase PreToolUse one receives the same call remapped to tool_name: "Bash" and its updatedInput is applied — verified with a throwaway hook that rewrote echo PROBE_INPUT_5521 into echo REWRITE_APPLIED_9137, and the session printed REWRITE_APPLIED_9137.

    So on Windows the rewrite does happen; what you'd notice instead is a permission prompt on every command (#3037, fixed properly by #3212). Whatever is causing "not using RTK at all" in your setup is something else — worth checking that ~/.copilot/hooks/rtk-rewrite.json exists and that the commands you're running are ones rtk actually rewrites (rtk hook check "<your command>" shows this).

    Sorry for the misdirection.

  4. BillChirico commented on Jul 27, 2026

    @BillChirico
    Author

    Retracting the last paragraph of my comment above: I claimed the unrecognized toolName: "powershell" explains the README's "on native Windows the hook does not auto-rewrite commands". That is wrong for Copilot CLI — I've since tested it instead of inferring it.

    Copilot CLI fires both hook entries that rtk init --copilot registers. The camelCase one is indeed ignored on Windows (that part stands, #3178/#3179), but the PascalCase PreToolUse one receives the same call remapped to tool_name: "Bash" and its updatedInput is applied — verified with a throwaway hook that rewrote echo PROBE_INPUT_5521 into echo REWRITE_APPLIED_9137, and the session printed REWRITE_APPLIED_9137.

    So on Windows the rewrite does happen; what you'd notice instead is a permission prompt on every command (#3037, fixed properly by #3212). Whatever is causing "not using RTK at all" in your setup is something else — worth checking that ~/.copilot/hooks/rtk-rewrite.json exists and that the commands you're running are ones rtk actually rewrites (rtk hook check "<your command>" shows this).

    Sorry for the misdirection.

    So is it working properly or not for Windows?

  5. KuSh commented on Sep 5, 2026

    @KuSh
    Collaborator

    This looks resolved on the current code (PR #3179 (v0.44.1), PR #3212), but it could not be fully reproduced here. Marking it resolved-pending-close: it will be closed in a while unless someone reports it still happening on the latest version.

  6. added
    resolved-pending-close
    on Sep 5, 2026
  7. KuSh commented on Sep 13, 2026

    @KuSh
    Collaborator

    This has carried the resolved-pending-close label with no new report of it happening, so closing it. Two concrete causes were found here and both are fixed: #3179 (v0.44.1) made the hook recognise Copilot CLI's shell tool when it is named powershell on Windows, and #3212 removed the permission prompt that fired on every rewritten command. Feeding the Windows Copilot payload to the current build returns the rewritten rtk git status with no prompt. If commands still are not going through rtk on the latest version, comment here with the output of rtk hook check "<your command>" and we will 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:cliplatform:windowspriority:lowquestionresolved-pending-close

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions